Skip to content

Instantly share code, notes, and snippets.

@olekhy
Created May 23, 2012 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olekhy/2775102 to your computer and use it in GitHub Desktop.
Save olekhy/2775102 to your computer and use it in GitHub Desktop.
<?php
/**
* (non-PHPdoc)
* @see FilterIterator::accept()
*/
public function accept()
{
/* @var $file SplFileInfo */
$file = $this->current();
$extension = pathinfo($file->getPathname(), PATHINFO_EXTENSION);
if ($file->isFile() && !$this->isHidden($file) && in_array($extension, (array) $this->fileExtensions)) {
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment