diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-02-25 08:19:49 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-07-21 23:17:36 +0200 |
commit | 66a215651badf8472e9922b7591cba3cfe9ce333 (patch) | |
tree | b097c9ec7f586e6632f429b59e8c1dd6e9f2a583 /lib/db.php | |
parent | 62ce3a5613a273c9208f272728ae5002d43d5096 (diff) | |
download | nextcloud-server-66a215651badf8472e9922b7591cba3cfe9ce333.tar.gz nextcloud-server-66a215651badf8472e9922b7591cba3cfe9ce333.zip |
Create DB Connection wrapper and DB\Adapter* classes
Diffstat (limited to 'lib/db.php')
-rw-r--r-- | lib/db.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/db.php b/lib/db.php index 44d77bce80e..95145fb7c50 100644 --- a/lib/db.php +++ b/lib/db.php @@ -129,6 +129,7 @@ class OC_DB { 'path' => $datadir.'/'.$name.'.db', 'driver' => 'pdo_sqlite', ); + $connectionParams['adapter'] = '\OC\DB\AdapterSqlite'; break; case 'mysql': $connectionParams = array( @@ -140,6 +141,7 @@ class OC_DB { 'charset' => 'UTF8', 'driver' => 'pdo_mysql', ); + $connectionParams['adapter'] = '\OC\DB\Adapter'; break; case 'pgsql': $connectionParams = array( @@ -150,6 +152,7 @@ class OC_DB { 'dbname' => $name, 'driver' => 'pdo_pgsql', ); + $connectionParams['adapter'] = '\OC\DB\AdapterPgSql'; break; case 'oci': $connectionParams = array( @@ -163,6 +166,7 @@ class OC_DB { if (!empty($port)) { $connectionParams['port'] = $port; } + $connectionParams['adapter'] = '\OC\DB\AdapterOCI8'; break; case 'mssql': $connectionParams = array( @@ -174,10 +178,12 @@ class OC_DB { 'charset' => 'UTF8', 'driver' => 'pdo_sqlsrv', ); + $connectionParams['adapter'] = '\OC\DB\AdapterSQLSrv'; break; default: return false; } + $connectionParams['wrapperClass'] = 'OC\DB\Connection'; try { self::$DOCTRINE = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); } catch(\Doctrine\DBAL\DBALException $e) { |