diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-04-08 00:19:23 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-04-08 00:19:23 +0200 |
commit | f099c9883e4f1073564cb2ffaa00472f3ed6d8ae (patch) | |
tree | 04d418920c044f7639b11dfa96920d149a2978f5 /console.php | |
parent | 6c327f8331617652ef0b268d51edc6a23624e33c (diff) | |
download | nextcloud-server-f099c9883e4f1073564cb2ffaa00472f3ed6d8ae.tar.gz nextcloud-server-f099c9883e4f1073564cb2ffaa00472f3ed6d8ae.zip |
Adding check command to validate server environment - fixes #15429
Diffstat (limited to 'console.php')
-rw-r--r-- | console.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/console.php b/console.php index a4d829f683a..7536908a5c1 100644 --- a/console.php +++ b/console.php @@ -24,6 +24,7 @@ */ use Symfony\Component\Console\Application; +use Symfony\Component\Console\Input\ArgvInput; define('OC_CONSOLE', 1); @@ -71,6 +72,18 @@ try { } else { echo "ownCloud is not installed - only a limited number of commands are available" . PHP_EOL; } + $input = new ArgvInput(); + if ($input->getFirstArgument() !== 'check') { + $errors = \OC_Util::checkServer(\OC::$server->getConfig()); + if (!empty($errors)) { + foreach ($errors as $error) { + echo $error['error'] . "\n"; + echo $error['hint'] . "\n\n"; + } + exit(1); + } + } + $application->run(); } catch (Exception $ex) { echo "An unhandled exception has been thrown:" . PHP_EOL; |