]> source.dussan.org Git - nextcloud-server.git/commitdiff
dont re-read the config values for an app when a non existing key is fetched
authorRobin Appelman <icewind@owncloud.com>
Wed, 18 Dec 2013 14:28:32 +0000 (15:28 +0100)
committerRobin Appelman <icewind@owncloud.com>
Wed, 18 Dec 2013 14:28:32 +0000 (15:28 +0100)
lib/private/appconfig.php

index 58c037a91e756e8ba35b23d05d17ace673ba69dc..dfe03698059b79f23d8f11feb335bf8b650fc88a 100644 (file)
@@ -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];
        }