Closed davidfsmith closed 12 years ago
I don't think this is the case.
It doesn't return anything because the filter is applied to folder names to, so all your directories are filtered out.
You can deal with that by defining the proper filterset, for example
array(
'^file_[0-9]*.zip$' => 'file', // only apply this filter on files, not directories
)
Ok so the logic in your response makes sense and I had tried that based on the documentation (http://docs.fuelphp.com/classes/file/usage.html#/method_read_dir), however trying it now again I'm still not seeing it work even with a more simple filterset (as per the doco)
array(
'\.zip$' => 'file',
);
That example works as a charm here. Didn't have a tree of zip files, so I used
$filter = array(
'\.php$' => 'file',
);
$files = File::read_dir("/var/www/fuelphp",0,$filter);
And it gives me a nice big nested array of all php files in all fuelphp versions I have in that folder. That folder itself only contains other folders, not a single file.
Ok, so this is PEBKAC, resolved with a pull of 1.2/master which I was on (or thought I was) anyway.
Apologies.
sigh
With the structure as below:
Using:
$files = File::read_dir($directory,0,$filer);
Returns the correct data back, however if 'file.zip' is removed from the top level directory zero files are returned.