diff options
author | Urban Müller | 2013-03-18 16:05:49 +0000 |
---|---|---|
committer | Urban Müller | 2013-03-18 16:05:49 +0000 |
commit | dfc0ed2c31ee75ded940147fe8c1963ce42c810e (patch) | |
tree | f6da71bb98f5dc3343dc7f5f94ecb6213e93cec2 /it_pipe.class | |
parent | 79d22a9ad685a0b0b029897b38a64658097bb68a (diff) | |
download | itools-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.class | 2 |
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 |