class SkipDotsRecursiveDirectoryIterator in Drupal 7
Provides an interface for iterating recursively over filesystem directories.
Manually skips '.' and '..' directories, since no existing method is available in PHP 5.2.
@todo Depreciate in favor of RecursiveDirectoryIterator::SKIP_DOTS once PHP 5.3 or later is required.
Hierarchy
- class \SkipDotsRecursiveDirectoryIterator extends \RecursiveDirectoryIterator
Expanded class hierarchy of SkipDotsRecursiveDirectoryIterator
File
- includes/
filetransfer/ filetransfer.inc, line 400
View source
class SkipDotsRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
/**
* Constructs a SkipDotsRecursiveDirectoryIterator
*
* @param $path
* The path of the directory to be iterated over.
*/
function __construct($path) {
parent::__construct($path);
$this
->skipdots();
}
function rewind() {
parent::rewind();
$this
->skipdots();
}
function next() {
parent::next();
$this
->skipdots();
}
protected function skipdots() {
while ($this
->isDot()) {
parent::next();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SkipDotsRecursiveDirectoryIterator:: |
function | |||
SkipDotsRecursiveDirectoryIterator:: |
function | |||
SkipDotsRecursiveDirectoryIterator:: |
protected | function | ||
SkipDotsRecursiveDirectoryIterator:: |
function | Constructs a SkipDotsRecursiveDirectoryIterator |