diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-03-22 17:23:35 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-03-22 17:23:35 +0100 |
commit | 272e9decc1b5a964c3303ffe8b5d52e9e08fde68 (patch) | |
tree | 117412e45111c6f8aad46003e504cbe26e53db7c | |
parent | e8bb93a50f98b9389d6bdca6124744208cde7728 (diff) | |
download | rpg-272e9decc1b5a964c3303ffe8b5d52e9e08fde68.tar.gz rpg-272e9decc1b5a964c3303ffe8b5d52e9e08fde68.tar.bz2 |
CLI: send messages to STDERR
-rw-r--r-- | inc/cli.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/inc/cli.php b/inc/cli.php index c51d9b7d2..f2da6a49d 100644 --- a/inc/cli.php +++ b/inc/cli.php @@ -111,7 +111,7 @@ abstract class DokuCLI { * @param $string */ public function error($string) { - $this->colors->ptln("E: $string", 'red'); + $this->colors->ptln("E: $string", 'red', STDERR); } /** @@ -120,7 +120,7 @@ abstract class DokuCLI { * @param $string */ public function success($string) { - $this->colors->ptln("S: $string", 'green'); + $this->colors->ptln("S: $string", 'green', STDERR); } /** @@ -129,7 +129,7 @@ abstract class DokuCLI { * @param $string */ public function info($string) { - $this->colors->ptln("I: $string", 'cyan'); + $this->colors->ptln("I: $string", 'cyan', STDERR); } } @@ -201,10 +201,11 @@ class DokuCLI_Colors { * * @param $line * @param $color + * @param resource $channel */ - public function ptln($line, $color) { + public function ptln($line, $color, $channel=STDOUT) { $this->set($color); - echo rtrim($line) . "\n"; + fwrite($channel, rtrim($line) . "\n"); $this->reset(); } |