summaryrefslogtreecommitdiff
path: root/it_pipe.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_pipe.class')
-rw-r--r--it_pipe.class8
1 files changed, 6 insertions, 2 deletions
diff --git a/it_pipe.class b/it_pipe.class
index 36e4f63..6847a5d 100644
--- a/it_pipe.class
+++ b/it_pipe.class
@@ -194,10 +194,14 @@ function pipe($cmd)
/**
* Save our contents in a file
+ * @param $fn filename to save in
+ * @param $append append to file (boolean)
*/
-function save($fn)
+function save($fn, $append = false)
{
- file_put_contents($fn, $this->lines ? join("\n", $this->lines) . "\n" : "");
+ file_put_contents($fn, $this->lines ? join("\n", $this->lines) . "\n" : "", $append ? FILE_APPEND : 0);
+
+ return $this;
}
}