Skip to content

Commit

Permalink
Don't load commands of apps when in maintenance mode - fixes #20939
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 committed Dec 9, 2015
1 parent 04f4565 commit d5238b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/private/console/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ public function loadCommands(OutputInterface $output) {
$application = $this->application;
require_once __DIR__ . '/../../../core/register_command.php';
if ($this->config->getSystemValue('installed', false)) {
if (!\OCP\Util::needUpgrade()) {
if (\OCP\Util::needUpgrade()) {
$output->writeln("ownCloud or one of the apps require upgrade - only a limited number of commands are available");
$output->writeln("You may use your browser or the occ upgrade command to do the upgrade");
} elseif ($this->config->getSystemValue('maintenance', false)) {
$output->writeln("ownCloud is in maintenance mode - no app have been loaded");
} else {
OC_App::loadApps();
foreach (\OC::$server->getAppManager()->getInstalledApps() as $app) {
$appPath = \OC_App::getAppPath($app);
Expand All @@ -68,9 +73,6 @@ public function loadCommands(OutputInterface $output) {
require $file;
}
}
} else {
$output->writeln("ownCloud or one of the apps require upgrade - only a limited number of commands are available");
$output->writeln("You may use your browser or the occ upgrade command to do the upgrade");
}
} else {
$output->writeln("ownCloud is not installed - only a limited number of commands are available");
Expand Down

0 comments on commit d5238b3

Please sign in to comment.