Inheritance diagram for DirectoryGraphIterator:


Public Member Functions | |
| __call ($func, $params) | |
| __construct ($path) | |
| beginChildren () | |
| callGetChildren () | |
| callHasChildren () | |
| current () | |
| endChildren () | |
| getDepth () | |
| getInnerIterator () | |
| getSubIterator ($level=NULL) | |
| key () | |
| next () | |
| nextElement () | |
| rewind () | |
| valid () | |
Public Attributes | |
| const | CATCH_GET_CHILD = 0x00000002 |
| const | CHILD_FIRST = 2 |
| const | LEAVES_ONLY = 0 |
| const | SELF_FIRST = 1 |
Definition at line 17 of file directorygraphiterator.inc.
| DirectoryGraphIterator::__construct | ( | $ | path | ) |
Construct from a path.
| $path | directory to iterate |
Reimplemented from DirectoryTreeIterator.
Definition at line 19 of file directorygraphiterator.inc.
References RecursiveIteratorIterator::__construct(), CachingIterator::CALL_TOSTRING, and CachingIterator::CATCH_GET_CHILD.
00020 { 00021 RecursiveIteratorIterator::__construct( 00022 new RecursiveCachingIterator( 00023 new ParentIterator( 00024 new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_FILENAME 00025 ) 00026 ), 00027 CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD 00028 ), 00029 parent::SELF_FIRST 00030 ); 00031 }
Here is the call graph for this function:

| DirectoryTreeIterator::__call | ( | $ | func, | |
| $ | params | |||
| ) | [inherited] |
Aggregates the inner iterator.
Definition at line 48 of file directorytreeiterator.inc.
References RecursiveIteratorIterator::getSubIterator().
00049 { 00050 return call_user_func_array(array($this->getSubIterator(), $func), $params); 00051 }
Here is the call graph for this function:

| RecursiveIteratorIterator::beginChildren | ( | ) | [inherited] |
Called right after calling getChildren() and its rewind().
Definition at line 201 of file recursiveiteratoriterator.inc.
Referenced by RecursiveIteratorIterator::next().
| RecursiveIteratorIterator::callGetChildren | ( | ) | [inherited] |
Definition at line 193 of file recursiveiteratoriterator.inc.
Referenced by RecursiveIteratorIterator::next().
| RecursiveIteratorIterator::callHasChildren | ( | ) | [inherited] |
Definition at line 185 of file recursiveiteratoriterator.inc.
Referenced by RecursiveIteratorIterator::callNextElement(), and RecursiveIteratorIterator::next().
| DirectoryTreeIterator::current | ( | ) | [inherited] |
Reimplemented from RecursiveIteratorIterator.
Definition at line 36 of file directorytreeiterator.inc.
References RecursiveIteratorIterator::getDepth(), and RecursiveIteratorIterator::getSubIterator().
00037 { 00038 $tree = ''; 00039 for ($l=0; $l < $this->getDepth(); $l++) { 00040 $tree .= $this->getSubIterator($l)->hasNext() ? '| ' : ' '; 00041 } 00042 return $tree . ($this->getSubIterator($l)->hasNext() ? '|-' : '\-') 00043 . $this->getSubIterator($l)->__toString(); 00044 }
Here is the call graph for this function:

| RecursiveIteratorIterator::endChildren | ( | ) | [inherited] |
Called after current child iterator is invalid and right before it gets destructed.
Reimplemented in RecursiveCompareDualIterator.
Definition at line 209 of file recursiveiteratoriterator.inc.
Referenced by RecursiveIteratorIterator::next(), RecursiveIteratorIterator::rewind(), and RecursiveIteratorIterator::valid().
| RecursiveIteratorIterator::getDepth | ( | ) | [inherited] |
Definition at line 177 of file recursiveiteratoriterator.inc.
Referenced by DirectoryTreeIterator::current(), and RecursiveTreeIterator::getPrefix().
| RecursiveIteratorIterator::getInnerIterator | ( | ) | [inherited] |
Implements OuterIterator.
Definition at line 170 of file recursiveiteratoriterator.inc.
Referenced by RecursiveCompareDualIterator::areEqual(), RecursiveCompareDualIterator::areIdentical(), and RecursiveCompareDualIterator::endChildren().
| RecursiveIteratorIterator::getSubIterator | ( | $ | level = NULL |
) | [inherited] |
Definition at line 159 of file recursiveiteratoriterator.inc.
Referenced by RecursiveTreeIterator::__call(), DirectoryTreeIterator::__call(), DirectoryTreeIterator::current(), and RecursiveTreeIterator::getPrefix().
00160 { 00161 if (is_null($level)) { 00162 $level = $this->count; 00163 } 00164 return @$this->ait[$level]; 00165 }
| RecursiveIteratorIterator::key | ( | ) | [inherited] |
Implements Iterator.
Reimplemented in RecursiveTreeIterator.
Definition at line 91 of file recursiveiteratoriterator.inc.
References $it.
| RecursiveIteratorIterator::next | ( | ) | [inherited] |
Forward to next element.
Implements Iterator.
Definition at line 107 of file recursiveiteratoriterator.inc.
References $it, RecursiveIteratorIterator::beginChildren(), RecursiveIteratorIterator::callGetChildren(), RecursiveIteratorIterator::callHasChildren(), RecursiveIteratorIterator::callNextElement(), RecursiveIteratorIterator::endChildren(), and RecursiveIteratorIterator::valid().
00108 { 00109 while ($this->count) { 00110 $it = $this->ait[$this->count]; 00111 if ($it->valid()) { 00112 if (!$it->recursed && callHasChildren()) { 00113 $it->recursed = true; 00114 try 00115 { 00116 $sub = callGetChildren(); 00117 } 00118 catch (Exception $e) 00119 { 00120 if (!($this->flags & self::CATCH_GET_CHILD)) 00121 { 00122 throw $e; 00123 } 00124 $it->next(); 00125 continue; 00126 } 00127 $sub->recursed = false; 00128 $sub->rewind(); 00129 if ($sub->valid()) { 00130 $this->ait[++$this->count] = $sub; 00131 if (!$sub instanceof RecursiveIterator) { 00132 throw new Exception(get_class($sub).'::getChildren() must return an object that implements RecursiveIterator'); 00133 } 00134 $this->beginChildren(); 00135 return; 00136 } 00137 unset($sub); 00138 } 00139 $it->next(); 00140 $it->recursed = false; 00141 if ($it->valid()) { 00142 return; 00143 } 00144 $it->recursed = false; 00145 } 00146 if ($this->count) { 00147 unset($this->ait[$this->count--]); 00148 $it = $this->ait[$this->count]; 00149 $this->endChildren(); 00150 callNextElement(false); 00151 } 00152 } 00153 callNextElement(true); 00154 }
Here is the call graph for this function:

| RecursiveIteratorIterator::nextElement | ( | ) | [inherited] |
Called when the next element is available.
Definition at line 232 of file recursiveiteratoriterator.inc.
Referenced by RecursiveIteratorIterator::callNextElement().
| RecursiveIteratorIterator::rewind | ( | ) | [inherited] |
Rewind to top iterator as set in constructor.
Implements Iterator.
Reimplemented in RecursiveCompareDualIterator.
Definition at line 62 of file recursiveiteratoriterator.inc.
References RecursiveIteratorIterator::callNextElement(), and RecursiveIteratorIterator::endChildren().
00063 { 00064 while ($this->count) { 00065 unset($this->ait[$this->count--]); 00066 $this->endChildren(); 00067 } 00068 $this->ait[0]->rewind(); 00069 $this->ait[0]->recursed = false; 00070 callNextElement(true); 00071 }
Here is the call graph for this function:

| RecursiveIteratorIterator::valid | ( | ) | [inherited] |
Implements Iterator.
Definition at line 75 of file recursiveiteratoriterator.inc.
References RecursiveIteratorIterator::$count, $it, and RecursiveIteratorIterator::endChildren().
Referenced by RecursiveIteratorIterator::callNextElement(), and RecursiveIteratorIterator::next().
00076 { 00077 $count = $this->count; 00078 while ($count) { 00079 $it = $this->ait[$count]; 00080 if ($it->valid()) { 00081 return true; 00082 } 00083 $count--; 00084 $this->endChildren(); 00085 } 00086 return false; 00087 }
Here is the call graph for this function:

const RecursiveIteratorIterator::CATCH_GET_CHILD = 0x00000002 [inherited] |
Flag: Catches exceptions during getChildren() calls and simply jumps to the next element.
Definition at line 33 of file recursiveiteratoriterator.inc.
const RecursiveIteratorIterator::CHILD_FIRST = 2 [inherited] |
Mode: Show all children prior to their parent.
Definition at line 29 of file recursiveiteratoriterator.inc.
const RecursiveIteratorIterator::LEAVES_ONLY = 0 [inherited] |
const RecursiveIteratorIterator::SELF_FIRST = 1 [inherited] |
Mode: Show parents prior to their children.
Definition at line 27 of file recursiveiteratoriterator.inc.
1.5.2