Skip to content
Snippets Groups Projects
Commit 6e9cd63f authored by Bart Visscher's avatar Bart Visscher
Browse files

Only check for apps owncloud version requirment when there is a new owncloud version

parent 99a68abb
Branches
No related tags found
No related merge requests found
...@@ -495,26 +495,27 @@ class OC_App{ ...@@ -495,26 +495,27 @@ class OC_App{
} }
} }
} }
}
// check if the current enabled apps are compatible with the current ownCloud version. disable them if not. /**
// this is important if you upgrade ownCloud and have non ported 3rd party apps installed * check if the current enabled apps are compatible with the current
* ownCloud version. disable them if not.
* This is important if you upgrade ownCloud and have non ported 3rd
* party apps installed.
*/
public static function checkAppsRequirements($apps = array()){
if (empty($apps)) {
$apps = OC_App::getEnabledApps(); $apps = OC_App::getEnabledApps();
}
$version = OC_Util::getVersion(); $version = OC_Util::getVersion();
foreach($apps as $app) { foreach($apps as $app) {
// check if the app is compatible with this version of ownCloud // check if the app is compatible with this version of ownCloud
$info = OC_App::getAppInfo($app); $info = OC_App::getAppInfo($app);
if(!isset($info['require']) or ($version[0]>$info['require'])){ if(!isset($info['require']) or ($version[0]>$info['require'])){
OC_Log::write('core','App "'.$info['name'].'" can\'t be used because it is not compatible with this version of ownCloud',OC_Log::ERROR); OC_Log::write('core','App "'.$info['name'].'" can\'t be used because it is not compatible with this version of ownCloud',OC_Log::ERROR);
OC_App::disable( $app ); OC_App::disable( $app );
} }
} }
} }
/** /**
......
...@@ -229,6 +229,7 @@ class OC{ ...@@ -229,6 +229,7 @@ class OC{
} }
OC_Config::setValue('version',implode('.',OC_Util::getVersion())); OC_Config::setValue('version',implode('.',OC_Util::getVersion()));
OC_App::checkAppsRequirements();
} }
OC_App::updateApps(); OC_App::updateApps();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment