]> granicus.if.org Git - php/commitdiff
- Update examples
authorMarcus Boerger <helly@php.net>
Wed, 4 Jan 2006 15:34:26 +0000 (15:34 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 4 Jan 2006 15:34:26 +0000 (15:34 +0000)
ext/spl/examples/directorygraphiterator.inc
ext/spl/examples/directorytreeiterator.inc

index 0ba96085b348e1c73798f96af247fb2f82adbd5d..75e636956411936f3a3ff4e7a67c9b2d1c883bea 100644 (file)
 /** @ingroup Examples
  * @brief   A tree iterator that only shows directories.
  * @author  Marcus Boerger
- * @version 1.0
+ * @version 1.1
  */
 class DirectoryGraphIterator extends DirectoryTreeIterator
 {
        function __construct($path)
        {
-               RecursiveIteratorIterator::__construct(new RecursiveCachingIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD), 1);
+               RecursiveIteratorIterator::__construct(new RecursiveCachingIterator(new ParentIterator(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_FILENAME)), CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD), 1);
        }
 }
 
index 1966ce48d8b8e25bac02ee2c9111f0c983dc76c6..d8147c3ff730e41b1aa32bab11731d819e841431 100644 (file)
@@ -12,7 +12,7 @@
 /** @ingroup Examples
  * @brief   DirectoryIterator to generate ASCII graphic directory trees
  * @author  Marcus Boerger
- * @version 1.0
+ * @version 1.1
  */
 class DirectoryTreeIterator extends RecursiveIteratorIterator
 {
@@ -21,7 +21,7 @@ class DirectoryTreeIterator extends RecursiveIteratorIterator
         */
        function __construct($path)
        {
-               parent::__construct(new RecursiveCachingIterator(new RecursiveDirectoryIterator($path), CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD), 1);
+               parent::__construct(new RecursiveCachingIterator(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_FILENAME), CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD), 1);
        }
 
        /** @return the current element prefixed with ASCII graphics