From dfc0ed2c31ee75ded940147fe8c1963ce42c810e Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 18 Mar 2013 16:05:49 +0000 Subject: allow strings as input --- it_pipe.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3