class SkipDotsRecursiveDirectoryIterator

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

Expanded class hierarchy of SkipDotsRecursiveDirectoryIterator

File

includes/filetransfer/filetransfer.inc, line 402

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

Title Sort descending Modifiers Object type Summary
SkipDotsRecursiveDirectoryIterator::next function
SkipDotsRecursiveDirectoryIterator::rewind function
SkipDotsRecursiveDirectoryIterator::skipdots protected function
SkipDotsRecursiveDirectoryIterator::__construct function Constructs a SkipDotsRecursiveDirectoryIterator

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.