diff options
-rw-r--r-- | lib/private/app.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/app.php b/lib/private/app.php index 60b644e58e2..2207799aab7 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -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(); @@ -603,8 +604,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]; } /** @@ -1158,6 +1162,7 @@ class OC_App { if (file_exists(self::getAppPath($appId) . '/appinfo/database.xml')) { OC_DB::updateDbFromStructure(self::getAppPath($appId) . '/appinfo/database.xml'); } + unset(self::$appVersion[$appId]); if (!self::isEnabled($appId)) { return false; } |