From 88ec761548b66f58acc1a86cdd0fc164ca925476 Mon Sep 17 00:00:00 2001 From: SVN Migration Date: Sun, 15 Oct 2006 21:09:28 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'PECL_OPENSSL'. --- ext/spl/internal/recursiveiteratoriterator.inc | 235 ------------------------- 1 file changed, 235 deletions(-) delete mode 100755 ext/spl/internal/recursiveiteratoriterator.inc (limited to 'ext/spl/internal/recursiveiteratoriterator.inc') diff --git a/ext/spl/internal/recursiveiteratoriterator.inc b/ext/spl/internal/recursiveiteratoriterator.inc deleted file mode 100755 index 716ab475ff..0000000000 --- a/ext/spl/internal/recursiveiteratoriterator.inc +++ /dev/null @@ -1,235 +0,0 @@ -ait[0] = $it; - $this->mode = $mode; - $this->flags = $flags; - } - - /** Rewind to top iterator as set in constructor - */ - function rewind() - { - while ($this->count) { - unset($this->ait[$this->count--]); - $this->endChildren(); - } - $this->ait[0]->rewind(); - $this->ait[0]->recursed = false; - callNextElement(true); - } - - /** @return whether iterator is valid - */ - function valid() - { - $count = $this->count; - while ($count) { - $it = $this->ait[$count]; - if ($it->valid()) { - return true; - } - $count--; - $this->endChildren(); - } - return false; - } - - /** @return current key - */ - function key() - { - $it = $this->ait[$this->count]; - return $it->key(); - } - - /** @return current element - */ - function current() - { - $it = $this->ait[$this->count]; - return $it->current(); - } - - /** Forward to next element - */ - function next() - { - while ($this->count) { - $it = $this->ait[$this->count]; - if ($it->valid()) { - if (!$it->recursed && callHasChildren()) { - $it->recursed = true; - try - { - $sub = callGetChildren(); - } - catch (Exception $e) - { - if (!($this->flags & self::CATCH_GET_CHILD)) - { - throw $e; - } - $it->next(); - continue; - } - $sub->recursed = false; - $sub->rewind(); - if ($sub->valid()) { - $this->ait[++$this->count] = $sub; - if (!$sub instanceof RecursiveIterator) { - throw new Exception(get_class($sub).'::getChildren() must return an object that implements RecursiveIterator'); - } - $this->beginChildren(); - return; - } - unset($sub); - } - $it->next(); - $it->recursed = false; - if ($it->valid()) { - return; - } - $it->recursed = false; - } - if ($this->count) { - unset($this->ait[$this->count--]); - $it = $this->ait[$this->count]; - $this->endChildren(); - callNextElement(false); - } - } - callNextElement(true); - } - - /** @return Sub Iterator at given level or if unspecified the current sub - * Iterator - */ - function getSubIterator($level = NULL) - { - if (is_null($level)) { - $level = $this->count; - } - return @$this->ait[$level]; - } - - /** - * @return The inner iterator - */ - function getInnerIterator() - { - return $this->it; - } - - /** @return Current Depth (Number of parents) - */ - function getDepth() - { - return $this->level; - } - - /** @return whether current sub iterators current element has children - * @since PHP 5.1 - */ - function callHasChildren() - { - return $this->ait[$this->count]->hasChildren(); - } - - /** @return current sub iterators current children - * @since PHP 5.1 - */ - function callGetChildren() - { - return $this->ait[$this->count]->getChildren(); - } - - /** Called right after calling getChildren() and its rewind(). - * @since PHP 5.1 - */ - function beginChildren() - { - } - - /** Called after current child iterator is invalid and right before it - * gets destructed. - * @since PHP 5.1 - */ - function endChildren() - { - } - - private function callNextElement($after_move) - { - if ($this->valid()) - { - if ($after_move) - { - if (($this->mode == self::SELF_FIRST && $this->callHasChildren()) - $this->mode == self::LEAVES_ONLY) - $this->nextElement(); - } - else - { - $this->nextElement(); - } - } - } - - /** Called when the next element is available - */ - function nextElement(); -} - -?> \ No newline at end of file -- cgit v1.2.1