summaryrefslogtreecommitdiffstats
path: root/lib/private/app.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-02-03 14:13:44 +0100
committerRobin Appelman <icewind@owncloud.com>2015-02-03 14:13:44 +0100
commit70fd3a267f08a5f8bd8c50265a3469784ec9aca7 (patch)
tree31fdeb2b6e40391073a9ad5d10197f24c6c505f1 /lib/private/app.php
parenta24d73aa0cde139c4aee0404c46c54bd1f94ada9 (diff)
downloadnextcloud-server-70fd3a267f08a5f8bd8c50265a3469784ec9aca7.tar.gz
nextcloud-server-70fd3a267f08a5f8bd8c50265a3469784ec9aca7.zip
Cache app versions
Diffstat (limited to 'lib/private/app.php')
-rw-r--r--lib/private/app.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 3a1f731d621..bd58493a4ce 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();
@@ -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];
}
/**