Skip to content
Snippets Groups Projects
Commit fea68e08 authored by Robin Appelman's avatar Robin Appelman
Browse files

update apps when their version number increases

parent 001d06f2
No related branches found
No related tags found
No related merge requests found
...@@ -371,4 +371,33 @@ class OC_App{ ...@@ -371,4 +371,33 @@ class OC_App{
} }
return $apps; return $apps;
} }
/**
* check if any apps need updating and update those
*/
public static function updateApps(){
// The rest comes here
$apps = OC_Appconfig::getApps();
foreach( $apps as $app ){
$installedVersion=OC_Appconfig::getValue($app,'installed_version');
$appInfo=OC_App::getAppInfo($app);
$currentVersion=$appInfo['version'];
if (version_compare($currentVersion, $installedVersion, '>')) {
OC_App::updateApp($app);
}
}
}
/**
* update the database for the app and call the update script
* @param string appid
*/
public static function updateApp($appid){
if(file_exists(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/database.xml')){
OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/database.xml');
}
if(file_exists(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/update.php')){
include OC::$SERVERROOT.'/apps/'.$file.'/appinfo/update.php';
}
}
} }
...@@ -159,6 +159,8 @@ class OC{ ...@@ -159,6 +159,8 @@ class OC{
OC_Config::setValue('version',implode('.',OC_Util::getVersion())); OC_Config::setValue('version',implode('.',OC_Util::getVersion()));
} }
OC_App::updateApps();
ini_set('session.cookie_httponly','1;'); ini_set('session.cookie_httponly','1;');
session_start(); session_start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment