summaryrefslogtreecommitdiffstats
path: root/lib/private/app.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-02-09 18:03:19 +0100
committerVincent Petry <pvince81@owncloud.com>2015-02-09 18:03:19 +0100
commit605e2357a182e3977272e89291fb2d70835317ce (patch)
treee09d387d7456a25eb15da185df7ff00793c16d84 /lib/private/app.php
parentc7fcd42edbc9581df6dd1d2c535084dd37d9e393 (diff)
parent6f118d7f8db9a2ade4fc29f2900147bf1e914f59 (diff)
downloadnextcloud-server-605e2357a182e3977272e89291fb2d70835317ce.tar.gz
nextcloud-server-605e2357a182e3977272e89291fb2d70835317ce.zip
Merge pull request #13852 from owncloud/cache-app-versions
Cache app versions
Diffstat (limited to 'lib/private/app.php')
-rw-r--r--lib/private/app.php9
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;
}