summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/app.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r--lib/private/legacy/app.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 0d9adfa9d2b..adf29601ac6 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -653,13 +653,16 @@ class OC_App {
* get the last version of the app from appinfo/info.xml
*
* @param string $appId
+ * @param bool $useCache
* @return string
*/
- public static function getAppVersion($appId) {
- if (!isset(self::$appVersion[$appId])) {
- $file = self::getAppPath($appId);
- self::$appVersion[$appId] = ($file !== false) ? self::getAppVersionByPath($file) : '0';
+ public static function getAppVersion($appId, $useCache = true) {
+ if($useCache && isset(self::$appVersion[$appId])) {
+ return self::$appVersion[$appId];
}
+
+ $file = self::getAppPath($appId);
+ self::$appVersion[$appId] = ($file !== false) ? self::getAppVersionByPath($file) : '0';
return self::$appVersion[$appId];
}