I have discovered that when I foreach over a RecursiveDirectoryIterator
(see example below) the $item actually turns into a SplFileInfo object.
I would expect it to be a RecursiveDirectoryIterator. How do I do a
hasChildren() on SplFileInfo?
However, if I change it to a non-recursive,
Here's a RecursiveDirectoryIterator class I've written and find quite useful:
?php
/**
* This class encapsulates an iterator that iterates over all the files in a
* directory recursively. Only files that don't begin with a '.' are included
* in this iteration. This class essentially wraps an
On Mon, Feb 23, 2009 at 9:31 AM, Ryan Panning rpann...@gmail.com wrote:
I have discovered that when I foreach over a RecursiveDirectoryIterator
(see example below) the $item actually turns into a SplFileInfo object. I
would expect it to be a RecursiveDirectoryIterator. How do I do a
Nathan Nobbe wrote:
if youre trying to do recursive iteration whereby you 'flatten' the tree
structure, drop the RecursiveDirectoryIterator into a
RecursiveIteratorIterator (its for iterating over RecursiveIterators), then
you dont have to bother w/ calling hasChildren() at all. you probly also
Philip Graham wrote:
Here's a RecursiveDirectoryIterator class I've written and find quite useful:
?php
/**
* This class encapsulates an iterator that iterates over all the files in a
* directory recursively. Only files that don't begin with a '.' are included
* in this iteration. This
On February 23, 2009 12:32:26 Ryan Panning wrote:
Hi, although I don't think this will work in my situation, there is an
interesting piece of code that you have.
array_push($this-_dirStack, $this-_curDirIter);
Are you able to inject the iterator with more items? I would like to
do this with
On Mon, Feb 23, 2009 at 10:27 AM, Ryan Panning rpann...@gmail.com wrote:
Nathan Nobbe wrote:
if youre trying to do recursive iteration whereby you 'flatten' the tree
structure, drop the RecursiveDirectoryIterator into a
RecursiveIteratorIterator (its for iterating over RecursiveIterators),
7 matches
Mail list logo