From 075a6b65040c331ecf8c6d6be9422ef09a14931f Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Fri, 14 Jun 2013 12:53:21 -0400 Subject: [PATCH] fixed how console color should be enabled. --- framework/yii/console/Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/yii/console/Controller.php b/framework/yii/console/Controller.php index 84d9d11..e4d4211 100644 --- a/framework/yii/console/Controller.php +++ b/framework/yii/console/Controller.php @@ -36,7 +36,7 @@ class Controller extends \yii\base\Controller /** * @var boolean whether to enable ANSI color in the output. - * If not set, ANSI color will be enabled for terminals that support it. + * If not set, ANSI color will only be enabled for terminals that support it. */ public $color; @@ -51,7 +51,7 @@ class Controller extends \yii\base\Controller */ public function isColorEnabled($stream = STDOUT) { - return ($this->color === null || $this->color) && Console::streamSupportsAnsiColors($stream); + return $this->color === null ? Console::streamSupportsAnsiColors($stream) : $this->color; } /**