summaryrefslogtreecommitdiffstats
path: root/lib/private/server.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/server.php')
-rw-r--r--lib/private/server.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index a08014fa6fa..5a1e955bdd2 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -166,8 +166,13 @@ class Server extends SimpleContainer implements IServerContainer {
$this->registerService('NavigationManager', function ($c) {
return new \OC\NavigationManager();
});
- $this->registerService('AllConfig', function ($c) {
- return new \OC\AllConfig();
+ $this->registerService('AllConfig', function (Server $c) {
+ return new \OC\AllConfig(
+ $c->getSystemConfig()
+ );
+ });
+ $this->registerService('SystemConfig', function ($c) {
+ return new \OC\SystemConfig();
});
$this->registerService('AppConfig', function ($c) {
return new \OC\AppConfig(\OC_DB::getConnection());
@@ -229,11 +234,12 @@ class Server extends SimpleContainer implements IServerContainer {
});
$this->registerService('DatabaseConnection', function (Server $c) {
$factory = new \OC\DB\ConnectionFactory();
- $type = $c->getConfig()->getSystemValue('dbtype', 'sqlite');
+ $systemConfig = $c->getSystemConfig();
+ $type = $systemConfig->getValue('dbtype', 'sqlite');
if (!$factory->isValidType($type)) {
throw new \OC\DatabaseException('Invalid database type');
}
- $connectionParams = $factory->createConnectionParams($c->getConfig());
+ $connectionParams = $factory->createConnectionParams($systemConfig);
$connection = $factory->getConnection($type, $connectionParams);
$connection->getConfiguration()->setSQLLogger($c->getQueryLogger());
return $connection;
@@ -441,6 +447,15 @@ class Server extends SimpleContainer implements IServerContainer {
}
/**
+ * For internal use only
+ *
+ * @return \OC\SystemConfig
+ */
+ function getSystemConfig() {
+ return $this->query('SystemConfig');
+ }
+
+ /**
* Returns the app config manager
*
* @return \OCP\IAppConfig