your not supposed to do anything ;-) but you can if you like :-) ... D. Dante Lorenso wrote: > I was about to write code to recursively list the contents of a > directory when I remembered seeing an object in SPL that would do it for > me: > > > http://us3.php.net/manual/en/function.recursivedirectoryiterator-next.php > > But there is no documentation on this object, and although I have it in > PHP 5.1.4, docs say it's might be only in CVS. So, I try using it and > get this: > > <?php > $dir = new RecursiveDirectoryIterator("/some/dir/path"); > while($dir->valid()) { > print $dir->current()."\n"; http://php.net/manual/en/function.recursivedirectoryiterator-haschildren.php and related methods... also take a look here: http://www.wiki.cc/php/RecursiveDirectoryIterator > $dir->next(); > } > ?> > > But it doesn't seem to recurse through the directories. In fact, this > acts just like DirectoryIterator. So, there must be a flag to make it > recurse, but documentation is not there. I see this documentation here: > > http://www.php.net/~helly/php/ext/spl/ try looking at the userland version of the SPL classes they give quite abit away as to how they work and how you can use them. > > But that just looks like the source code was parsed to generate it, > nothing much help in seeing an example of the usage. > > Is SPL meant to be used? If so, is it experimental? Is it documented? > Should I stay away from SPL for production code? What's the official word? yes it's meant to be used, yes you can use it in production BUT your a little on the bleeding edge (not very many people using it full on) AND the whole of SPL is still a little in flex (as is php5->php6 in general) so that you may be forced, occasionally, to adapt your code to changes (e.g. constants that were formally used in SPL are now class constants.) and please note this is not the official word but jmho. > > Dante > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php