|
|
|
@ -26,6 +26,7 @@ |
|
|
|
*/ |
|
|
|
namespace OC\Console; |
|
|
|
|
|
|
|
use OC\NeedsUpdateException; |
|
|
|
use OC_App; |
|
|
|
use OCP\AppFramework\QueryException; |
|
|
|
use OCP\Console\ConsoleEvent; |
|
|
|
@ -84,13 +85,11 @@ class Application { |
|
|
|
if ($input->getOption('no-warnings')) { |
|
|
|
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET); |
|
|
|
} |
|
|
|
try { |
|
|
|
require_once __DIR__ . '/../../../core/register_command.php'; |
|
|
|
if ($this->config->getSystemValue('installed', false)) { |
|
|
|
if (\OCP\Util::needUpgrade()) { |
|
|
|
if ($input->getArgument('command') !== '_completion') { |
|
|
|
$output->writeln("Nextcloud 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"); |
|
|
|
} |
|
|
|
throw new NeedsUpdateException(); |
|
|
|
} elseif ($this->config->getSystemValue('maintenance', false)) { |
|
|
|
if ($input->getArgument('command') !== '_completion') { |
|
|
|
$output->writeln("Nextcloud is in maintenance mode - no apps have been loaded"); |
|
|
|
@ -99,7 +98,7 @@ class Application { |
|
|
|
OC_App::loadApps(); |
|
|
|
foreach (\OC::$server->getAppManager()->getInstalledApps() as $app) { |
|
|
|
$appPath = \OC_App::getAppPath($app); |
|
|
|
if($appPath === false) { |
|
|
|
if ($appPath === false) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
// load commands using info.xml
|
|
|
|
@ -118,6 +117,12 @@ class Application { |
|
|
|
} else if ($input->getArgument('command') !== '_completion') { |
|
|
|
$output->writeln("Nextcloud is not installed - only a limited number of commands are available"); |
|
|
|
} |
|
|
|
} catch(NeedsUpdateException $e) { |
|
|
|
if ($input->getArgument('command') !== '_completion') { |
|
|
|
$output->writeln("Nextcloud 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"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($input->getFirstArgument() !== 'check') { |
|
|
|
$errors = \OC_Util::checkServer(\OC::$server->getConfig()); |
|
|
|
|