Subversion Repositories Applications.framework

Rev

Rev 429 | Rev 433 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 429 Rev 430
Line 15... Line 15...
15
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
15
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
16
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
16
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
17
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
17
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
18
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
18
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
19
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
19
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
20
 * @version	$Id: Bdd.php 429 2013-07-24 08:31:57Z raphael $
20
 * @version	$Id: Bdd.php 430 2013-08-23 12:55:03Z raphael $
21
 * @link		/doc/framework/
21
 * @link		/doc/framework/
22
 */
22
 */
23
class Bdd {
23
class Bdd {
24
	/** Constante stockant le squelette du message en cas d'erreur de requête sql. */
24
	/** Constante stockant le squelette du message en cas d'erreur de requête sql. */
25
	const ERREUR_REQUETE_TPL = 'Requête echec.\nFichier : %s.\nLigne : %s.\nMessage : %s.\nRequête : %s';
25
	const ERREUR_REQUETE_TPL = 'Requête echec.\nFichier : %s.\nLigne : %s.\nMessage : %s.\nRequête : %s';
Line 92... Line 92...
92
		$this->type = Config::get('bdd_protocole');
92
		$this->type = Config::get('bdd_protocole');
93
		$this->hote = Config::get('bdd_serveur');
93
		$this->hote = Config::get('bdd_serveur');
94
		$this->bdd_nom = Config::get('bdd_nom');
94
		$this->bdd_nom = Config::get('bdd_nom');
95
		$this->utilisateur = Config::get('bdd_utilisateur');
95
		$this->utilisateur = Config::get('bdd_utilisateur');
96
		$this->pass = Config::get('bdd_mot_de_passe');
96
		$this->pass = Config::get('bdd_mot_de_passe');
97
		$this->dsn = Config::get('bdd_dsn');
-
 
Line 98... Line 97...
98
		
97
		
Line 99... Line -...
99
		$this->encodage = Config::get('bdd_encodage');
-
 
100
 
98
		$this->encodage = Config::get('bdd_encodage');
101
		if (!$this->dsn) {
99
 
102
			if ($this->type == 'sqlite' || $this->type == 'sqlite2') {
100
		if ($this->type == 'sqlite' || $this->type == 'sqlite2') {
103
				$this->dsn = $this->type.':'.$this->hote;
101
			$this->dsn = $this->type.':'.$this->hote;
104
			} else {
-
 
105
				$this->dsn = $this->type.':dbname='.$this->bdd_nom.';host='.$this->hote;
102
		} else {
106
			}
103
			$this->dsn = $this->type.':dbname='.$this->bdd_nom.';host='.$this->hote;
107
		}
104
		}
Line 108... Line 105...
108
		$this->initialiserProtocole();
105
		$this->initialiserProtocole();