From aa0265bd34cdb14baa234832f226ef4da7d1e711 Mon Sep 17 00:00:00 2001
From: Morris Jobke <hey@morrisjobke.de>
Date: Thu, 3 Dec 2015 14:35:15 +0100
Subject: [PATCH] Replace OC_Config in setup

---
 lib/private/setup/postgresql.php | 7 ++++---
 lib/private/setup/sqlite.php     | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/private/setup/postgresql.php b/lib/private/setup/postgresql.php
index 0a559e7a589..59762209d08 100644
--- a/lib/private/setup/postgresql.php
+++ b/lib/private/setup/postgresql.php
@@ -66,7 +66,8 @@ class PostgreSQL extends AbstractDatabase {
 			$this->createDBUser($connection);
 		}
 
-		\OC_Config::setValues([
+		$systemConfig = \OC::$server->getSystemConfig();
+		$systemConfig->setValues([
 			'dbuser'		=> $this->dbUser,
 			'dbpassword'	=> $this->dbPassword,
 		]);
@@ -78,8 +79,8 @@ class PostgreSQL extends AbstractDatabase {
 		pg_close($connection);
 
 		// connect to the ownCloud database (dbname=$this->dbname) and check if it needs to be filled
-		$this->dbUser = \OC_Config::getValue('dbuser');
-		$this->dbPassword = \OC_Config::getValue('dbpassword');
+		$this->dbUser = $systemConfig->getValue('dbuser');
+		$this->dbPassword = $systemConfig->getValue('dbpassword');
 
 		$e_host = addslashes($this->dbHost);
 		$e_dbname = addslashes($this->dbName);
diff --git a/lib/private/setup/sqlite.php b/lib/private/setup/sqlite.php
index 820a89d4cff..ce6005620eb 100644
--- a/lib/private/setup/sqlite.php
+++ b/lib/private/setup/sqlite.php
@@ -31,7 +31,7 @@ class Sqlite extends AbstractDatabase {
 	}
 
 	public function setupDatabase($username) {
-		$datadir = \OC_Config::getValue('datadirectory');
+		$datadir = \OC::$server->getSystemConfig()->getValue('datadirectory');
 
 		//delete the old sqlite database first, might cause infinte loops otherwise
 		if(file_exists("$datadir/owncloud.db")) {
-- 
GitLab