diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-09 11:45:07 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-09 11:46:52 +0200 |
commit | dd5063bd491f26c514e3206a167c2888d6bc3310 (patch) | |
tree | f591b732f15a019465cf45cf66d896ebfa46e116 /core/command/check.php | |
parent | 56f1ffe820383ac82c208552213848c6a8deec6d (diff) | |
download | nextcloud-server-dd5063bd491f26c514e3206a167c2888d6bc3310.tar.gz nextcloud-server-dd5063bd491f26c514e3206a167c2888d6bc3310.zip |
Add an option to get the output in plain, json or print_r syntax
Diffstat (limited to 'core/command/check.php')
-rw-r--r-- | core/command/check.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/command/check.php b/core/command/check.php index 9d0db3a726c..ddfe9b73bba 100644 --- a/core/command/check.php +++ b/core/command/check.php @@ -3,11 +3,10 @@ namespace OC\Core\Command; use OCP\IConfig; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class Check extends Command { +class Check extends Base { /** * @var IConfig */ @@ -19,6 +18,8 @@ class Check extends Command { } protected function configure() { + parent::configure(); + $this ->setName('check') ->setDescription('check dependencies of the server environment') @@ -28,10 +29,11 @@ class Check extends Command { 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 = array_map(function($item) { + return (string) $item['error']; }, $errors); - echo json_encode($errors); + + $this->writeArrayInOutputFormat($input, $output, $errors); return 1; } return 0; |