diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-11-27 16:40:12 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-12-08 22:29:42 +0100 |
commit | 50c2a819a0c5ae50571d36a3e2dec4e8267fd13b (patch) | |
tree | c6241e94b567618b9f6e7952f45a3aaa11250d49 /lib/public/config.php | |
parent | f219f5a7a62fe88b364b9a5f50e9730eba1ee84c (diff) | |
download | nextcloud-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/public/config.php')
-rw-r--r-- | lib/public/config.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/public/config.php b/lib/public/config.php index 65dde39cdce..57c430251b5 100644 --- a/lib/public/config.php +++ b/lib/public/config.php @@ -37,6 +37,7 @@ namespace OCP; /** * This class provides functions to read and write configuration data. * configuration can be on a system, application or user level + * @deprecated use methods of \OCP\IConfig */ class Config { /** @@ -44,12 +45,13 @@ class Config { * @param string $key key * @param mixed $default = null default value * @return mixed the value or $default + * @deprecated use method getSystemValue of \OCP\IConfig * * This function gets the value from config.php. If it does not exist, * $default will be returned. */ public static function getSystemValue( $key, $default = null ) { - return \OC_Config::getValue( $key, $default ); + return \OC::$server->getConfig()->getSystemValue( $key, $default ); } /** @@ -57,13 +59,14 @@ class Config { * @param string $key key * @param mixed $value value * @return bool + * @deprecated use method setSystemValue of \OCP\IConfig * * This function sets the value and writes the config.php. If the file can * not be written, false will be returned. */ public static function setSystemValue( $key, $value ) { try { - \OC_Config::setValue( $key, $value ); + \OC::$server->getConfig()->setSystemValue( $key, $value ); } catch (\Exception $e) { return false; } @@ -73,11 +76,12 @@ class Config { /** * Deletes a value from config.php * @param string $key key + * @deprecated use method deleteSystemValue of \OCP\IConfig * * This function deletes the value from config.php. */ public static function deleteSystemValue( $key ) { - return \OC_Config::deleteKey( $key ); + \OC::$server->getConfig()->deleteSystemValue( $key ); } /** |