_filters = $filters; } /** * Check whether the current element of the iterator is acceptable * * @return bool */ public function accept() { $current = str_replace('\\', '/', $this->current()->__toString()); $currentFilename = str_replace('\\', '/', $this->current()->getFilename()); if ($currentFilename == '.' || $currentFilename == '..') { return false; } foreach ($this->_filters as $filter) { $filter = str_replace('\\', '/', $filter); if (false !== strpos($current, $filter)) { return false; } } return true; } }