From f7d0c74b1003af6c47dd6ec74f4ef904a2681d62 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 11 Jan 2024 15:32:58 -0100 Subject: lazy AppConfig Signed-off-by: Maxence Lange --- lib/private/AllConfig.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/private/AllConfig.php') diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index 92178d64635..ab4359c798f 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -43,7 +43,6 @@ use OCP\PreConditionNotMetException; * Class to combine all the configuration options ownCloud offers */ class AllConfig implements IConfig { - private SystemConfig $systemConfig; private ?IDBConnection $connection = null; /** @@ -68,9 +67,10 @@ class AllConfig implements IConfig { */ private CappedMemoryCache $userCache; - public function __construct(SystemConfig $systemConfig) { + public function __construct( + private SystemConfig $systemConfig + ) { $this->userCache = new CappedMemoryCache(); - $this->systemConfig = $systemConfig; } /** @@ -190,6 +190,7 @@ class AllConfig implements IConfig { * * @param string $appName the appName that we stored the value under * @return string[] the keys stored for the app + * @deprecated 29.0.0 Use {@see IAppConfig} directly */ public function getAppKeys($appName) { return \OC::$server->get(AppConfig::class)->getKeys($appName); @@ -201,6 +202,7 @@ class AllConfig implements IConfig { * @param string $appName the appName that we want to store the value under * @param string $key the key of the value, under which will be saved * @param string|float|int $value the value that should be stored + * @deprecated 29.0.0 Use {@see IAppConfig} directly */ public function setAppValue($appName, $key, $value) { \OC::$server->get(AppConfig::class)->setValue($appName, $key, $value); @@ -213,6 +215,7 @@ class AllConfig implements IConfig { * @param string $key the key of the value, under which it was saved * @param string $default the default value to be returned if the value isn't set * @return string the saved value + * @deprecated 29.0.0 Use {@see IAppConfig} directly */ public function getAppValue($appName, $key, $default = '') { return \OC::$server->get(AppConfig::class)->getValue($appName, $key, $default); @@ -223,6 +226,7 @@ class AllConfig implements IConfig { * * @param string $appName the appName that we stored the value under * @param string $key the key of the value, under which it was saved + * @deprecated 29.0.0 Use {@see IAppConfig} directly */ public function deleteAppValue($appName, $key) { \OC::$server->get(AppConfig::class)->deleteKey($appName, $key); @@ -232,6 +236,7 @@ class AllConfig implements IConfig { * Removes all keys in appconfig belonging to the app * * @param string $appName the appName the configs are stored under + * @deprecated 29.0.0 Use {@see IAppConfig} directly */ public function deleteAppValues($appName) { \OC::$server->get(AppConfig::class)->deleteApp($appName); -- cgit v1.2.3