diff options
-rw-r--r-- | it_pipe.class | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/it_pipe.class b/it_pipe.class index 8b240ed..2ab931b 100644 --- a/it_pipe.class +++ b/it_pipe.class @@ -4,6 +4,9 @@ class it_pipe implements Iterator { static $lastargfunc = array('explode' => 1, 'preg_match' => 1, 'preg_split' => 1, 'it__match' => 1, 'it__replace' => 1); + var $lines; # all lines currently in pipe + var $_valid; + /** * Creates a pipe object from input. Named arguments: * $p['fn'] filename to read lines from @@ -52,22 +55,22 @@ function rewind() function next() { - $this->valid = each($this->lines); + $this->_valid = each($this->lines); } function valid() { - return $this->valid; + return $this->_valid; } function current() { - return $this->valid[1]; + return $this->_valid[1]; } function key() { - return $this->valid[0]; + return $this->_valid[0]; } @@ -199,7 +202,6 @@ function pipe($cmd) fclose($pipes[0]); $this->lines = explode("\n", rtrim(stream_get_contents($pipes[1]))); - $this->key = 0; fclose($pipes[1]); proc_close($process); |