Changeset 3978 in subversion for trunk/roundcubemail/program/include/rcube_mdb2.php
- Timestamp:
- Sep 21, 2010 2:43:24 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_mdb2.php
r3947 r3978 31 31 * @author Thomas Bruederli <roundcube@gmail.com> 32 32 * @author Lukas Kahwe Smith <smith@pooteeweet.org> 33 * @version 1.1 633 * @version 1.17 34 34 * @link http://pear.php.net/package/MDB2 35 35 */ … … 122 122 function db_connect($mode) 123 123 { 124 $this->db_mode = $mode;125 126 124 // Already connected 127 125 if ($this->db_connected) { 128 126 // no replication, current connection is ok 129 if ( $this->db_dsnw == $this->db_dsnr)127 if (empty($this->db_dsnr) || $this->db_dsnw == $this->db_dsnr) 130 128 return; 131 129 132 // connected to master, current connection is ok130 // connected to read-write db, current connection is ok 133 131 if ($this->db_mode == 'w') 134 132 return; … … 142 140 143 141 $this->db_handle = $this->dsn_connect($dsn); 144 $this->db_connected = true; 142 $this->db_connected = !PEAR::isError($this->db_handle); 143 $this->db_mode = $mode; 145 144 } 146 145 … … 196 195 function query() 197 196 { 198 if (!$this->is_connected())199 return null;200 201 197 $params = func_get_args(); 202 198 $query = array_shift($params); … … 243 239 244 240 $this->db_connect($mode); 241 242 // check connection before proceeding 243 if (!$this->is_connected()) 244 return null; 245 245 246 246 if ($this->db_provider == 'sqlite')
Note: See TracChangeset
for help on using the changeset viewer.
