protected function execute(InputInterface $input, OutputInterface $output) { $app = $input->getArgument('app'); $noSensitiveValues = !$input->getOption('private'); switch ($app) { case 'system': $configs = ['system' => $this->getSystemConfigs($noSensitiveValues)]; break; case 'all': $apps = $this->appConfig->getApps(); $configs = ['system' => $this->getSystemConfigs($noSensitiveValues), 'apps' => []]; foreach ($apps as $appName) { $configs['apps'][$appName] = $this->appConfig->getValues($appName, false); } break; default: $configs = ['apps' => [$app => $this->appConfig->getValues($app, false)]]; } $this->writeArrayInOutputFormat($input, $output, $configs); }
protected function execute(InputInterface $input, OutputInterface $output) { $app = $input->getArgument('app'); $noSensitiveValues = !$input->getOption('private'); if ($noSensitiveValues && !$input->hasParameterOption('--output')) { // If you post this publicly we prefer the json format $input->setOption('output', 'json_pretty'); } switch ($app) { case 'system': $configs = [ 'system' => $this->getSystemConfigs($noSensitiveValues), ]; break; case 'all': $apps = $this->appConfig->getApps(); $configs = [ 'system' => $this->getSystemConfigs($noSensitiveValues), 'apps' => [], ]; foreach ($apps as $appName) { $configs['apps'][$appName] = $this->appConfig->getValues($appName, false); } break; default: $configs = [ 'apps' => [ $app => $this->appConfig->getValues($app, false), ], ]; } $this->writeArrayInOutputFormat($input, $output, $configs); }