[Pkg-owncloud-commits] [owncloud] 119/165: Remove the app version from disabled app list

David Prévot taffit at moszumanska.debian.org
Thu Apr 23 04:06:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 2c396a708069bc4080a8c5273a69dbdfdaf0170e
Author: Joas Schilling <nickvergessen at owncloud.com>
Date:   Mon Apr 20 16:31:43 2015 +0200

    Remove the app version from disabled app list
---
 core/command/app/listapps.php |  4 ++--
 core/command/base.php         | 23 ++++++++++++++++++++++-
 core/command/status.php       |  2 +-
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/core/command/app/listapps.php b/core/command/app/listapps.php
index 37a1d64..e30badd 100644
--- a/core/command/app/listapps.php
+++ b/core/command/app/listapps.php
@@ -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);
diff --git a/core/command/base.php b/core/command/base.php
index c2d5cf9..f84dcb1 100644
--- a/core/command/base.php
+++ b/core/command/base.php
@@ -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;
+		}
+	}
 }
diff --git a/core/command/status.php b/core/command/status.php
index 3859f69..737113d 100644
--- a/core/command/status.php
+++ b/core/command/status.php
@@ -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(),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list