Skip to content

Commit cca2a74

Browse files
committed
Update examples
1 parent facea7f commit cca2a74

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ext/spl/examples/cachingrecursiveiterator.inc

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ class CachingRecursiveIterator extends CachingIterator implements RecursiveItera
66
protected $getChildren;
77
protected $catch_get_child;
88

9-
function __construct(RecursiveIterator $it, $catch_get_child = false)
9+
function __construct(RecursiveIterator $it, $getStrVal = true, $catch_get_child = false)
1010
{
1111
$this->catch_get_child = $catch_get_child;
12-
parent::__construct($it);
12+
parent::__construct($it, $getStrVal);
1313
}
1414

1515
function next()
1616
{
1717
if ($this->hasChildren = $this->it->hasChildren()) {
1818
try {
19-
//$this->getChildren = new CachingRecursiveIterator($this->it->getChildren(), $this->catch_get_child);
19+
//$this->getChildren = new CachingRecursiveIterator($this->it->getChildren(), $this->getStrVal, $this->catch_get_child);
2020
// workaround memleaks...
2121
$child = $this->it->getChildren();
22-
$this->getChildren = new CachingRecursiveIterator($child, $this->catch_get_child);
22+
$this->getChildren = new CachingRecursiveIterator($child, $this->getStrVal, $this->catch_get_child);
2323
}
2424
catch(Exception $e) {
2525
if (!$this->catch_get_child) {

ext/spl/examples/directorygraphiterator.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class DirectoryGraphIterator extends DirectoryTreeIterator
44
{
55
function __construct($path)
66
{
7-
RecursiveIteratorIterator::__construct(new CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), true), 1);
7+
RecursiveIteratorIterator::__construct(new CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), true, true), 1);
88
}
99
}
1010

ext/spl/examples/directorytreeiterator.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class DirectoryTreeIterator extends RecursiveIteratorIterator
44
{
55
function __construct($path)
66
{
7-
parent::__construct(new CachingRecursiveIterator(new RecursiveDirectoryIterator($path), true), 1);
7+
parent::__construct(new CachingRecursiveIterator(new RecursiveDirectoryIterator($path), true, true), 1);
88
}
99

1010
function current()

0 commit comments

Comments
 (0)