From 7f07d737f85fcf511219f44d5369b352b9f0e067 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 10 Sep 2013 19:14:30 +0200 Subject: Create instance of Doctrine\Common\EventManager() in OC_DB. --- lib/db.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/db.php b/lib/db.php index f090f474243..bd67937cdd8 100644 --- a/lib/db.php +++ b/lib/db.php @@ -75,6 +75,7 @@ class OC_DB { // do nothing if the connection already has been established if (!self::$connection) { $config = new \Doctrine\DBAL\Configuration(); + $eventManager = new \Doctrine\Common\EventManager(); switch($type) { case 'sqlite': case 'sqlite3': @@ -142,7 +143,7 @@ class OC_DB { $connectionParams['wrapperClass'] = 'OC\DB\Connection'; $connectionParams['tablePrefix'] = OC_Config::getValue('dbtableprefix', 'oc_' ); try { - self::$connection = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); + self::$connection = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config, $eventManager); if ($type === 'sqlite' || $type === 'sqlite3') { // Sqlite doesn't handle query caching and schema changes // TODO: find a better way to handle this -- cgit v1.2.3 From 786017c2472067997239f7b225ed22fd24cab264 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 10 Sep 2013 19:15:06 +0200 Subject: Register EventSubscriber that resets Oracle's NLS_DATE_FORMAT etc. --- lib/db.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/db.php b/lib/db.php index bd67937cdd8..b9505b88d82 100644 --- a/lib/db.php +++ b/lib/db.php @@ -124,6 +124,7 @@ class OC_DB { $connectionParams['port'] = $port; } $connectionParams['adapter'] = '\OC\DB\AdapterOCI8'; + $eventManager->addEventSubscriber(new \Doctrine\DBAL\Event\Listeners\OracleSessionInit); break; case 'mssql': $connectionParams = array( -- cgit v1.2.3