Skip to content
Snippets Groups Projects
Commit 63ffae83 authored by Vincent Petry's avatar Vincent Petry
Browse files

Merge pull request #9861 from owncloud/console-dontloadappsonupdate

Do not load apps in console.php when an upgrade is due
parents 788a2eca 2b1cd84f
No related branches found
No related tags found
No related merge requests found
...@@ -22,18 +22,24 @@ try { ...@@ -22,18 +22,24 @@ try {
exit(0); exit(0);
} }
// only load apps if no update is due,
// else only core commands will be available
if (!\OCP\Util::needUpgrade()) {
// load all apps to get all api routes properly setup // load all apps to get all api routes properly setup
OC_App::loadApps(); OC_App::loadApps();
}
$defaults = new OC_Defaults; $defaults = new OC_Defaults;
$application = new Application($defaults->getName(), \OC_Util::getVersionString()); $application = new Application($defaults->getName(), \OC_Util::getVersionString());
require_once 'core/register_command.php'; require_once 'core/register_command.php';
if (!\OCP\Util::needUpgrade()) {
foreach(OC_App::getAllApps() as $app) { foreach(OC_App::getAllApps() as $app) {
$file = OC_App::getAppPath($app).'/appinfo/register_command.php'; $file = OC_App::getAppPath($app).'/appinfo/register_command.php';
if(file_exists($file)) { if(file_exists($file)) {
require $file; require $file;
} }
} }
}
$application->run(); $application->run();
} catch (Exception $ex) { } catch (Exception $ex) {
echo "An unhandled exception has been thrown:" . PHP_EOL; echo "An unhandled exception has been thrown:" . PHP_EOL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment