From: Michael J. Rubinsky Date: Thu, 7 Oct 2010 16:05:42 +0000 (-0400) Subject: Use Horde_Core_Factory_DbPear directly, change factory method to create() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f4a82832e8d7286ba074fbbe12b0a83933f63936;p=horde.git Use Horde_Core_Factory_DbPear directly, change factory method to create() --- diff --git a/agora/scripts/phorum2agora.php b/agora/scripts/phorum2agora.php index f1343ed58..6976b8a09 100755 --- a/agora/scripts/phorum2agora.php +++ b/agora/scripts/phorum2agora.php @@ -19,7 +19,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true)); /* Open Agora database. */ -$db_agora = $db_phorum = $injector->getInstance('Horde_Db_Pear')->getDb(); +$db_agora = $db_phorum = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); // We accept the user name on the command-line. $ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'h:p:a:t:f:c:', diff --git a/beatnik/lib/Driver/pdnsgsql.php b/beatnik/lib/Driver/pdnsgsql.php index 62b3a99f1..aa5e7fa4a 100644 --- a/beatnik/lib/Driver/pdnsgsql.php +++ b/beatnik/lib/Driver/pdnsgsql.php @@ -425,8 +425,8 @@ class Beatnik_Driver_pdnsgsql extends Beatnik_Driver return true; } - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'beatnik', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'beatnik', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'beatnik', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'beatnik', 'storage'); return true; } diff --git a/beatnik/lib/Driver/sql.php b/beatnik/lib/Driver/sql.php index b75c0bae9..6ab6a0793 100644 --- a/beatnik/lib/Driver/sql.php +++ b/beatnik/lib/Driver/sql.php @@ -222,8 +222,8 @@ class Beatnik_Driver_sql extends Beatnik_Driver return true; } - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'beatnik', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'beatnik', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'beatnik', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'beatnik', 'storage'); return true; } diff --git a/folks/lib/Driver/sql.php b/folks/lib/Driver/sql.php index 3872fadf8..61f0c8384 100644 --- a/folks/lib/Driver/sql.php +++ b/folks/lib/Driver/sql.php @@ -571,8 +571,8 @@ class Folks_Driver_sql extends Folks_Driver { */ private function _connect() { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'folks', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'folks', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'folks', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'folks', 'storage'); return true; } diff --git a/folks/lib/Friends/sql.php b/folks/lib/Friends/sql.php index e3c6f0089..d82324de0 100644 --- a/folks/lib/Friends/sql.php +++ b/folks/lib/Friends/sql.php @@ -206,8 +206,8 @@ class Folks_Friends_sql extends Folks_Friends { 'friends' => 'folks_friends' ), $this->_params); - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'folks', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'folks', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'folks', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'folks', 'storage'); return true; } diff --git a/folks/scripts/activity.php b/folks/scripts/activity.php index a712438f3..5f985a40a 100644 --- a/folks/scripts/activity.php +++ b/folks/scripts/activity.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('folks', array('authentication' => 'none', 'cli' => true)); try { - $db = $injector->getInstance('Horde_Db_Pear')->getDb(); + $db = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); } catch (Horde_Exception $e) { $cli->fatal($e); } diff --git a/folks/scripts/import_letter.php b/folks/scripts/import_letter.php index d9592a151..c1aca26cb 100644 --- a/folks/scripts/import_letter.php +++ b/folks/scripts/import_letter.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('folks', array('authentication' => 'none', 'cli' => true)); try { - $db = $injector->getInstance('Horde_Db_Pear')->getDb(); + $db = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); } catch (Horde_Exception $e) { $cli->fatal($e); } diff --git a/folks/scripts/mail-filter.php b/folks/scripts/mail-filter.php index dd3695eec..7a20060ab 100644 --- a/folks/scripts/mail-filter.php +++ b/folks/scripts/mail-filter.php @@ -104,7 +104,7 @@ $from_str = array('Undelivered Mail', 'MAILER-DAEMON', 'root@' . $conf['server'] // Connect to db try { - $db = $injector->getInstance('Horde_Db_Pear')->getDb(); + $db = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); } catch (Horde_Exception $e) { $cli->fatal($e); } diff --git a/folks/scripts/mail.php b/folks/scripts/mail.php index 20c3d4dec..e183d4c37 100644 --- a/folks/scripts/mail.php +++ b/folks/scripts/mail.php @@ -81,7 +81,7 @@ if (!$registry->isAdmin(array('permission' => 'folks:admin'))) { // Connect to db try { - $db = $injector->getInstance('Horde_Db_Pear')->getDb(); + $db = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); } catch (Horde_Exception $e) { $cli->fatal($e); } diff --git a/folks/scripts/popularity.php b/folks/scripts/popularity.php index 90ec7d1cf..3ecd845d8 100644 --- a/folks/scripts/popularity.php +++ b/folks/scripts/popularity.php @@ -20,7 +20,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('folks', array('authentication' => 'none', 'cli' => true)); try { - $db = $injector->getInstance('Horde_Db_Pear')->getDb(); + $db = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); } catch (Horde_Exception $e) { $cli->fatal($e); } diff --git a/framework/Core/lib/Horde/Core/Binder/DbPear.php b/framework/Core/lib/Horde/Core/Binder/DbPear.php deleted file mode 100644 index 3a83625d4..000000000 --- a/framework/Core/lib/Horde/Core/Binder/DbPear.php +++ /dev/null @@ -1,17 +0,0 @@ -_instances[$sig] = $this->getDb($type); + $this->_instances[$sig] = $this->create($type); return $this->_instances[$sig]; } diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index a7c24e872..03c150676 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -265,7 +265,6 @@ class Horde_Registry $binders = array( 'Horde_Auth_Factory' => new Horde_Core_Binder_AuthFactory(), 'Horde_Core_Auth_Signup' => new Horde_Core_Binder_AuthSignup(), - 'Horde_Db_Pear' => new Horde_Core_Binder_DbPear(), 'Horde_History' => new Horde_Core_Binder_History(), 'Horde_Http_Client' => new Horde_Core_Binder_HttpClient(), 'Horde_Log_Logger' => new Horde_Core_Binder_Logger(), diff --git a/framework/Core/package.xml b/framework/Core/package.xml index 2ffe26f3e..7455c9154 100644 --- a/framework/Core/package.xml +++ b/framework/Core/package.xml @@ -113,7 +113,6 @@ Application Framework. - @@ -428,7 +427,6 @@ Application Framework. - diff --git a/framework/DataTree/DataTree/sql.php b/framework/DataTree/DataTree/sql.php index c730ee6d0..669301abe 100644 --- a/framework/DataTree/DataTree/sql.php +++ b/framework/DataTree/DataTree/sql.php @@ -1853,8 +1853,8 @@ class DataTree_sql extends DataTree { function _init() { try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw'); } catch (Horde_Exception $e) { return PEAR::raiseError($e->getMessage()); } diff --git a/framework/SyncML/SyncML/Backend/Horde.php b/framework/SyncML/SyncML/Backend/Horde.php index 55baba839..82f3a0611 100644 --- a/framework/SyncML/SyncML/Backend/Horde.php +++ b/framework/SyncML/SyncML/Backend/Horde.php @@ -30,7 +30,7 @@ class SyncML_Backend_Horde extends SyncML_Backend { { parent::__construct($params); - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb(); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create(); } /** diff --git a/hermes/lib/Driver/sql.php b/hermes/lib/Driver/sql.php index 15d8aa52d..c34b93b4d 100644 --- a/hermes/lib/Driver/sql.php +++ b/hermes/lib/Driver/sql.php @@ -701,7 +701,7 @@ class Hermes_Driver_sql extends Hermes_Driver { return true; } - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'hermes', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'hermes', 'storage'); return true; } diff --git a/horde/lib/Block/metar.php b/horde/lib/Block/metar.php index eb0971ff0..d2df0f718 100644 --- a/horde/lib/Block/metar.php +++ b/horde/lib/Block/metar.php @@ -46,7 +46,7 @@ class Horde_Block_Horde_metar extends Horde_Block global $conf; // Get locations from the database. - $db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb(); + $db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create(); $result = $db->query('SELECT icao, name, country FROM metarAirports ORDER BY country'); if (is_a($result, 'PEAR_Error')) { diff --git a/horde/scripts/upgrades/convert_datatree_groups_to_sql.php b/horde/scripts/upgrades/convert_datatree_groups_to_sql.php index 0ed5fe5c1..3a7ef696e 100755 --- a/horde/scripts/upgrades/convert_datatree_groups_to_sql.php +++ b/horde/scripts/upgrades/convert_datatree_groups_to_sql.php @@ -24,7 +24,7 @@ VALUES (?, ?) '; -$db = $injector->getInstance('Horde_Db_Pear')->getDb(); +$db = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); foreach ($g->listGroups(true) as $id => $name) { if ($id == -1) { diff --git a/horde/scripts/upgrades/convert_datatree_perms_to_sql.php b/horde/scripts/upgrades/convert_datatree_perms_to_sql.php index 29da5d44b..e7458857c 100755 --- a/horde/scripts/upgrades/convert_datatree_perms_to_sql.php +++ b/horde/scripts/upgrades/convert_datatree_perms_to_sql.php @@ -17,7 +17,7 @@ VALUES (?, ?, ?, ?) '; -$db = $injector->getInstance('Horde_Db_Pear')->getDb(); +$db = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); foreach ($p->getTree() as $id => $row) { if ($id == -1) { diff --git a/hylax/lib/Storage/sql.php b/hylax/lib/Storage/sql.php index 1eff224b3..7ddedb127 100644 --- a/hylax/lib/Storage/sql.php +++ b/hylax/lib/Storage/sql.php @@ -373,7 +373,7 @@ class Hylax_Storage_sql extends Hylax_Storage { function initialise() { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'hylax', 'sql'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'hylax', 'sql'); return true; } diff --git a/ingo/lib/Storage/Sql.php b/ingo/lib/Storage/Sql.php index b3cbc409a..2f980693b 100644 --- a/ingo/lib/Storage/Sql.php +++ b/ingo/lib/Storage/Sql.php @@ -47,8 +47,8 @@ class Ingo_Storage_Sql extends Ingo_Storage */ public function __construct($params = array()) { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'ingo', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'ingo', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'ingo', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'ingo', 'storage'); $this->_params = array_merge($params, array( 'table_rules' => 'ingo_rules', diff --git a/jonah/lib/Driver/Sql.php b/jonah/lib/Driver/Sql.php index 359bd8b3b..274d6db23 100644 --- a/jonah/lib/Driver/Sql.php +++ b/jonah/lib/Driver/Sql.php @@ -890,7 +890,7 @@ class Jonah_Driver_Sql extends Jonah_Driver } try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'jonah', 'news'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'jonah', 'news'); } catch (Horde_Exception $e) { return PEAR::raiseError($e->getMessage()); } diff --git a/kronolith/lib/Driver/Sql.php b/kronolith/lib/Driver/Sql.php index c56e58827..76c154ae0 100644 --- a/kronolith/lib/Driver/Sql.php +++ b/kronolith/lib/Driver/Sql.php @@ -885,8 +885,8 @@ class Kronolith_Driver_Sql extends Kronolith_Driver public function initialize() { try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'kronolith', 'calendar'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'kronolith', 'calendar'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'kronolith', 'calendar'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'kronolith', 'calendar'); } catch (Horde_Exception $e) { throw new Kronolith_Exception($e); } diff --git a/kronolith/lib/Geo/Sql.php b/kronolith/lib/Geo/Sql.php index e6e3a0b3c..b3776f97e 100644 --- a/kronolith/lib/Geo/Sql.php +++ b/kronolith/lib/Geo/Sql.php @@ -23,8 +23,8 @@ class Kronolith_Geo_Sql extends Kronolith_Geo public function initialize() { try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'kronolith', 'calendar'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'kronolith', 'calendar'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'kronolith', 'calendar'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'kronolith', 'calendar'); } catch (Horde_Exception $e) { throw new Kronolith_Exception($e); } diff --git a/kronolith/lib/Storage/sql.php b/kronolith/lib/Storage/sql.php index ddc14b3b0..1949a2d8c 100644 --- a/kronolith/lib/Storage/sql.php +++ b/kronolith/lib/Storage/sql.php @@ -51,8 +51,8 @@ class Kronolith_Storage_sql extends Kronolith_Storage public function initialize() { try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'kronolith', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'kronolith', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'kronolith', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'kronolith', 'storage'); } catch (Horde_Exception $e) { throw new Kronolith_Exception($e); } diff --git a/kronolith/scripts/upgrades/convert_to_utc.php b/kronolith/scripts/upgrades/convert_to_utc.php index e70e6f3ea..58f1c7c6d 100755 --- a/kronolith/scripts/upgrades/convert_to_utc.php +++ b/kronolith/scripts/upgrades/convert_to_utc.php @@ -10,7 +10,7 @@ Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'cli' => /* Prepare DB stuff. */ PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, create_function('$e', 'echo $e->toString()."\n";exit;')); -$db = $injector->getInstance('Horde_Db_Pear')->getDb(); +$db = $injector->getInstance('Horde_Core_Factory_DbPear')->create(); $result = $db->query('SELECT event_title, event_id, event_creator_id, event_start, event_end, event_allday, event_recurenddate FROM ' . $conf['calendar']['params']['table'] . ' ORDER BY event_creator_id'); $stmt = $db->prepare('UPDATE kronolith_events SET event_start = ?, event_end = ?, event_recurenddate = ? WHERE event_id = ?'); diff --git a/luxor/lib/Driver/sql.php b/luxor/lib/Driver/sql.php index a7641690f..00e66a908 100644 --- a/luxor/lib/Driver/sql.php +++ b/luxor/lib/Driver/sql.php @@ -512,7 +512,7 @@ class Luxor_Driver_sql extends Luxor_Driver { function _connect() { if (!$this->_connected) { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'luxor', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'luxor', 'storage'); $this->_connected = true; } diff --git a/mnemo/lib/Driver/sql.php b/mnemo/lib/Driver/sql.php index 360cdbb1f..20a0af624 100644 --- a/mnemo/lib/Driver/sql.php +++ b/mnemo/lib/Driver/sql.php @@ -59,8 +59,8 @@ class Mnemo_Driver_sql extends Mnemo_Driver { */ function initialize() { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'mnemo', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'mnemo', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'mnemo', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'mnemo', 'storage'); $this->_params = array_merge(array( 'table' => 'mnemo_memos' diff --git a/operator/lib/Driver/asterisksql.php b/operator/lib/Driver/asterisksql.php index 068bdb3a4..5e0307591 100644 --- a/operator/lib/Driver/asterisksql.php +++ b/operator/lib/Driver/asterisksql.php @@ -339,8 +339,8 @@ class Operator_Driver_asterisksql extends Operator_Driver { return true; } - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'operator', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'operator', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'operator', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'operator', 'storage'); return true; } diff --git a/pastie/lib/Driver/Sql.php b/pastie/lib/Driver/Sql.php index 2d176b642..479f096ca 100644 --- a/pastie/lib/Driver/Sql.php +++ b/pastie/lib/Driver/Sql.php @@ -239,8 +239,8 @@ class Pastie_Driver_Sql extends Pastie_Driver protected function _connect() { if (!$this->_connected) { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'pastie', 'storage'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'pastie', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'pastie', 'storage'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'pastie', 'storage'); $this->_connected = true; } } diff --git a/shout/lib/Driver/Sql.php b/shout/lib/Driver/Sql.php index d21783f39..3a0ed6588 100644 --- a/shout/lib/Driver/Sql.php +++ b/shout/lib/Driver/Sql.php @@ -720,8 +720,8 @@ class Shout_Driver_Sql extends Shout_Driver { if (!$this->_connected) { try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'shout', $this->_params['class']); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'shout', $this->_params['class']); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'shout', $this->_params['class']); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'shout', $this->_params['class']); } catch (Horde_Exception $e) { throw new Shout_Exception($e); } diff --git a/turba/lib/Driver/Sql.php b/turba/lib/Driver/Sql.php index 136bf1958..ee3ea661d 100644 --- a/turba/lib/Driver/Sql.php +++ b/turba/lib/Driver/Sql.php @@ -53,8 +53,8 @@ class Turba_Driver_Sql extends Turba_Driver protected function _init() { try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'turba', $this->_params); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'turba', $this->_params); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'turba', $this->_params); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'turba', $this->_params); } catch (Horde_Exception $e) { throw new Turba_Exception($e); } diff --git a/vilma/lib/Driver/qmailldap.php b/vilma/lib/Driver/qmailldap.php index e92a3a347..f9a3ab6b0 100644 --- a/vilma/lib/Driver/qmailldap.php +++ b/vilma/lib/Driver/qmailldap.php @@ -1264,7 +1264,7 @@ class Vilma_Driver_qmailldap extends Vilma_Driver { global $registry; try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'vilma', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'vilma', 'storage'); } catch (Horde_Exception $e) { return PEAR::raiseError($e->getMessage()); } diff --git a/vilma/lib/Driver/sql.php b/vilma/lib/Driver/sql.php index fc598595b..5d3f3dfaf 100644 --- a/vilma/lib/Driver/sql.php +++ b/vilma/lib/Driver/sql.php @@ -589,7 +589,7 @@ class Vilma_Driver_sql extends Vilma_Driver { function initialise() { try { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'vilma', 'storage'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'vilma', 'storage'); } catch (Horde_Exception $e) { return PEAR::raiseError($e->getMessage()); } diff --git a/whups/lib/Driver/sql.php b/whups/lib/Driver/sql.php index 8896844aa..ca725d82a 100644 --- a/whups/lib/Driver/sql.php +++ b/whups/lib/Driver/sql.php @@ -2869,8 +2869,8 @@ class Whups_Driver_sql extends Whups_Driver { */ function initialise() { - $this->_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('read', 'whups', 'tickets'); - $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Db_Pear')->getDb('rw', 'whups', 'tickets'); + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('read', 'whups', 'tickets'); + $this->_write_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_DbPear')->create('rw', 'whups', 'tickets'); return true; }