src/Adapter/PhpFilesystemAdapter.php
/**
     * List the filenames of a directory.
     *
     * @param string  $directory The directory to list
     * @param boolean $recursive Whether to list recursively
     *
     * @return array A list of filenames
     */
List the filenames of a directory.
@param string  $directory The directory to list
@param boolean $recursive Whether to list recursively

@return array A list of filenames
List the filenames of a directory . @param string $directory The directory to list @param boolean $recursive Whether to list recursively @return array A list of filenames
public function listContents($directory = '', $recursive = false)
    {
        clearstatcache();
        $files = $this->glob($pattern = sprintf('%s/*', $directory), 0);
        if ($recursive !== false) {
            $dirs = $this->glob(dirname($pattern). DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR|GLOB_NOSORT|GLOB_BRACE);
            foreach ($dirs as $dir) {
                $files = array_merge($files, $this->listContents($dir . DIRECTORY_SEPARATOR . basename($pattern), $recursive));
            }
        }
        return $files;
    }
public function listContents ( $ directory = '' , $ recursive = false ) { clearstatcache ( ) ; $ files = $ this -> glob ( $ pattern = sprintf ( '%s/*' , $ directory ) , 0 ) ; if ( $ recursive !== false ) { $ dirs = $ this -> glob ( dirname ( $ pattern ) . DIRECTORY_SEPARATOR . '*' , GLOB_ONLYDIR | GLOB_NOSORT | GLOB_BRACE ) ; foreach ( $ dirs as $ dir ) { $ files = array_merge ( $ files , $ this -> listContents ( $ dir . DIRECTORY_SEPARATOR . basename ( $ pattern ) , $ recursive ) ) ; } } return $ files ; }
List the filenames of a directory.
List the filenames of a directory .
// clear the filecache // parse the directory // parse all subdirectories, if recursive parsing is wanted // load the directories // iterate over the subdirectories for its files // return the array with the files matching the glob pattern