From 429977502ad7b52988beaf3ff32c78b98807a6a8 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 13 Jan 2011 01:39:43 -0500 Subject: [PATCH] This should be a configuration array, not a Horde_Db_Adapter object. We shouldn't expect administrators to know how to create a custom Horde_Db_Adapter object. Just pass the configuration array, the factory will do the rest. --- turba/config/backends.php.dist | 14 ++++++++++++-- turba/lib/Driver/Sql.php | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/turba/config/backends.php.dist b/turba/config/backends.php.dist index df5b7b6b0..38d30440b 100644 --- a/turba/config/backends.php.dist +++ b/turba/config/backends.php.dist @@ -199,8 +199,18 @@ $cfgSources['localsql'] = array( 'params' => array( // The default connection details are pulled from the Horde-wide SQL // connection configuration. - // To use another DB connection, you must define a Horde_Db_Adapter - // object here. + // To use another DB connection, you must provide configuration + // information here - for example, + //'sql' => array('persistent' => true, + // 'username' => 'horde', + // 'password' => 'xxx', + // 'socket' => '/opt/local/var/run/mysql5/mysqld.sock', + // 'protocol' => 'unix', + // 'database' => 'horde', + // 'charset' => 'iso-8859-1', + // 'ssl' => false, + // 'splitread' => false, + // 'phptype' => 'mysql'), 'sql' => false, 'table' => 'turba_objects' ), diff --git a/turba/lib/Driver/Sql.php b/turba/lib/Driver/Sql.php index 5a74b125d..a54ca9aa8 100644 --- a/turba/lib/Driver/Sql.php +++ b/turba/lib/Driver/Sql.php @@ -52,7 +52,7 @@ class Turba_Driver_Sql extends Turba_Driver throw new Turba_Exception($e); } } else { - $this->_db = $this->_params['sql']; + $this->_db = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Db')->create('turba', $this->_params['sql']); } } -- 2.11.0