getDirectoryContents ignoreFileArray

Permalink
Could someone please tell me if the ignoreFileArray parameter accepts wildcards, regular expressions, or just a list of filesnames? See usage example below:

$fh = Loader::helper('file');
$ignoreFilesArray = array("index.php", "index.html", "index.htm"); 
$filelist = $fh->getDirectoryContents($fileSystemPath, $ignoreFilesArray);


Thanks in advance...

Jim K

nteaviation
 
Mnkras replied on at Permalink Reply
Mnkras
don't think it accepts regex,

if (substr($file, 0, 1) != '.' && (!in_array($file, $this->ignoreFiles))) {

just uses in_array.

so I think it has to just be file names,
nteaviation replied on at Permalink Reply
nteaviation
*ack* That's what I was afraid of, but not that big a problem. One more question, does $ignoreFilesArray require full filesystem path on it's filenames, or just the filename? I bet it wants the full filesystem path.


So it would make sense call getDirectoryContents and apply your own regex filter on the result to come up with the new list of filename to process. Let me ponder on that one a little and i'll get back with my solution :)

Thanks! (Ya gotta love this place)
nteaviation replied on at Permalink Reply
nteaviation
Please ignore my previous question. *brain sputter* I aready tested that. It only needs an array of filenames without the full file system path :)
Mnkras replied on at Permalink Reply
Mnkras
it also takes directory names :)
nteaviation replied on at Permalink Reply
nteaviation
Ah, that's cool. I thought I had seen an example someplace that used file paths with the filename, but I think I've slept since then *yawn* :)