From cca2a74462cc36c9af1ac058ecc5e94bc3d0b8f8 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sun, 7 Dec 2003 13:21:47 +0000 Subject: [PATCH] Update examples --- ext/spl/examples/cachingrecursiveiterator.inc | 8 ++++---- ext/spl/examples/directorygraphiterator.inc | 2 +- ext/spl/examples/directorytreeiterator.inc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/spl/examples/cachingrecursiveiterator.inc b/ext/spl/examples/cachingrecursiveiterator.inc index 59709a7522..898d40b0bc 100644 --- a/ext/spl/examples/cachingrecursiveiterator.inc +++ b/ext/spl/examples/cachingrecursiveiterator.inc @@ -6,20 +6,20 @@ class CachingRecursiveIterator extends CachingIterator implements RecursiveItera protected $getChildren; protected $catch_get_child; - function __construct(RecursiveIterator $it, $catch_get_child = false) + function __construct(RecursiveIterator $it, $getStrVal = true, $catch_get_child = false) { $this->catch_get_child = $catch_get_child; - parent::__construct($it); + parent::__construct($it, $getStrVal); } function next() { if ($this->hasChildren = $this->it->hasChildren()) { try { - //$this->getChildren = new CachingRecursiveIterator($this->it->getChildren(), $this->catch_get_child); + //$this->getChildren = new CachingRecursiveIterator($this->it->getChildren(), $this->getStrVal, $this->catch_get_child); // workaround memleaks... $child = $this->it->getChildren(); - $this->getChildren = new CachingRecursiveIterator($child, $this->catch_get_child); + $this->getChildren = new CachingRecursiveIterator($child, $this->getStrVal, $this->catch_get_child); } catch(Exception $e) { if (!$this->catch_get_child) { diff --git a/ext/spl/examples/directorygraphiterator.inc b/ext/spl/examples/directorygraphiterator.inc index 190aba92ee..b1b8743b4c 100644 --- a/ext/spl/examples/directorygraphiterator.inc +++ b/ext/spl/examples/directorygraphiterator.inc @@ -4,7 +4,7 @@ class DirectoryGraphIterator extends DirectoryTreeIterator { function __construct($path) { - RecursiveIteratorIterator::__construct(new CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), true), 1); + RecursiveIteratorIterator::__construct(new CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), true, true), 1); } } diff --git a/ext/spl/examples/directorytreeiterator.inc b/ext/spl/examples/directorytreeiterator.inc index 6465f51253..3accacae43 100644 --- a/ext/spl/examples/directorytreeiterator.inc +++ b/ext/spl/examples/directorytreeiterator.inc @@ -4,7 +4,7 @@ class DirectoryTreeIterator extends RecursiveIteratorIterator { function __construct($path) { - parent::__construct(new CachingRecursiveIterator(new RecursiveDirectoryIterator($path), true), 1); + parent::__construct(new CachingRecursiveIterator(new RecursiveDirectoryIterator($path), true, true), 1); } function current() -- 2.40.0