Skip to content

Commit 95c0c36

Browse files
committed
Add missing files
1 parent 3d9ec63 commit 95c0c36

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
class DirectoryGraphIterator extends DirectoryTreeIterator
4+
{
5+
function __construct($path)
6+
{
7+
RecursiveIteratorIterator::__construct(new CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), true), 1);
8+
}
9+
}
10+
11+
?>

ext/spl/examples/parentiterator.inc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
class ParentIterator extends FilterIterator implements RecursiveIterator
4+
{
5+
function accept()
6+
{
7+
return $this->it->hasChildren();
8+
}
9+
10+
function hasChildren()
11+
{
12+
return $this->it->hasChildren();
13+
}
14+
15+
function getChildren()
16+
{
17+
return new ParentIterator($this->it->getChildren());
18+
}
19+
}
20+
21+
?>

0 commit comments

Comments
 (0)