Commit 075a6b65 by Qiang Xue

fixed how console color should be enabled.

parent 725d8100
...@@ -36,7 +36,7 @@ class Controller extends \yii\base\Controller ...@@ -36,7 +36,7 @@ class Controller extends \yii\base\Controller
/** /**
* @var boolean whether to enable ANSI color in the output. * @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; public $color;
...@@ -51,7 +51,7 @@ class Controller extends \yii\base\Controller ...@@ -51,7 +51,7 @@ class Controller extends \yii\base\Controller
*/ */
public function isColorEnabled($stream = STDOUT) public function isColorEnabled($stream = STDOUT)
{ {
return ($this->color === null || $this->color) && Console::streamSupportsAnsiColors($stream); return $this->color === null ? Console::streamSupportsAnsiColors($stream) : $this->color;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment