diff options
author | Andreas Fischer <bantu@owncloud.com> | 2014-06-12 19:53:33 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-06-12 19:53:33 +0200 |
commit | 4b87586487888e0d9fcc5700eefccc6ed031ce96 (patch) | |
tree | f8cceca13ca0b452d6f3f50147b11fce8c85ae99 /lib/private/db.php | |
parent | 6da2beeaff40be812fa1a5fcb125156c6a3a33c3 (diff) | |
download | nextcloud-server-4b87586487888e0d9fcc5700eefccc6ed031ce96.tar.gz nextcloud-server-4b87586487888e0d9fcc5700eefccc6ed031ce96.zip |
Extract common variables of $connectionParams.
Diffstat (limited to 'lib/private/db.php')
-rw-r--r-- | lib/private/db.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/private/db.php b/lib/private/db.php index d3bf8c0016c..6f0596f328e 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -74,20 +74,17 @@ class OC_DB { return false; } + $connectionParams = array( + 'user' => $user, + 'password' => $pass, + ); + if ($factory->normalizeType($type) === 'sqlite3') { $datadir = OC_Config::getValue("datadirectory", OC::$SERVERROOT.'/data'); - $connectionParams = array( - 'user' => $user, - 'password' => $pass, - 'path' => $datadir.'/'.$name.'.db', - ); + $connectionParams['path'] = $datadir.'/'.$name.'.db'; } else { - $connectionParams = array( - 'user' => $user, - 'password' => $pass, - 'host' => $host, - 'dbname' => $name, - ); + $connectionParams['host'] = $host; + $connectionParams['dbname'] = $name; if ($socket) { if (ctype_digit($socket) && $socket <= 65535) { $connectionParams['port'] = $socket; |