Torrent::scandir PHP Метод

scandir() публичный статический Метод

Helper to scan directories files and sub directories recursivly
public static scandir ( $dir ) : array
Результат array directory content list
    public static function scandir($dir)
    {
        $paths = array();
        foreach (scandir($dir) as $item) {
            if ($item != '.' && $item != '..') {
                if (is_dir($path = realpath($dir . DIRECTORY_SEPARATOR . $item))) {
                    $paths = array_merge(self::scandir($path), $paths);
                } else {
                    $paths[] = $path;
                }
            }
        }
        return $paths;
    }