diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-05-11 20:32:37 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-05-11 20:33:56 +0200 |
commit | 736739bbbda2e9930b7bdcf79f43a28fad4d1d5d (patch) | |
tree | b77bc51d0759baeec9e5b3cc2857548a12715d13 /lib | |
parent | d2bd78c41a58320e0f1f6ff6d602371325390747 (diff) | |
download | nextcloud-server-736739bbbda2e9930b7bdcf79f43a28fad4d1d5d.tar.gz nextcloud-server-736739bbbda2e9930b7bdcf79f43a28fad4d1d5d.zip |
load remote and public paths from info.xml during upgrade instead of setting them every time
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.php | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/lib/app.php b/lib/app.php index f274194b25c..bc4f9c87e96 100644 --- a/lib/app.php +++ b/lib/app.php @@ -110,9 +110,9 @@ class OC_App{ if(!isset(self::$appTypes[$app])){ $appData=self::getAppInfo($app); if(isset($appData['types'])){ - self::$appTypes[$app]=$appData['types']; + self::$appTypes[$app]=implode(',',$appData['types']); }else{ - self::$appTypes[$app]=array(); + self::$appTypes[$app]=''; } OC_Appconfig::setValue($app,'types',implode(',',self::$appTypes[$app])); @@ -367,8 +367,18 @@ class OC_App{ } $xml = new SimpleXMLElement($content); $data['info']=array(); + $data['remote']=array(); + $data['public']=array(); foreach($xml->children() as $child){ - if($child->getName()=='types'){ + if($child->getName()=='remote'){ + foreach($child->children() as $remote){ + $data['remote'][$remote->getName()]=(string)$remote; + } + }elseif($child->getName()=='public'){ + foreach($child->children() as $public){ + $data['public'][$public->getName()]=(string)$public; + } + }elseif($child->getName()=='types'){ $data['types']=array(); foreach($child->children() as $type){ $data['types'][]=$type->getName(); @@ -476,12 +486,16 @@ class OC_App{ public static function updateApps(){ // The rest comes here $versions = self::getAppVersions(); + //ensure files app is installed for upgrades + if(!isset($versions['files'])){ + $versions['files']='0'; + } foreach( $versions as $app=>$installedVersion ){ $currentVersion=OC_App::getAppVersion($app); if ($currentVersion) { if (version_compare($currentVersion, $installedVersion, '>')) { OC_App::updateApp($app); - OC_Appconfig::setValue($app,'installed_version',OC_App::getAppVersion($app)); + OC_Appconfig::setValue($app,'installed_version',OC_App::getAppVersion($app)); } } } @@ -511,6 +525,15 @@ class OC_App{ if(file_exists(OC::$APPSROOT.'/apps/'.$appid.'/appinfo/update.php')){ include OC::$APPSROOT.'/apps/'.$appid.'/appinfo/update.php'; } + + //set remote/public handelers + $appData=self::getAppInfo($appid); + foreach($appData['remote'] as $name=>$path){ + OCP\CONFIG::setAppValue('core', 'remote_'.$name, '/apps/'.$appid.'/'.$path); + } + foreach($appData['public'] as $name=>$path){ + OCP\CONFIG::setAppValue('core', 'public_'.$name, '/apps/'.$appid.'/'.$path); + } } /** |