diff options
| author | Marcus Boerger <helly@php.net> | 2004-05-08 12:24:15 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2004-05-08 12:24:15 +0000 |
| commit | a6feb3f405f76f068c6a89058f3382b4ebe4d4f2 (patch) | |
| tree | 418a89436f73fe362163428419c45fa573c99a44 /ext/spl/examples/cachingrecursiveiterator.inc | |
| parent | 26fea0bd809a06b505d9af69e606ded18e565692 (diff) | |
| download | php-git-a6feb3f405f76f068c6a89058f3382b4ebe4d4f2.tar.gz | |
- Update examples
- Update documentation
- Move classes/interfaces already implemented in c to new subdir internal
Diffstat (limited to 'ext/spl/examples/cachingrecursiveiterator.inc')
| -rw-r--r-- | ext/spl/examples/cachingrecursiveiterator.inc | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/ext/spl/examples/cachingrecursiveiterator.inc b/ext/spl/examples/cachingrecursiveiterator.inc deleted file mode 100644 index fc7d9a7220..0000000000 --- a/ext/spl/examples/cachingrecursiveiterator.inc +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -class CachingRecursiveIterator extends CachingIterator implements RecursiveIterator -{ - protected $hasChildren; - protected $getChildren; - - function __construct(RecursiveIterator $it, $flags = CIT_CALL_TOSTRING) - { - parent::__construct($it, $flags); - } - - function rewind(); - { - $this->hasChildren = false; - $this->getChildren = NULL; - parent::rewind(); - } - - function next() - { - if ($this->hasChildren = $this->it->hasChildren()) { - try { - //$this->getChildren = new CachingRecursiveIterator($this->it->getChildren(), $this->flags); - // workaround memleaks... - $child = $this->it->getChildren(); - $this->getChildren = new CachingRecursiveIterator($child, $this->flags); - } - catch(Exception $e) { - if (!$this->flags & CIT_CATCH_GET_CHILD) { - throw $e; - } - $this->hasChildren = false; - $this->getChildren = NULL; - } - } else { - $this->getChildren = NULL; - } - parent::next(); - } - - function hasChildren() - { - return $this->hasChildren; - } - - function getChildren() - { - return $this->getChildren; - } -} - -?>
\ No newline at end of file |
