diff --git a/cake/console/console_output.php b/cake/console/console_output.php index dd00f49e4ee..36cc7b16c81 100644 --- a/cake/console/console_output.php +++ b/cake/console/console_output.php @@ -1,6 +1,6 @@ stdin = fopen('php://stdin', 'r'); - $this->stdout = fopen('php://stdout', 'w'); - $this->stderr = fopen('php://stderr', 'w'); + $this->stdout = new ConsoleOutput('php://stdout'); + $this->stderr = new ConsoleOutput('php://stderr'); if (!$this->__bootstrap()) { $this->stderr("\nCakePHP Console: "); @@ -454,11 +456,7 @@ public function getInput($prompt, $options = null, $default = null) { * @return integer Returns the number of bytes output to stdout. */ public function stdout($string, $newline = true) { - if ($newline) { - return fwrite($this->stdout, $string . "\n"); - } else { - return fwrite($this->stdout, $string); - } + return $this->stdout->write($string, $newline); } /** @@ -467,7 +465,7 @@ public function stdout($string, $newline = true) { * @param string $string Error text to output. */ public function stderr($string) { - fwrite($this->stderr, $string); + $this->stderr->write($string, false); } /**