[Pkg-owncloud-commits] [owncloud] 60/223: Extract common variables of $connectionParams.

David Prévot taffit at moszumanska.debian.org
Sun Jun 22 01:54:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 4b87586487888e0d9fcc5700eefccc6ed031ce96
Author: Andreas Fischer <bantu at owncloud.com>
Date:   Thu Jun 12 19:53:33 2014 +0200

    Extract common variables of $connectionParams.
---
 lib/private/db.php | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/lib/private/db.php b/lib/private/db.php
index d3bf8c0..6f0596f 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list