Created
May 23, 2012 12:52
-
-
Save olekhy/2775083 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* (non-PHPdoc) | |
* @see FilterIterator::accept() | |
*/ | |
public function accept() | |
{ | |
/* @var $file SplFileInfo */ | |
$file = $this->current(); | |
if ($this->isHidden($file->getFilename())) { | |
return false; | |
} | |
if ($file->isDir()) { | |
return false; | |
} else if ($file->isFile()) { | |
if (empty($this->fileExtensions)) { | |
return true; | |
} else { | |
$extension = pathinfo($file->getPathname(), PATHINFO_EXTENSION); | |
return in_array($extension, $this->fileExtensions); | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment