SPL-StandardPHPLibrary
directorytreeiterator.inc
Go to the documentation of this file.
1 <?php
2 
18 {
22  function __construct($path)
23  {
24  parent::__construct(
27  ),
29  ),
30  parent::SELF_FIRST
31  );
32  }
33 
36  function current()
37  {
38  $tree = '';
39  for ($l=0; $l < $this->getDepth(); $l++) {
40  $tree .= $this->getSubIterator($l)->hasNext() ? '| ' : ' ';
41  }
42  return $tree . ($this->getSubIterator($l)->hasNext() ? '|-' : '\-')
43  . $this->getSubIterator($l)->__toString();
44  }
45 
48  function __call($func, $params)
49  {
50  return call_user_func_array(array($this->getSubIterator(), $func), $params);
51  }
52 }
53 
54 ?>
Iterates through recursive iterators.
__construct($path)
Construct from a path.
Cached recursive iteration over another Iterator.
DirectoryIterator to generate ASCII graphic directory trees.
__call($func, $params)
Aggregates the inner iterator.
recursive directory iterator
Definition: spl.php:1034