Fix updateApp() and add extra check to updateApps()

This commit is contained in:
Michael Gapczynski 2012-01-01 16:58:51 -05:00 committed by Robin Appelman
parent fea68e08b4
commit 010bfa11e3
1 changed files with 9 additions and 7 deletions

View File

@ -381,9 +381,11 @@ class OC_App{
foreach( $apps as $app ){ foreach( $apps as $app ){
$installedVersion=OC_Appconfig::getValue($app,'installed_version'); $installedVersion=OC_Appconfig::getValue($app,'installed_version');
$appInfo=OC_App::getAppInfo($app); $appInfo=OC_App::getAppInfo($app);
$currentVersion=$appInfo['version']; if (isset($appInfo['version'])) {
if (version_compare($currentVersion, $installedVersion, '>')) { $currentVersion=$appInfo['version'];
OC_App::updateApp($app); if (version_compare($currentVersion, $installedVersion, '>')) {
OC_App::updateApp($app);
}
} }
} }
} }
@ -393,11 +395,11 @@ class OC_App{
* @param string appid * @param string appid
*/ */
public static function updateApp($appid){ public static function updateApp($appid){
if(file_exists(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/database.xml')){ if(file_exists(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/database.xml')){
OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/database.xml'); OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/database.xml');
} }
if(file_exists(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/update.php')){ if(file_exists(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/update.php')){
include OC::$SERVERROOT.'/apps/'.$file.'/appinfo/update.php'; include OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/update.php';
} }
} }
} }