helly           Sat Nov 22 15:52:07 2003 EDT

  Added files:                 
    /spl/examples       directorygraphiterator.inc parentiterator.inc 
  Log:
  Add missing files
  
  

Index: spl/examples/directorygraphiterator.inc
+++ spl/examples/directorygraphiterator.inc
<?php

class DirectoryGraphIterator extends DirectoryTreeIterator
{
        function __construct($path)
        {
                RecursiveIteratorIterator::__construct(new 
CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), 
true), 1);
        }
}

?>
Index: spl/examples/parentiterator.inc
+++ spl/examples/parentiterator.inc
<?php

class ParentIterator extends FilterIterator implements RecursiveIterator
{
        function accept()
        {
                return $this->it->hasChildren();
        }

        function hasChildren()
        {
                return $this->it->hasChildren();
        }

        function getChildren()
        {
                return new ParentIterator($this->it->getChildren());
        }
}

?>

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to