When connection to read-only db fails try to connect to write-master, but only if it is defined

pull/15/head^2
Aleksander Machniak 12 years ago
parent f3d017cfaa
commit bc2c02feec

@ -222,7 +222,7 @@ class rcube_db
$this->db_connected = is_object($this->dbh);
// use write-master when read-only fails
if (!$this->db_connected && $mode == 'r') {
if (!$this->db_connected && $mode == 'r' && $this->is_replicated()) {
$mode = 'w';
$this->dbh = $this->dsn_connect($this->db_dsnw_array);
$this->db_connected = is_object($this->dbh);

Loading…
Cancel
Save