Remove the app version from disabled app list

This commit is contained in:
Joas Schilling 2015-04-20 16:31:43 +02:00
parent ce2c8533d9
commit 2c396a7080
3 changed files with 25 additions and 4 deletions

View File

@ -55,12 +55,12 @@ class ListApps extends Base {
sort($enabledApps); sort($enabledApps);
foreach ($enabledApps as $app) { foreach ($enabledApps as $app) {
$apps['enabled'][$app] = (isset($versions[$app])) ? $versions[$app] : ''; $apps['enabled'][$app] = (isset($versions[$app])) ? $versions[$app] : true;
} }
sort($disabledApps); sort($disabledApps);
foreach ($disabledApps as $app) { foreach ($disabledApps as $app) {
$apps['disabled'][$app] = (isset($versions[$app])) ? $versions[$app] : ''; $apps['disabled'][$app] = null;
} }
$this->writeAppList($input, $output, $apps); $this->writeAppList($input, $output, $apps);

View File

@ -54,9 +54,30 @@ class Base extends Command {
break; break;
default: default:
foreach ($items as $key => $item) { 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; break;
} }
} }
protected function valueToString($value) {
if ($value === false) {
return 'false';
} else if ($value === true) {
return 'true';
} else if ($value === null) {
null;
} else {
return $value;
}
}
} }

View File

@ -37,7 +37,7 @@ class Status extends Base {
protected function execute(InputInterface $input, OutputInterface $output) { protected function execute(InputInterface $input, OutputInterface $output) {
$values = array( $values = array(
'installed' => \OC_Config::getValue('installed') ? 'true' : 'false', 'installed' => (bool) \OC_Config::getValue('installed'),
'version' => implode('.', \OC_Util::getVersion()), 'version' => implode('.', \OC_Util::getVersion()),
'versionstring' => \OC_Util::getVersionString(), 'versionstring' => \OC_Util::getVersionString(),
'edition' => \OC_Util::getEditionString(), 'edition' => \OC_Util::getEditionString(),