summaryrefslogtreecommitdiff
path: root/inc/cli.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-03-22 17:23:35 +0100
committerAndreas Gohr <andi@splitbrain.org>2014-03-22 17:23:35 +0100
commit272e9decc1b5a964c3303ffe8b5d52e9e08fde68 (patch)
tree117412e45111c6f8aad46003e504cbe26e53db7c /inc/cli.php
parente8bb93a50f98b9389d6bdca6124744208cde7728 (diff)
downloadrpg-272e9decc1b5a964c3303ffe8b5d52e9e08fde68.tar.gz
rpg-272e9decc1b5a964c3303ffe8b5d52e9e08fde68.tar.bz2
CLI: send messages to STDERR
Diffstat (limited to 'inc/cli.php')
-rw-r--r--inc/cli.php11
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();
}