aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/allconfig.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-11-27 16:40:12 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-08 22:29:42 +0100
commit50c2a819a0c5ae50571d36a3e2dec4e8267fd13b (patch)
treec6241e94b567618b9f6e7952f45a3aaa11250d49 /lib/private/allconfig.php
parentf219f5a7a62fe88b364b9a5f50e9730eba1ee84c (diff)
downloadnextcloud-server-50c2a819a0c5ae50571d36a3e2dec4e8267fd13b.tar.gz
nextcloud-server-50c2a819a0c5ae50571d36a3e2dec4e8267fd13b.zip
Extract interaction with config.php into SystemConfig
* introduce SystemConfig to avoid DI circle (used by database connection which is itself needed by AllConfig that itself contains the methods to access the config.php which then would need the database connection - did you get it? ;)) * use DI container and use that method in legacy code paths (for easier refactoring later) * create and use getSystemConfig instead of query() in DI container
Diffstat (limited to 'lib/private/allconfig.php')
-rw-r--r--lib/private/allconfig.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/private/allconfig.php b/lib/private/allconfig.php
index 7ebff7cf2db..295fb8b7668 100644
--- a/lib/private/allconfig.php
+++ b/lib/private/allconfig.php
@@ -13,6 +13,16 @@ namespace OC;
* Class to combine all the configuration options ownCloud offers
*/
class AllConfig implements \OCP\IConfig {
+ /** @var SystemConfig */
+ private $systemConfig;
+
+ /**
+ * @param SystemConfig $systemConfig
+ */
+ function __construct(SystemConfig $systemConfig) {
+ $this->systemConfig = $systemConfig;
+ }
+
/**
* Sets a new system wide value
*
@@ -20,7 +30,7 @@ class AllConfig implements \OCP\IConfig {
* @param mixed $value the value that should be stored
*/
public function setSystemValue($key, $value) {
- \OCP\Config::setSystemValue($key, $value);
+ $this->systemConfig->setValue($key, $value);
}
/**
@@ -31,7 +41,7 @@ class AllConfig implements \OCP\IConfig {
* @return mixed the value or $default
*/
public function getSystemValue($key, $default = '') {
- return \OCP\Config::getSystemValue($key, $default);
+ return $this->systemConfig->getValue($key, $default);
}
/**
@@ -40,7 +50,7 @@ class AllConfig implements \OCP\IConfig {
* @param string $key the key of the value, under which it was saved
*/
public function deleteSystemValue($key) {
- \OCP\Config::deleteSystemValue($key);
+ $this->systemConfig->deleteValue($key);
}
/**