]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache app versions
authorRobin Appelman <icewind@owncloud.com>
Tue, 3 Feb 2015 13:13:44 +0000 (14:13 +0100)
committerRobin Appelman <icewind@owncloud.com>
Tue, 3 Feb 2015 13:13:44 +0000 (14:13 +0100)
lib/private/app.php

index 3a1f731d6210f828782a1cd115908a62b8d2596e..bd58493a4ceabbcdea0d1b815e9a4c84d8e40b41 100644 (file)
@@ -34,6 +34,7 @@ use OC\App\Platform;
  * upgrading and removing apps.
  */
 class OC_App {
+       static private $appVersion = [];
        static private $settingsForms = array();
        static private $adminForms = array();
        static private $personalForms = array();
@@ -600,8 +601,11 @@ class OC_App {
         * @return string
         */
        public static function getAppVersion($appId) {
-               $file = self::getAppPath($appId);
-               return ($file !== false) ? self::getAppVersionByPath($file) : '0';
+               if (!isset(self::$appVersion[$appId])) {
+                       $file = self::getAppPath($appId);
+                       self::$appVersion[$appId] = ($file !== false) ? self::getAppVersionByPath($file) : '0';
+               }
+               return self::$appVersion[$appId];
        }
 
        /**