summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_pipe.class6
1 files changed, 3 insertions, 3 deletions
diff --git a/it_pipe.class b/it_pipe.class
index d002b5b..5e89123 100644
--- a/it_pipe.class
+++ b/it_pipe.class
@@ -196,12 +196,12 @@ function pipe($cmd)
/**
* Save our contents in a file
- * @param $fn filename to save in
+ * @param $fn filename to save in, omit or null for stdout
* @param $append append to file (boolean)
*/
-function save($fn, $append = false)
+function write($fn = null, $append = false)
{
- file_put_contents($fn, $this->lines ? join("\n", $this->lines) . "\n" : "", $append ? FILE_APPEND : 0);
+ file_put_contents($fn === null ? "php://stdout" : $fn, $this->lines ? join("\n", $this->lines) . "\n" : "", $append ? FILE_APPEND : 0);
return $this;
}