Beispiel #1
0
 /**
  * @return string[] $appId => $enabled
  */
 private function getInstalledAppsValues()
 {
     if (!$this->installedAppsCache) {
         $values = $this->appConfig->getValues(false, 'enabled');
         $this->installedAppsCache = array_filter($values, function ($value) {
             return $value !== 'no';
         });
         ksort($this->installedAppsCache);
     }
     return $this->installedAppsCache;
 }
Beispiel #2
0
 /**
  * @return string[] $appId => $enabled
  */
 private function getInstalledAppsValues()
 {
     if (!$this->installedAppsCache) {
         $values = $this->appConfig->getValues(false, 'enabled');
         $alwaysEnabledApps = $this->getAlwaysEnabledApps();
         foreach ($alwaysEnabledApps as $appId) {
             $values[$appId] = 'yes';
         }
         $this->installedAppsCache = array_filter($values, function ($value) {
             return $value !== 'no';
         });
         ksort($this->installedAppsCache);
     }
     return $this->installedAppsCache;
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
	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);
	}