On Tue, Dec 21, 2010 at 5:21 AM, Soxred93 <soxred93(a)gmail.com> wrote:
The usage is simple:
sfFinder::type('file')->name('*.php')->in('/path/to/dir');
//list of PHP files in directory and all subdirectories
sfFinder::type('file')->name('*.php')->in('/path/to/dir')->recurse(0);
//list of PHP files in that directory only
sfFinder::type('dir')->name('foo')->in('/path/to/dir');
//list of directories with the name "foo"
There is documentation at [3], but it's for an old version. The code is very similar
though, so most of it should apply to the current version.
I personally dislike the chained syntax. A file system abstraction
layer would be a good idea, but I believe the standard MediaWiki
convention of passing arrays around rather than function chaining is
much more elegant.
Finder::openFile( 'filename' );
Finder::findFile('7path', array( 'name' =>
'*.php'))->delete();
for ( Finder::findFiles($IP) as $file ) { $file->delete(); }