summaryrefslogtreecommitdiff
path: root/it_pipe.class
diff options
context:
space:
mode:
authorUrban Müller2013-03-18 16:05:49 +0000
committerUrban Müller2013-03-18 16:05:49 +0000
commitdfc0ed2c31ee75ded940147fe8c1963ce42c810e (patch)
treef6da71bb98f5dc3343dc7f5f94ecb6213e93cec2 /it_pipe.class
parent79d22a9ad685a0b0b029897b38a64658097bb68a (diff)
downloaditools-dfc0ed2c31ee75ded940147fe8c1963ce42c810e.tar.gz
itools-dfc0ed2c31ee75ded940147fe8c1963ce42c810e.tar.bz2
itools-dfc0ed2c31ee75ded940147fe8c1963ce42c810e.zip
allow strings as input
Diffstat (limited to 'it_pipe.class')
-rw-r--r--it_pipe.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_pipe.class b/it_pipe.class
index 28ef36a..2c5a184 100644
--- a/it_pipe.class
+++ b/it_pipe.class
@@ -13,7 +13,7 @@ class it_pipe implements Iterator
function __construct($p = array())
{
if ($p['data'])
- $this->lines = $p['data'];
+ $this->lines = is_array($p['data']) ? $p['data'] : explode("\n", rtrim($p['data'], "\n"));
else if ($p['cmd'])
$this->lines = strlen($data = it::exec($p['cmd'], $p['args'])) ? explode("\n", rtrim($data, "\n")) : array();
else