OSMARTDIR is an example showing how to create a complete directory reader/manager using the SPL and Iterators.
This is only a beigining, that can, I hope, give you some clues to create your onw, perfect, directory manager ;-)
This one can apply filters (using FilterIterator) to personalize the reading. I also have implemented a copy method that can use
the filters to copy only what you want (in the exemple, I only copy files containing 'php' string in their name).
Some doc :
FILTER_ON only shows files matching the pattern
oSmartDir::FILTER_ON = 'php';
whill shows only files which filenames contain 'php'
oSmartDir::FILTER_ON = array ('php', 'html', 'js');
whill shows only files which filenames contain 'php', or 'html' or 'js'
FILTER_OFF do not show files matching the pattern
oSmartDir::FILTER_OFF = 'php';
won't show files which filenames contain 'php'
You can also use an arry here.
oSmartDir::DIr = false;
Won't show folders
oSmartDir::FILE = false;
won't show files
oSmartDir::RECURSE = false;
won't read recursively