From f099c9883e4f1073564cb2ffaa00472f3ed6d8ae Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Wed, 8 Apr 2015 00:19:23 +0200 Subject: Adding check command to validate server environment - fixes #15429 --- core/command/check.php | 39 +++++++++++++++++++++++++++++++++++++++ core/register_command.php | 1 + 2 files changed, 40 insertions(+) create mode 100644 core/command/check.php (limited to 'core') diff --git a/core/command/check.php b/core/command/check.php new file mode 100644 index 00000000000..9d0db3a726c --- /dev/null +++ b/core/command/check.php @@ -0,0 +1,39 @@ +config = $config; + } + + protected function configure() { + $this + ->setName('check') + ->setDescription('check dependencies of the server environment') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $errors = \OC_Util::checkServer($this->config); + if (!empty($errors)) { + $errors = array_map( function($items) { + return (string)$items['error']; + }, $errors); + echo json_encode($errors); + return 1; + } + return 0; + } +} diff --git a/core/register_command.php b/core/register_command.php index 67fdb6f808e..701fb10d1ba 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -26,6 +26,7 @@ /** @var $application Symfony\Component\Console\Application */ $application->add(new OC\Core\Command\Status); +$application->add(new OC\Core\Command\Check(\OC::$server->getConfig())); $application->add(new OC\Core\Command\App\CheckCode()); $application->add(new OC\Core\Command\L10n\CreateJs()); -- cgit v1.2.3