diff options
-rw-r--r-- | it_pipe.class | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/it_pipe.class b/it_pipe.class index 838fa39..3bfcfff 100644 --- a/it_pipe.class +++ b/it_pipe.class @@ -13,8 +13,11 @@ function __construct($p = array()) { if ($p['data']) $this->lines = $p['data']; + else if ($p['cmd']) + $this->lines = explode("\n", rtrim(it::exec($p['cmd'], $p['args']))); else - $this->lines = isset($p['fn']) ? file($p['fn'], FILE_IGNORE_NEW_LINES) : explode("\n", rtrim(it::exec($p['cmd'], $p['args']))); + foreach ((array)($p['fn'] ? $p['fn'] : "php://stdin") as $fn) + $this->lines = array_merge((array)$this->lines, file($fn, FILE_IGNORE_NEW_LINES)); } /** |