]> granicus.if.org Git - php/commitdiff
- Update examples
authorMarcus Boerger <helly@php.net>
Sat, 8 May 2004 12:24:15 +0000 (12:24 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 8 May 2004 12:24:15 +0000 (12:24 +0000)
- Update documentation
- Move classes/interfaces already implemented in c to new subdir internal

27 files changed:
ext/spl/examples/KeyFilter.inc [deleted file]
ext/spl/examples/autoload.inc
ext/spl/examples/dba_array.php
ext/spl/examples/dba_dump.php
ext/spl/examples/dbaarray.inc [new file with mode: 0755]
ext/spl/examples/dbareader.inc [moved from ext/spl/examples/dba_reader.inc with 93% similarity]
ext/spl/examples/directoryfilterdots.inc
ext/spl/examples/directorygraphiterator.inc [deleted file]
ext/spl/examples/directorytree.inc
ext/spl/examples/directorytreeiterator.inc
ext/spl/examples/emptyiterator.inc
ext/spl/examples/findfile.inc
ext/spl/examples/findregex.php
ext/spl/examples/infiniteiterator.inc
ext/spl/examples/ini_groups.php
ext/spl/examples/inigroups.inc [moved from ext/spl/examples/IniGroups.inc with 79% similarity]
ext/spl/examples/keyfilter.inc [new file with mode: 0755]
ext/spl/examples/searchiterator.inc
ext/spl/examples/tree.php
ext/spl/internal/cachingiterator.inc [moved from ext/spl/examples/cachingiterator.inc with 100% similarity, mode: 0755]
ext/spl/internal/cachingrecursiveiterator.inc [moved from ext/spl/examples/cachingrecursiveiterator.inc with 100% similarity, mode: 0755]
ext/spl/internal/filteriterator.inc [moved from ext/spl/examples/filteriterator.inc with 100% similarity]
ext/spl/internal/limititerator.inc [moved from ext/spl/examples/limititerator.inc with 100% similarity]
ext/spl/internal/parentiterator.inc [moved from ext/spl/examples/parentiterator.inc with 100% similarity, mode: 0755]
ext/spl/internal/recursiveiterator.inc [moved from ext/spl/examples/recursiveiterator.inc with 100% similarity, mode: 0755]
ext/spl/internal/recursiveiteratoriterator.inc [moved from ext/spl/examples/recursiveiteratoriterator.inc with 100% similarity]
ext/spl/internal/seekableiterator.inc [moved from ext/spl/examples/seekableiterator.inc with 100% similarity]

diff --git a/ext/spl/examples/KeyFilter.inc b/ext/spl/examples/KeyFilter.inc
deleted file mode 100755 (executable)
index ba73435..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-
-/**
- * @brief   Regular expression filter for string iterators
- * @author  Marcus Boerger
- * @version 1.0
- *
- * Instances of this class act as a filter around iterators whose elements
- * are strings. In other words you can put an iterator into the constructor
- * and the instance will only return elements which match the given regular 
- * expression.
- */
-class KeyFilter implements Iterator
-{
-       protected $it;
-       protected $regex;
-       protected $key;
-       protected $curr;
-
-       /**
-        * Constructs a filter around an iterator whose elemnts are strings.
-        * If the given iterator is of type spl_sequence then its rewind()
-        * method is called.
-        *
-        * @param it     Object that implements at least spl_forward
-        * @param regex  Regular expression used as a filter.
-        */
-       function __construct(Iterator $it, $regex) {
-               $this->it = $it;
-               $this->regex = $regex;
-               $this->fetch();
-       }
-
-       /**
-        * Rewind input iterator
-        */
-       function rewind() {
-               $this->it->rewind();
-       }
-       
-       /**
-        * Destruct the iterator.
-        */
-       function __destruct() {
-               unset($this->it);
-       }
-
-       /**
-        * Fetch next element and store it.
-        *
-        * @return void
-        */
-       protected function fetch() {
-               $this->key = false;
-               $this->curr = false;
-               while ($this->it->valid()) {
-                       $key = $this->it->key();
-                       if (ereg($this->regex, $key)) {
-                               $this->key = $key;
-                               $this->curr = $this->it->current();
-                               return;
-                       }
-                       $this->it->next();
-               };
-       }
-
-       /**
-        * Move to next element
-        *
-        * @return void
-        */
-       function next() {
-               $this->it->next();
-               $this->fetch();
-       }
-       
-       /**
-        * @return Whether more elements are available
-        */
-       function valid() {
-               return $this->key !== false;
-       }
-       
-       /**
-        * @return The current key
-        */
-       function key() {
-               return $this->key;
-       }
-       
-       /**
-        * @return The current value
-        */
-       function current() {
-               return $this->curr;
-       }
-       
-       /**
-        * hidden __clone
-        */
-       protected function __clone() {
-               // disallow clone 
-       }
-}
-
-?>
\ No newline at end of file
index 430680645acc40c59ee529b1e6f9a4da7ed57967..c2c4222f857cef0e2b7e9192ee2846ae79e50d27 100755 (executable)
@@ -1,5 +1,8 @@
 <?php
 
+/** \internal
+ * Tries to load class $classname from directory $dir.
+ */
 function __load_class($classname, $dir)
 {
        $file = $dir . '/' . $classname . '.inc';
@@ -11,6 +14,14 @@ function __load_class($classname, $dir)
        return false;
 }
 
+/** 
+ * @brief   Class loader for SPL example classes
+ * @author  Marcus Boerger
+ * @version 1.0
+ *
+ * Loads classes automatically from include_path as given by ini or from
+ * current directory of script or include file.
+ */
 function __autoload($classname) {
        $classname = strtolower($classname);
        foreach(split(':', ini_get('include_path')) as $dir)
index 931e3cfb9219ae96303f60496457382a2fcadf08..7d7a3816dfc9fc5f34edec832f066723d1787cae 100755 (executable)
@@ -9,7 +9,7 @@
  *
  * Note: configure with --enable-dba 
  *
- * (c) Marcus Boerger, 2003
+ * (c) Marcus Boerger, 2003 - 2004
  */
 
 if ($argc < 4) {
@@ -24,55 +24,7 @@ EOF;
        exit(1);
 }
 
-class DbaArray implements ArrayAccess {
-       private $db;
-
-       function __construct($file, $handler)
-       {
-               $this->db = dba_popen($file, "c", $handler);
-               if (!$this->db) {
-                       throw new exception("Databse could not be opened");
-               }
-       }
-
-       function __destruct()
-       {
-               dba_close($this->db);
-       }
-
-       function get($name)
-       {
-               $data = dba_fetch($name, $this->db); 
-               if($data) {
-                       if (ini_get('magic_quotes_runtime')) {
-                               $data = stripslashes($data);
-                       }
-                       //return unserialize($data);
-                       return $data;
-               }
-               else 
-               {
-                       return NULL;
-               }
-       }
-
-       function set($name, $value)
-       {
-               //dba_replace($name, serialize($value), $this->db);
-               dba_replace($name, $value, $this->db);
-               return $value;
-       }
-
-       function exists($name)
-       {
-               return dba_exists($name, $this->db);
-       }
-
-       function del($name)
-       {
-               return dba_delete($name, $this->db);
-       }
-}
+if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
 
 try {
        if ($argc > 2) {
index cdee831b0a61d46bbbc334d4a8992e5a6d2e2a79..613674fef8cd6be7cd63791ded85fa34f0296700 100755 (executable)
@@ -9,7 +9,7 @@
  *
  * Note: configure with --enable-dba 
  *
- * (c) Marcus Boerger, 2003
+ * (c) Marcus Boerger, 2003 - 2004
  */
 
 if ($argc < 3) {
@@ -24,13 +24,13 @@ EOF;
        exit(1);
 }
 
-require_once("dba_reader.inc");
-require_once("KeyFilter.inc");
+if (!class_exists("DbaReader")) require_once("dbareader.inc");
+if (!class_exists("KeyFilter")) require_once("keyfilter.inc");
 
 $db = new DbaReader($argv[1], $argv[2]);
 
 if ($argc>3) {
-       $db = new keyFilter($db, $argv[3]);
+       $db = new KeyFilter($db, $argv[3]);
 }
 
 foreach($db as $key => $val) {
diff --git a/ext/spl/examples/dbaarray.inc b/ext/spl/examples/dbaarray.inc
new file mode 100755 (executable)
index 0000000..51cd38f
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+
+if (!class_exists("DbaReader")) require_once("dbareader.inc");
+
+/** \ingroup Examples
+ * @brief   This implements a DBA Array
+ * @author  Marcus Boerger
+ * @version 1.0
+ */
+class DbaArray extends DbaReader implements ArrayAccess
+{
+
+       /**
+        * Open database $file with $handler in read only mode.
+        *
+        * @param file    Database file to open.
+        * @param handler Handler to use for database access.
+        */
+       function __construct($file, $handler)
+       {
+               $this->db = dba_popen($file, "c", $handler);
+               if (!$this->db) {
+                       throw new exception("Databse could not be opened");
+               }
+       }
+
+       /**
+        * Close database.
+        */
+       function __destruct()
+       {
+               parent::__destruct();
+       }
+
+       /**
+        * Read an entry.
+        *
+        * @param $name key to read from
+        * @return value associated with $name
+        */
+       function offsetGet($name)
+       {
+               $data = dba_fetch($name, $this->db); 
+               if($data) {
+                       if (ini_get('magic_quotes_runtime')) {
+                               $data = stripslashes($data);
+                       }
+                       //return unserialize($data);
+                       return $data;
+               }
+               else 
+               {
+                       return NULL;
+               }
+       }
+
+       /**
+        * Set an entry.
+        *
+        * @param $name key to write to
+        * @param $value value to write
+        */
+       function offsetSet($name, $value)
+       {
+               //dba_replace($name, serialize($value), $this->db);
+               dba_replace($name, $value, $this->db);
+               return $value;
+       }
+
+       /**
+        * @return whether key $name exists.
+        */
+       function offsetExists($name)
+       {
+               return dba_exists($name, $this->db);
+       }
+
+       /**
+        * Delete a key/value pair.
+        *
+        * @param $name key to delete.
+        */
+       function offsetUnset($name)
+       {
+               return dba_delete($name, $this->db);
+       }
+}
+
+?>
\ No newline at end of file
similarity index 93%
rename from ext/spl/examples/dba_reader.inc
rename to ext/spl/examples/dbareader.inc
index fa8fd3d85425d8f2d5254456a330f0981496fca6..add4df9b1f0c3800c4d9b5d8436f5848d2a3020d 100755 (executable)
@@ -1,14 +1,14 @@
 <?php
 
-/**
- * @brief   This implements a Dba Iterator.
+/** \ingroup Examples
+ * @brief   This implements a DBA Iterator.
  * @author  Marcus Boerger
  * @version 1.0
  */
 class DbaReader implements Iterator
 {
 
-       private $db = NULL;
+       protected $db = NULL;
        private $key = false;
        private $val = false;
 
index 3ca0e6a2f89a5c4f28b2a5df454dd6eb47d34a08..f03b4290f15bb0a0a6e3d6465ed35cfd920e7d4f 100755 (executable)
@@ -1,24 +1,48 @@
 <?php
 
+/** \ingroup Examples
+ * @brief   A filtered DirectoryIterator
+ * @author  Marcus Boerger
+ * @version 1.0
+ *
+ * This Iteraotr takes a pathname from which it creates a DirectoryIterator
+ * and makes it recursive. Further more it filters the entries '.' and '..'.
+ */
 class DirectoryFilterDots extends FilterIterator implements RecursiveIterator
 {
-       function __construct($path) {
+       /** Construct from a path.
+        * @param $path directory to iterate
+        */
+       function __construct($path)
+       {
                parent::__construct(new DirectoryIterator($path));
        }
-       
-       function accept() {
+
+       /** @return whether the current entry is neither '.' nor '..'
+        */     
+       function accept()
+       {
                return !$this->it->isDot();
        }
        
-       function hasChildren() {
+       /** @return whether the current entry is a directory
+        */
+       function hasChildren()
+       {
                return $this->it->hasChildren();
        }
 
-       function getChildren() {
+       /** @return the current subdirectory as a new DirectoryFilterDots instance.
+        */
+       function getChildren()
+       {
                return new DirectoryFilterDots($this->it->getPathname());
        }
        
-       function key() {
+       /** @return the current entries path name
+        */
+       function key()
+       {
                return $this->it->getPathname();
        }
 }
diff --git a/ext/spl/examples/directorygraphiterator.inc b/ext/spl/examples/directorygraphiterator.inc
deleted file mode 100644 (file)
index a8382e2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-class DirectoryGraphIterator extends DirectoryTreeIterator
-{
-       function __construct($path)
-       {
-               RecursiveIteratorIterator::__construct(new CachingRecursiveIterator(new ParentIterator(new RecursiveDirectoryIterator($path)), CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD), 1);
-       }
-}
-
-?>
\ No newline at end of file
index 218ca513d93ef6d5e8ccaaed34222ca92a59f70c..31c84b4af835310ef5045649f0b56efcc3e38eed 100755 (executable)
@@ -1,7 +1,15 @@
 <?php
 
+/** \ingroup Examples
+ * @brief   A directory iterator that does not show '.' and '..'.
+ * @author  Marcus Boerger
+ * @version 1.0
+ */
 class DirectoryTree extends RecursiveIteratorIterator
 {
+       /** Construct from a path.
+        * @param $path directory to iterate
+        */
        function __construct($path) {
                parent::__construct(new DirectoryFilterDots($path));
        }
index 13253d9a5284bed7f3903d3807c94860da1e7b72..4fadd6f71ba3655b1387e028431a396852f3a658 100644 (file)
@@ -1,12 +1,22 @@
 <?php
 
+/** \ingroup Examples
+ * @brief   DirectoryIterator to generate ASCII graphic directory trees
+ * @author  Marcus Boerger
+ * @version 1.0
+ */
 class DirectoryTreeIterator extends RecursiveIteratorIterator
 {
+       /** Construct from a path.
+        * @param $path directory to iterate
+        */
        function __construct($path)
        {
                parent::__construct(new CachingRecursiveIterator(new RecursiveDirectoryIterator($path), CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD), 1);
        }
-       
+
+       /** @return the current element prefixed with ASCII graphics
+        */     
        function current()
        {
                $tree = '';
@@ -16,7 +26,9 @@ class DirectoryTreeIterator extends RecursiveIteratorIterator
                return $tree . ($this->getSubIterator($l)->hasNext() ? '|-' : '\-') 
                       . $this->getSubIterator($l)->__toString();
        }
-       
+
+       /** Aggregates the inner iterator
+        */     
        function __call($func, $params)
        {
                return call_user_func_array(array($this->getSubIterator(), $func), $params);
index 34b5118e7416210546c682e276dcb1f09ce9583d..1a79173938529f439de00a82d142f464ebc8bbbb 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 
-/**
+/** \ingroup Examples
  * @brief   An empty Iterator
  * @author  Marcus Boerger
  * @version 1.0
@@ -8,26 +8,42 @@
  */
 class EmptyIterator implements Iterator
 {
+       /** No operation.
+        * @return void
+        */
        function rewind()
        {
                // nothing to do
        }
 
+       /** @return \c false
+        */
        function valid()
        {
                return false;
        }
 
+       /** This function must not be called. It throws an exception upon access.
+        * @throw Exception
+        * @return void
+        */
        function current()
        {
                throw new Exception('Accessing the value of an EmptyIterator');
        }
 
+       /** This function must not be called. It throws an exception upon access.
+        * @throw Exception
+        * @return void
+        */
        function key()
        {
                throw new Exception('Accessing the key of an EmptyIterator');
        }
 
+       /** No operation.
+        * @return void
+        */
        function next()
        {
                // nothing to do
index c4bce73a30d00ca52a0fc7152958959a99ebd835..147a69b34f801e1602dcf75512c15642009c3e34 100755 (executable)
@@ -1,15 +1,26 @@
 <?php
 
+if (!class_exists("FindFile")) require_once("findfile.inc");
+if (!class_exists("AppendIterator")) require_once("appenditerator.inc");
+
 /**
  * @brief   Base class to find files
  * @author  Marcus Boerger
- * @version 1.0
+ * @version 1.1
  *
  */
 class FindFile extends FilterIterator
 {
-       protected $file;
+       /** @internal filename to find */
+       private $file;
 
+       /** Construct from path and filename
+        *
+        * @param $path the directory to search in
+        *              If path contains ';' then this parameter is split and every
+        *              part of it is used as separate directory.
+        * @param $file the name of the files to search fro
+        */
        function __construct($path, $file)
        {
                $this->file = $file;
@@ -25,10 +36,21 @@ class FindFile extends FilterIterator
                }
        }
 
+       /** @return whether the current file matches the given filename
+        */
        function accept()
        {
                return !strcmp($this->current(), $this->file);
        }
+
+       /** @return the filename to search for.
+        * @note This may be overloaded and contain a regular expression for an
+        *       extended class that uses regular expressions to search.
+        */
+       function getSearch()
+       {
+               return $this->file;
+       }
 }
 
 ?>
\ No newline at end of file
index faed6a8ee07c17b4811f3b5f103c1d62348433ef..55431c0e389dd49bfb3ec8e7efb373094d0d8b5c 100755 (executable)
@@ -24,15 +24,10 @@ EOF;
        exit(1);
 }
 
-class RegexFindFile extends FindFile
-{
-       function accept()
-       {
-               return preg_match($this->file, $this->current());
-       }
-}
+if (!class_exists("RegexFindFile")) require_once("regexfindfile.inc");
 
-foreach(new RegexFindFile($argv[1], $argv[2]) as $file) {
+foreach(new RegexFindFile($argv[1], $argv[2]) as $file)
+{
        echo $file->getPathname()."\n";
 }
 
index d6488750b6d8e756aacbc4ae97b6094018f683a4..ea83edb76e1f789dfafa2abb22817ee5f9e4d39c 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 
-/**
+/** \ingroup Examples
  * @brief   An infinite Iterator
  * @author  Marcus Boerger
  * @version 1.0
  */
 class InfiniteIterator implements Iterator
 {
+       /** @internal 
+        * The inner Iterator. */
        private $it;
 
+       /** Construct from another Iterator.
+        * @param $it the inner Iterator.
+        */
        function __construct(Iterator $it)
        {
                $this->it = $it;
        }
 
+       /** @return the inner iterator
+        */
        function getInnerIterator()
        {
                return $this->it;
        }
 
+       /** Rewind the inner iterator.
+        * @return void
+        */
        function rewind()
        {
                $this->it->rewind();
        }
 
+       /** @return whether the current element is valid
+        */
        function valid()
        {
                return $this->it->valid();
        }
 
+       /** @return the current value
+        */
        function current()
        {
                return $this->it->current();
        }
 
+       /** @return the current key
+        */
        function key()
        {
                return $this->it->key();
        }
 
+       /** Move the inner Iterator forward to its next element or rewind it.
+        * @return void
+        */
        function next()
        {
                $this->it->next();
@@ -62,6 +81,13 @@ class InfiniteIterator implements Iterator
                        $this->it->rewind();
                }
        }
+
+       /** Aggregates the inner iterator
+        */     
+       function __call($func, $params)
+       {
+               return call_user_func_array(array($this->getSubIterator(), $func), $params);
+       }
 }
 
 ?>
\ No newline at end of file
index 2e76752e23c49af1e6f66942a5d733434cc38429..81cd4012b081a443e8e4eada2cbcb9ac38bf8927 100755 (executable)
@@ -24,8 +24,8 @@ EOF;
        exit(1);
 }
 
-require_once("dba_reader.inc");
-require_once("IniGroups.inc");
+if (!class_exists("KeyFilter")) require_once("keyfilter.inc");
+if (!class_exists("IniGroups")) require_once("inigroups.inc");
 
 $it = new IniGroups($argv[1]);
 if ($argc>2) {
similarity index 79%
rename from ext/spl/examples/IniGroups.inc
rename to ext/spl/examples/inigroups.inc
index bb596c2717c0eed9b1f8ca28d1107e8cf0efc879..745930643b31618e690de0d69fa9170ea7d26fe1 100755 (executable)
@@ -1,11 +1,12 @@
 <?php
 
-require_once("KeyFilter.inc");
+if (!class_exists("KeyFilter")) require_once("keyfilter.inc");
+if (!class_exists("DbaReader")) require_once("dbareader.inc");
 
-/**
+/** \ingroup Examples
  * @brief   Class to iterate all groups within an ini file.
  * @author  Marcus Boerger
- * @version 1.0
+ * @version 1.1
  *
  * Using this class you can iterator over all groups of a ini file.
  * 
@@ -23,7 +24,7 @@ class IniGroups extends KeyFilter
         * @param file Ini file to open.
         */
        function __construct($file) {
-               parent::__construct(new dba_reader($file, 'inifile'), '^\[.*\]$');
+               parent::__construct(new DbaReader($file, 'inifile'), '^\[.*\]$');
        }
 
        /**
diff --git a/ext/spl/examples/keyfilter.inc b/ext/spl/examples/keyfilter.inc
new file mode 100755 (executable)
index 0000000..0a61783
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+
+/** \ingroup Examples
+ * @brief   Regular expression filter for string iterators
+ * @author  Marcus Boerger
+ * @version 1.1
+ *
+ * Instances of this class act as a filter around iterators whose elements
+ * are strings. In other words you can put an iterator into the constructor
+ * and the instance will only return elements which match the given regular 
+ * expression.
+ */
+class KeyFilter extends FilterIterator
+{
+       /** @internal regular exoression used as filter */
+       private $regex;
+
+       /**
+        * Constructs a filter around an iterator whose elemnts are strings.
+        * If the given iterator is of type spl_sequence then its rewind()
+        * method is called.
+        *
+        * @param it     Object that implements at least spl_forward
+        * @param regex  Regular expression used as a filter.
+        */
+       function __construct(Iterator $it, $regex)
+       {
+               parent::__construct($it);
+               $this->regex = $regex;
+       }
+
+       /** \return whether the current key mathes the regular expression 
+        */
+       function accept()
+       {
+               return ereg($this->regex, $this->getInnerIterator()->key());
+       }
+       
+       /** @return regular expression used as filter
+        */
+       function getRegex()
+       {
+               return $this->regex;
+       }
+
+       /**
+        * hidden __clone
+        */
+       protected function __clone()
+       {
+               // disallow clone 
+       }
+}
+
+?>
\ No newline at end of file
index a9ba9df17185c537aaaf6ef3d68781ae06409162..c2bbbe6dea536a6f0607b80bd67bd6c2878862d6 100755 (executable)
@@ -1,21 +1,49 @@
 <?php
 
+/** @ingroup Examples
+ * @brief Iterator to search for a specific element
+ * @author  Marcus Boerger
+ * @version 1.0
+ *
+ * This extended FilterIterator stops after finding the first acceptable
+ * value.
+ */
 abstract class SearchIterator extends FilterIterator
 {
+       /** @internal whether an entry was found already */
        private $done = false;
 
-       function rewind() {
+       /** Rewind and reset so that it once again searches.
+        * @return void
+        */
+       function rewind()
+       {
                parent::rewind();
                $this->done = false;
        }
 
-       function valid() {
+       /** @return whether the current element is valid
+        * which can only happen once per iteration.
+        */
+       function valid()
+       {
                return !$this->done && parent::valid();
        }
        
-       function next() {
+       /** Do not move forward but instead mark as finished.
+        * @return void
+        */
+       function next()
+       {
                $this->done = true;
        }
+
+       /** Aggregates the inner iterator
+        */     
+       function __call($func, $params)
+       {
+               return call_user_func_array(array($this->getSubIterator(), $func), $params);
+       }
 }
 
 ?>
\ No newline at end of file
index 9a61acf942a7711a486b8b1b00b5328899e5beb6..ce989a2c3489b26122abd6b4df6e5a8f7677903f 100755 (executable)
@@ -6,7 +6,7 @@
  *
  * Simply specify the path to tree with parameter <path>.
  *
- * (c) Marcus Boerger, 2003
+ * (c) Marcus Boerger, 2003 - 2004
  */
 
 // The following line only operates on classes which are converted to c already.
@@ -26,8 +26,11 @@ EOF;
        exit(1);
 }
 
+if (!class_exists("DirectoryTreeIterator")) require_once("directorytreeiterator.inc");
+
 echo $argv[1]."\n";
-foreach(new DirectoryGraphIterator($argv[1]) as $file) {
+foreach(new DirectoryTreeIterator($argv[1]) as $file)
+{
        echo $file . "\n";
 }
 
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from ext/spl/examples/cachingiterator.inc
rename to ext/spl/internal/cachingiterator.inc
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from ext/spl/examples/parentiterator.inc
rename to ext/spl/internal/parentiterator.inc
old mode 100644 (file)
new mode 100755 (executable)
similarity index 100%
rename from ext/spl/examples/recursiveiterator.inc
rename to ext/spl/internal/recursiveiterator.inc