public function extract($path, $regex = null)
    {
        $directory = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);
        $iterator = new RecursiveIteratorIterator($directory);

        if ($regex) {
            $iterator = new RegexIterator($iterator, $regex);
        }

        $this->iterator->attachIterator($iterator);

        return $this;
    }
public function extract($path, $regex = null)
    {
        $directory = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);
        $iterator = new RecursiveIteratorIterator($directory);

        if ($regex) {
            $iterator = new RegexIterator($iterator, $regex);
        }

        $this->iterator->attachIterator($iterator);

        return $this;
    }
public function extract ( $ path , $ regex = null ) { $ directory = new RecursiveDirectoryIterator ( $ path , FilesystemIterator :: SKIP_DOTS ) ; $ iterator = new RecursiveIteratorIterator ( $ directory ) ; if ( $ regex ) { $ iterator = new RegexIterator ( $ iterator , $ regex ) ; } $ this -> iterator -> attachIterator ( $ iterator ) ; return $ this ; }
Add a new source folder.

@param string      $path
@param null|string $regex

@return $this
Add a new source folder .