diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-02-07 13:42:18 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-02-07 13:45:59 +0100 |
commit | b537d90e58913be203fd96f31b624559be00abeb (patch) | |
tree | 9af6c432b3b503303f1315f82f602844664f837d /lib/private/legacy | |
parent | b35b22977cfc9412278ae70b49c402a95efca19e (diff) | |
parent | b9e724d4ae7635435b3cc7793237c3ab9fe2a1c0 (diff) | |
download | nextcloud-server-b537d90e58913be203fd96f31b624559be00abeb.tar.gz nextcloud-server-b537d90e58913be203fd96f31b624559be00abeb.zip |
use the 'new' server container for appconfig
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/appconfig.php | 38 | ||||
-rw-r--r-- | lib/private/legacy/cache/fileglobalgc.php | 4 | ||||
-rw-r--r-- | lib/private/legacy/config.php | 13 |
3 files changed, 28 insertions, 27 deletions
diff --git a/lib/private/legacy/appconfig.php b/lib/private/legacy/appconfig.php index 0ca6d4150ef..46a8068c3b4 100644 --- a/lib/private/legacy/appconfig.php +++ b/lib/private/legacy/appconfig.php @@ -25,9 +25,14 @@ * This class provides an easy way for apps to store config values in the * database. */ -OC_Appconfig::$object = new \OC\AppConfig(OC_DB::getConnection()); -class OC_Appconfig{ - public static $object; +class OC_Appconfig { + /** + * @return \OCP\IAppConfig + */ + private static function getAppConfig() { + return \OC::$server->getAppConfig(); + } + /** * @brief Get all apps using the config * @return array with app ids @@ -36,7 +41,7 @@ class OC_Appconfig{ * entry in the appconfig table. */ public static function getApps() { - return self::$object->getApps(); + return self::getAppConfig()->getApps(); } /** @@ -47,8 +52,8 @@ class OC_Appconfig{ * This function gets all keys of an app. Please note that the values are * not returned. */ - public static function getKeys( $app ) { - return self::$object->getKeys( $app ); + public static function getKeys($app) { + return self::getAppConfig()->getKeys($app); } /** @@ -61,8 +66,8 @@ class OC_Appconfig{ * This function gets a value from the appconfig table. If the key does * not exist the default value will be returned */ - public static function getValue( $app, $key, $default = null ) { - return self::$object->getValue($app, $key, $default); + public static function getValue($app, $key, $default = null) { + return self::getAppConfig()->getValue($app, $key, $default); } /** @@ -72,7 +77,7 @@ class OC_Appconfig{ * @return bool */ public static function hasKey($app, $key) { - return self::$object->hasKey($app, $key); + return self::getAppConfig()->hasKey($app, $key); } /** @@ -83,8 +88,8 @@ class OC_Appconfig{ * * Sets a value. If the key did not exist before it will be created. */ - public static function setValue( $app, $key, $value ) { - self::$object->setValue( $app, $key, $value ); + public static function setValue($app, $key, $value) { + self::getAppConfig()->setValue($app, $key, $value); } /** @@ -94,8 +99,8 @@ class OC_Appconfig{ * * Deletes a key. */ - public static function deleteKey( $app, $key ) { - self::$object->deleteKey( $app, $key ); + public static function deleteKey($app, $key) { + self::getAppConfig()->deleteKey($app, $key); } /** @@ -104,17 +109,18 @@ class OC_Appconfig{ * * Removes all keys in appconfig belonging to the app. */ - public static function deleteApp( $app ) { - self::$object->deleteApp( $app ); + public static function deleteApp($app) { + self::getAppConfig()->deleteApp($app); } /** * get multiply values, either the app or key can be used as wildcard by setting it to false + * * @param app * @param key * @return array */ public static function getValues($app, $key) { - return self::$object->getValues($app, $key); + return self::getAppConfig()->getValues($app, $key); } } diff --git a/lib/private/legacy/cache/fileglobalgc.php b/lib/private/legacy/cache/fileglobalgc.php new file mode 100644 index 00000000000..385f6406673 --- /dev/null +++ b/lib/private/legacy/cache/fileglobalgc.php @@ -0,0 +1,4 @@ +<?php + +class OC_Cache_FileGlobalGC extends OC\Cache\FileGlobalGC{ +} diff --git a/lib/private/legacy/config.php b/lib/private/legacy/config.php index 7e498013737..ab67c8d3020 100644 --- a/lib/private/legacy/config.php +++ b/lib/private/legacy/config.php @@ -38,7 +38,6 @@ * This class is responsible for reading and writing config.php, the very basic * configuration file of ownCloud. */ -OC_Config::$object = new \OC\Config(OC::$SERVERROOT.'/config/'); class OC_Config { /** @@ -83,11 +82,7 @@ class OC_Config { * */ public static function setValue($key, $value) { - try { - self::$object->setValue($key, $value); - } catch (\OC\HintException $e) { - \OC_Template::printErrorPage($e->getMessage(), $e->getHint()); - } + self::$object->setValue($key, $value); } /** @@ -98,10 +93,6 @@ class OC_Config { * */ public static function deleteKey($key) { - try { - self::$object->deleteKey($key); - } catch (\OC\HintException $e) { - \OC_Template::printErrorPage($e->getMessage(), $e->getHint()); - } + self::$object->deleteKey($key); } } |