summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-04-14 16:27:58 +0200
committerRobin Appelman <icewind@owncloud.com>2012-04-14 16:29:11 +0200
commit926b2b78fe444f5facfb21a625a6cd01123d2fb2 (patch)
treeb5899be280cba1595e6a01f8bdb54b42f98c6cb3 /lib
parentbfdbdd9b20fd8196487315eeaa040a77ef90c531 (diff)
downloadnextcloud-server-926b2b78fe444f5facfb21a625a6cd01123d2fb2.tar.gz
nextcloud-server-926b2b78fe444f5facfb21a625a6cd01123d2fb2.zip
keep version numbers in their own files for faster reading
Diffstat (limited to 'lib')
-rwxr-xr-xlib/app.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/app.php b/lib/app.php
index 807d8955d8f..b499e1a8ef2 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -307,6 +307,20 @@ class OC_App{
return $list;
}
+
+ /**
+ * get the last version of the app, either from appinfo/version or from appinfo/info.xml
+ */
+ public static function getAppVersion($appid){
+ $file=OC::$APPSROOT.'/apps/'.$appid.'/appinfo/version';
+ $version=@file_get_contents($file);
+ if($version){
+ return $version;
+ }else{
+ $appData=self::getAppInfo($appid);
+ return $appData['version'];
+ }
+ }
/**
* @brief Read app metadata from the info.xml file
@@ -441,9 +455,8 @@ class OC_App{
// The rest comes here
$versions = self::getAppVersions();
foreach( $versions as $app=>$installedVersion ){
- $appInfo=OC_App::getAppInfo($app);
- if (isset($appInfo['version'])) {
- $currentVersion=$appInfo['version'];
+ $currentVersion=OC_App::getAppVersion($app);
+ if ($currentVersion) {
if (version_compare($currentVersion, $installedVersion, '>')) {
OC_App::updateApp($app);
OC_Appconfig::setValue($app,'installed_version',$appInfo['version']);