From: Michael M Slusarz Date: Thu, 13 May 2010 21:37:58 +0000 (-0600) Subject: More places to fix if no split DB is configured X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b4ba6ed538947767af0304941d7c9fc93caad90d;p=horde.git More places to fix if no split DB is configured --- diff --git a/framework/Alarm/lib/Horde/Alarm/Sql.php b/framework/Alarm/lib/Horde/Alarm/Sql.php index 2a9f503c6..fc98ea3aa 100644 --- a/framework/Alarm/lib/Horde/Alarm/Sql.php +++ b/framework/Alarm/lib/Horde/Alarm/Sql.php @@ -55,11 +55,9 @@ class Horde_Alarm_Sql extends Horde_Alarm } $this->_db = $params['db']; - if (isset($params['write_db'])) { - $this->_write_db = $params['write_db']; - } else { - $this->_write_db = $this->_db; - } + $this->_write_db = isset($params['write_db']) + ? $params['write_db'] + : $this->_db; unset($params['db'], $params['write_db']); diff --git a/framework/Cache/lib/Horde/Cache/Sql.php b/framework/Cache/lib/Horde/Cache/Sql.php index 5e0c76940..f1a31a003 100644 --- a/framework/Cache/lib/Horde/Cache/Sql.php +++ b/framework/Cache/lib/Horde/Cache/Sql.php @@ -74,9 +74,9 @@ class Horde_Cache_Sql extends Horde_Cache_Base } $this->_db = $params['db']; - if (isset($params['write_db'])) { - $this->_write_db = $params['write_db']; - } + $this->_write_db = isset($params['write_db']) + ? $params['write_db'] + : $this->_db; if (isset($params['use_memorycache'])) { $this->_mc = $params['use_memorycache']; diff --git a/framework/Lock/lib/Horde/Lock/Sql.php b/framework/Lock/lib/Horde/Lock/Sql.php index c7b2addef..e24055937 100644 --- a/framework/Lock/lib/Horde/Lock/Sql.php +++ b/framework/Lock/lib/Horde/Lock/Sql.php @@ -65,9 +65,9 @@ class Horde_Lock_Sql extends Horde_Lock_Driver } $this->_db = $params['db']; - if (isset($params['write_db'])) { - $this->_write_db = $params['write_db']; - } + $this->_write_db = isset($params['write_db']) + ? $params['write_db'] + : $this->_db; unset($params['db'], $params['write_db']); diff --git a/framework/Perms/lib/Horde/Perms/Sql.php b/framework/Perms/lib/Horde/Perms/Sql.php index 66f0b85b7..dd2937bbb 100644 --- a/framework/Perms/lib/Horde/Perms/Sql.php +++ b/framework/Perms/lib/Horde/Perms/Sql.php @@ -71,9 +71,9 @@ class Horde_Perms_Sql extends Horde_Perms } $this->_db = $params['db']; - if (isset($params['write_db'])) { - $this->_write_db = $params['write_db']; - } + $this->_write_db = isset($params['write_db']) + ? $params['write_db'] + : $this->_db; unset($params['db'], $params['write_db']); diff --git a/framework/SessionHandler/lib/Horde/SessionHandler/Sql.php b/framework/SessionHandler/lib/Horde/SessionHandler/Sql.php index 3eac8df5e..0be3fa79e 100644 --- a/framework/SessionHandler/lib/Horde/SessionHandler/Sql.php +++ b/framework/SessionHandler/lib/Horde/SessionHandler/Sql.php @@ -53,6 +53,10 @@ class Horde_SessionHandler_Sql extends Horde_SessionHandler } $this->_db = $params['db']; + $this->_write_db = isset($params['write_db']) + ? $params['write_db'] + : $this->_db; + if (isset($params['write_db'])) { $this->_write_db = $params['write_db']; } @@ -79,7 +83,7 @@ class Horde_SessionHandler_Sql extends Horde_SessionHandler $this->_db->autoCommit(true); @$this->_db->disconnect(); - if ($this->_write_db) { + if ($this->_db != $this->_write_db) { $this->_write_db->commit(); $this->_write_db->autoCommit(true); @$this->_write_db->disconnect();