You can. But the main advantage is less writing, more understanding. I see
type('file')->name('*.php')->in('/path/') tp be easier to
understand than
RegexIterator(RecursiveIteratorIterator(RecursiveDirectoryIterator('path/to/project/')),
'/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH);
BUt we all have our own styles. I would like to see this included, even if everyone
doesn't use it. The current usage in MW isn't even RDI, it's just opendir(),
readdir(), etc.
-X!
On Dec 21, 2010, at 7:22 AM, Tim Starling wrote:
On 21/12/10 15:21, Soxred93 wrote:
The usage is simple:
sfFinder::type('file')->name('*.php')->in('/path/to/dir');
//list
of PHP files in directory and all subdirectories
You can use RecursiveDirectoryIterator to do that. There's a cute
example in the online manual comments.
-- Tim Starling
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l