sort($enabledApps);
foreach ($enabledApps as $app) {
- $apps['enabled'][$app] = (isset($versions[$app])) ? $versions[$app] : '';
+ $apps['enabled'][$app] = (isset($versions[$app])) ? $versions[$app] : true;
}
sort($disabledApps);
foreach ($disabledApps as $app) {
- $apps['disabled'][$app] = (isset($versions[$app])) ? $versions[$app] : '';
+ $apps['disabled'][$app] = null;
}
$this->writeAppList($input, $output, $apps);
break;
default:
foreach ($items as $key => $item) {
- $output->writeln(' - ' . (!is_int($key) ? $key . ': ' : '') . $item);
+ if (!is_int($key)) {
+ $value = $this->valueToString($item);
+ if (!is_null($value)) {
+ $output->writeln(' - ' . $key . ': ' . $value);
+ } else {
+ $output->writeln(' - ' . $key);
+ }
+ } else {
+ $output->writeln(' - ' . $this->valueToString($item));
+ }
}
break;
}
}
+
+ protected function valueToString($value) {
+ if ($value === false) {
+ return 'false';
+ } else if ($value === true) {
+ return 'true';
+ } else if ($value === null) {
+ null;
+ } else {
+ return $value;
+ }
+ }
}
protected function execute(InputInterface $input, OutputInterface $output) {
$values = array(
- 'installed' => \OC_Config::getValue('installed') ? 'true' : 'false',
+ 'installed' => (bool) \OC_Config::getValue('installed'),
'version' => implode('.', \OC_Util::getVersion()),
'versionstring' => \OC_Util::getVersionString(),
'edition' => \OC_Util::getEditionString(),