Changeset 1066
- Timestamp:
- 08/26/08 22:40:52 (3 months ago)
- Files:
-
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/db/jDb.class.php (modified) (1 diff)
- branches/1.0.x/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php (modified) (2 diffs)
- trunk/lib/jelix/CREDITS (modified) (1 diff)
- trunk/lib/jelix/db/jDb.class.php (modified) (1 diff)
- trunk/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.x/lib/jelix/CREDITS
r1060 r1066 130 130 131 131 Laurent Raufaste (aka analogue) 132 - patch on postgresql driver (#123)132 - patches on postgresql driver (#123, #671, #672) 133 133 134 134 Rahal branches/1.0.x/lib/jelix/db/jDb.class.php
r699 r1066 56 56 57 57 $profil = self::getProfil ($name); 58 59 // we set the name to avoid two connection for a same profil, when it is the default profil 60 // and when we call getConnection two times, one with no name and on with the name 61 if (!$name) { 62 $name = $profil['name']; 63 } 58 64 59 65 if (!isset ($cnxPool[$name])){ branches/1.0.x/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php
r640 r1066 7 7 * @contributor Yannick Le Guédart 8 8 * @contributor Laurent Raufaste 9 * @copyright 2001-2005 CopixTeam, 2005-2007 Laurent Jouanneau, 2007 Laurent Raufaste9 * @copyright 2001-2005 CopixTeam, 2005-2007 Laurent Jouanneau, 2007-2008 Laurent Raufaste 10 10 * This class was get originally from the Copix project (CopixDBConnectionPostgreSQL, Copix 2.3dev20050901, http://www.copix.org) 11 11 * Few lines of code are still copyrighted 2001-2005 CopixTeam (LGPL licence). … … 68 68 $str = ''; 69 69 70 // on fait une distinction car si host indiqué -> connection TCP/IP, sinon socket unix70 // we do a distinction because if the host is given == TCP/IP connection else unix socket 71 71 if($this->profil['host'] != '') 72 72 $str = 'host=\''.$this->profil['host'].'\''.$str; 73 73 74 // Si le port est défini on le rajoute à la chaine de connexion75 74 if (isset($this->profil['port'])) { 76 75 $str .= ' port=\''.$this->profil['port'].'\''; 77 76 } 78 77 79 // Si le nom de la base de données est spécifié, on le rajoute à la chaine de connexion80 78 if ($this->profil['database'] != '') { 81 79 $str .= ' dbname=\''.$this->profil['database'].'\''; 82 80 } 83 81 84 // Si le nom d'utilisateur est spécifié, on le rajoute à la chaine de connexion 85 // on fait un isset et non une équivalence à chaine vide pour permettre de specifier 86 // tout en permettant aussi d'utiliser les variables d'environnements (dans ce cas, ne pas mettre de parametre user dans la conf) 82 // we do isset instead of equality test against an empty string, to allow to specify 83 // that we want to use configuration set in environment variables 87 84 if (isset($this->profil['user'])) { 88 85 $str .= ' user=\''.$this->profil['user'].'\''; 89 86 } 90 87 91 // Si le mot de passe est spécifié, on le rajoute à la chaine de connexion92 // même remarque que pour login.93 88 if (isset($this->profil['password'])) { 94 89 $str .= ' password=\''.$this->profil['password'].'\''; 90 } 91 92 if (isset($this->profil['timeout']) && $this->profil['timeout'] != '') { 93 $str .= ' connect_timeout=\''.$this->profil['timeout'].'\''; 95 94 } 96 95 trunk/lib/jelix/CREDITS
r1061 r1066 164 164 165 165 Laurent Raufaste (aka analogue) 166 - patch on postgresql driver (#123)166 - patches on postgresql driver (#123, #671, #672) 167 167 168 168 Rahal trunk/lib/jelix/db/jDb.class.php
r1026 r1066 59 59 60 60 $profil = self::getProfil ($name); 61 62 if (!$name) { 63 // we set the name to avoid two connection for a same profil, when it is the default profil 64 // and when we call getConnection two times, one with no name and on with the name 65 $name = $profil['name']; 66 } 61 67 62 68 if (!isset ($cnxPool[$name])){ trunk/lib/jelix/plugins/db/pgsql/pgsql.dbconnection.php
r1026 r1066 7 7 * @contributor Yannick Le Guédart 8 8 * @contributor Laurent Raufaste 9 * @copyright 2001-2005 CopixTeam, 2005-2007 Laurent Jouanneau, 2007 Laurent Raufaste9 * @copyright 2001-2005 CopixTeam, 2005-2007 Laurent Jouanneau, 2007-2008 Laurent Raufaste 10 10 * This class was get originally from the Copix project (CopixDBConnectionPostgreSQL, Copix 2.3dev20050901, http://www.copix.org) 11 11 * Few lines of code are still copyrighted 2001-2005 CopixTeam (LGPL licence). … … 68 68 $str = ''; 69 69 70 // on fait une distinction car si host indiqué -> connection TCP/IP, sinon socket unix70 // we do a distinction because if the host is given == TCP/IP connection else unix socket 71 71 if($this->profil['host'] != '') 72 72 $str = 'host=\''.$this->profil['host'].'\''.$str; 73 73 74 // Si le port est défini on le rajoute à la chaine de connexion75 74 if (isset($this->profil['port'])) { 76 75 $str .= ' port=\''.$this->profil['port'].'\''; 77 76 } 78 77 79 // Si le nom de la base de données est spécifié, on le rajoute à la chaine de connexion80 78 if ($this->profil['database'] != '') { 81 79 $str .= ' dbname=\''.$this->profil['database'].'\''; 82 80 } 83 81 84 // Si le nom d'utilisateur est spécifié, on le rajoute à la chaine de connexion 85 // on fait un isset et non une équivalence à chaine vide pour permettre de specifier 86 // tout en permettant aussi d'utiliser les variables d'environnements (dans ce cas, ne pas mettre de parametre user dans la conf) 82 // we do isset instead of equality test against an empty string, to allow to specify 83 // that we want to use configuration set in environment variables 87 84 if (isset($this->profil['user'])) { 88 85 $str .= ' user=\''.$this->profil['user'].'\''; 89 86 } 90 87 91 // Si le mot de passe est spécifié, on le rajoute à la chaine de connexion92 // même remarque que pour login.93 88 if (isset($this->profil['password'])) { 94 89 $str .= ' password=\''.$this->profil['password'].'\''; 90 } 91 92 if (isset($this->profil['timeout']) && $this->profil['timeout'] != '') { 93 $str .= ' connect_timeout=\''.$this->profil['timeout'].'\''; 95 94 } 96 95
