]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove the app version from disabled app list
authorJoas Schilling <nickvergessen@owncloud.com>
Mon, 20 Apr 2015 14:31:43 +0000 (16:31 +0200)
committerJoas Schilling <nickvergessen@owncloud.com>
Mon, 20 Apr 2015 15:03:19 +0000 (17:03 +0200)
core/command/app/listapps.php
core/command/base.php
core/command/status.php

index 37a1d645ed43a2e1558d89c57d945ca2205cb751..e30baddb7457cfc6344696c294293a4f039b58b3 100644 (file)
@@ -55,12 +55,12 @@ class ListApps extends Base {
 
                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);
index c2d5cf97f02da0272c879c8332fd13d325a2bfc3..f84dcb1aeafecfaa08a4aeb0d67d0813dde3252f 100644 (file)
@@ -54,9 +54,30 @@ class Base extends Command {
                                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;
+               }
+       }
 }
index 3859f69febccafb56cf18c39c85fcd0c5ef4face..737113d4f8594d110bc14be010c578ca52441b8a 100644 (file)
@@ -37,7 +37,7 @@ class Status extends Base {
 
        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(),