public function FancyFileDeleteDirectoryOnlyRecursiveFilterIterator::accept in Fancy File Delete 7
File
- includes/
FancyFileDeleteDirectoryOnlyRecursiveFilterIterator.inc, line 14 - Fancy File Delete iterator for directory traversal.
Class
- FancyFileDeleteDirectoryOnlyRecursiveFilterIterator
- @file Fancy File Delete iterator for directory traversal.
Code
public function accept() {
if ($this
->current()
->isReadable()) {
$filename = $this
->current()
->getFilename();
// Skip hidden files and directories.
if ($filename[0] === '.') {
return FALSE;
}
if (!$this
->isDir()) {
return FALSE;
}
$path = $this
->current()
->getPathname();
foreach ($this->_exclude_paths as $exclude_path) {
if (strpos($path, $exclude_path) === 0) {
return FALSE;
}
}
return TRUE;
}
return FALSE;
}