diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-12-18 15:28:32 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-12-18 15:28:32 +0100 |
commit | 2e195dbdae2f270d40191ff6f01d10cc81c1dc06 (patch) | |
tree | 9fb9079d7f4bd2061c3a05cb50c00268d4fc0ddd /lib/private/appconfig.php | |
parent | 47245e741708479029311e2889592483c48dd29c (diff) | |
download | nextcloud-server-2e195dbdae2f270d40191ff6f01d10cc81c1dc06.tar.gz nextcloud-server-2e195dbdae2f270d40191ff6f01d10cc81c1dc06.zip |
dont re-read the config values for an app when a non existing key is fetched
Diffstat (limited to 'lib/private/appconfig.php')
-rw-r--r-- | lib/private/appconfig.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/appconfig.php b/lib/private/appconfig.php index 58c037a91e7..dfe03698059 100644 --- a/lib/private/appconfig.php +++ b/lib/private/appconfig.php @@ -41,6 +41,8 @@ class OC_Appconfig { private static $cache = array(); + private static $appsLoaded = array(); + /** * @brief Get all apps using the config * @return array with app ids @@ -86,11 +88,14 @@ class OC_Appconfig { if (!isset(self::$cache[$app])) { self::$cache[$app] = array(); } - $query = OC_DB::prepare('SELECT `configvalue`, `configkey` FROM `*PREFIX*appconfig`' - . ' WHERE `appid` = ?'); - $result = $query->execute(array($app)); - while ($row = $result->fetchRow()) { - self::$cache[$app][$row['configkey']] = $row['configvalue']; + if (array_search($app, self::$appsLoaded) === false) { + $query = OC_DB::prepare('SELECT `configvalue`, `configkey` FROM `*PREFIX*appconfig`' + . ' WHERE `appid` = ?'); + $result = $query->execute(array($app)); + while ($row = $result->fetchRow()) { + self::$cache[$app][$row['configkey']] = $row['configvalue']; + } + self::$appsLoaded[] = $app; } return self::$cache[$app]; } |