FOF30\Download\Download::getFiles PHP Method

getFiles() protected static method

This method will crawl a starting directory and get all the valid files that will be analyzed by __construct. Then it organizes them into an associative array.
protected static getFiles ( string $path, array $ignoreFolders = [], array $ignoreFiles = [] ) : array
$path string Folder where we should start looking
$ignoreFolders array Folder ignore list
$ignoreFiles array File ignore list
return array Associative array, where the `fullpath` key contains the path to the file, and the `classname` key contains the name of the class
    protected static function getFiles($path, array $ignoreFolders = array(), array $ignoreFiles = array())
    {
        $return = array();
        $files = self::scanDirectory($path, $ignoreFolders, $ignoreFiles);
        // Ok, I got the files, now I have to organize them
        foreach ($files as $file) {
            $clean = str_replace($path, '', $file);
            $clean = trim(str_replace('\\', '/', $clean), '/');
            $parts = explode('/', $clean);
            $return[] = array('fullpath' => $file, 'classname' => '\\FOF30\\Download\\Adapter\\' . ucfirst(basename($parts[0], '.php')));
        }
        return $return;
    }