php-src/ext/spl/examples/directoryfilterdots.inc
Marcus Boerger 159c538bcf Major update:
- Remove all overloading hooks -> array_read/array_access must be rewritten
- Remove all basic iterators
- Remove all 'spl_' prefixing exposed to user level
- Add RecursiveIterator, RecursiveIteratorIterator
- Add DirectoryIterator, DirectoryTreeIterator
- Add some examples
2003-11-09 14:05:36 +00:00

26 lines
449 B
PHP
Executable File

<?php
class DirectoryFilterDots extends FilterIterator implements RecursiveIterator
{
function __construct($path) {
parent::__construct(new DirectoryIterator($path));
}
function accept() {
return !$this->it->isDot();
}
function hasChildren() {
return $this->it->hasChildren();
}
function getChildren() {
return new DirectoryFilterDots($this->it->getPathname());
}
function key() {
return $this->it->getPathname();
}
}
?>