diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-24 06:58:51 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-24 06:58:51 +0400 |
commit | 48681dd582fbc9f840183cad28cc3e4dd3418d05 (patch) | |
tree | 88008786b75c8a3a342f6e784413430a9c0779e2 /core/DbHelper.php | |
parent | ae5fc3786a19f67202e2e83fd83e9e67657e8173 (diff) |
Remove use of Zend_Registry to hold DB connections.
Diffstat (limited to 'core/DbHelper.php')
-rw-r--r-- | core/DbHelper.php | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/core/DbHelper.php b/core/DbHelper.php index 67f4560192..91c6065e2b 100644 --- a/core/DbHelper.php +++ b/core/DbHelper.php @@ -94,7 +94,7 @@ class DbHelper */ public static function isDatabaseConnectionUTF8() { - return \Zend_Registry::get('db')->isConnectionUTF8(); + return Db::get()->isConnectionUTF8(); } /** @@ -107,7 +107,7 @@ class DbHelper */ public static function checkDatabaseVersion() { - \Zend_Registry::get('db')->checkServerVersion(); + Db::get()->checkServerVersion(); } /** @@ -115,32 +115,7 @@ class DbHelper */ public static function disconnectDatabase() { - \Zend_Registry::get('db')->closeConnection(); - } - - /** - * Create database object and connect to database - * @param array|null $dbInfos - */ - public static function createDatabaseObject($dbInfos = null) - { - $config = Config::getInstance(); - - if (is_null($dbInfos)) { - $dbInfos = $config->database; - } - - Piwik_PostEvent('Reporting.getDatabaseConfig', array(&$dbInfos)); - - $dbInfos['profiler'] = $config->Debug['enable_sql_profiler']; - - $db = null; - Piwik_PostEvent('Reporting.createDatabase', array(&$db)); - if (is_null($db)) { - $adapter = $dbInfos['adapter']; - $db = @Adapter::factory($adapter, $dbInfos); - } - \Zend_Registry::set('db', $db); + Db::get()->closeConnection(); } /** |