Mediamanager\Controller\Mediamanager::getfilelist PHP Method

getfilelist() protected method

protected getfilelist ( )
    protected function getfilelist()
    {
        $list = [];
        $toignore = ['\\.svn', '_svn', 'cvs', '_darcs', '\\.arch-params', '\\.monotone', '\\.bzr', '\\.git', '\\.hg', '\\.ds_store', '\\.thumb', '\\/cache'];
        $toignore = '/(' . implode('|', $toignore) . ')/i';
        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->root)) as $file) {
            if ($file->isDir()) {
                continue;
            }
            $filename = $file->getFilename();
            if ($filename[0] == '.' || preg_match($toignore, $file->getPathname())) {
                continue;
            }
            $path = trim(str_replace(['\\', $this->root], ['/', ''], $file->getPathname()), '/');
            $list[] = ["is_file" => true, "is_dir" => false, "is_writable" => is_writable($file->getPathname()), "name" => $filename, "path" => $path, "dir" => dirname($path), "url" => $this->app->pathToUrl($file->getPathname())];
        }
        return json_encode($list);
    }