summaryrefslogtreecommitdiffstats
path: root/lib/private/db.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-06-12 19:59:40 +0200
committerAndreas Fischer <bantu@owncloud.com>2014-06-12 19:59:40 +0200
commit4ca1e3cc0295203f2d1bdca083b73ed56b8fa978 (patch)
tree49d1fe07d3b8d02970d8ff2e79a673c03bc22306 /lib/private/db.php
parent17c2e63449ed4c3afa31e6a424eb4e208596b906 (diff)
downloadnextcloud-server-4ca1e3cc0295203f2d1bdca083b73ed56b8fa978.tar.gz
nextcloud-server-4ca1e3cc0295203f2d1bdca083b73ed56b8fa978.zip
Move getValue() to where required. This actually is not required "global data".
Diffstat (limited to 'lib/private/db.php')
-rw-r--r--lib/private/db.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/private/db.php b/lib/private/db.php
index df558dfce15..a35a4f53e80 100644
--- a/lib/private/db.php
+++ b/lib/private/db.php
@@ -57,27 +57,23 @@ class OC_DB {
return true;
}
- // The global data we need
- $name = OC_Config::getValue( "dbname", "owncloud" );
- $host = OC_Config::getValue( "dbhost", "" );
- $user = OC_Config::getValue( "dbuser", "" );
- $pass = OC_Config::getValue( "dbpassword", "" );
- $type = OC_Config::getValue( "dbtype", "sqlite" );
-
+ $type = OC_Config::getValue('dbtype', 'sqlite');
$factory = new \OC\DB\ConnectionFactory();
if (!$factory->isValidType($type)) {
return false;
}
$connectionParams = array(
- 'user' => $user,
- 'password' => $pass,
+ 'user' => OC_Config::getValue('dbuser', ''),
+ 'password' => OC_Config::getValue('dbpassword', ''),
);
+ $name = OC_Config::getValue('dbname', 'owncloud');
if ($factory->normalizeType($type) === 'sqlite3') {
$datadir = OC_Config::getValue("datadirectory", OC::$SERVERROOT.'/data');
$connectionParams['path'] = $datadir.'/'.$name.'.db';
} else {
+ $host = OC_Config::getValue('dbhost', '');
if (strpos($host, ':')) {
// Host variable may carry a port or socket.
list($host, $socket) = explode(':', $host, 2);