src/Dir/Dir.php
public static function scan($path, $options = [])
    {
        $defaults = [
            'iterator'       => RecursiveIteratorIterator::SELF_FIRST,
            'skipDots'       => true,
            'leavesOnly'     => false,
            'followSymlinks' => true,
            'recursive'      => true
        ];
        $options += $defaults;

        $paths = (array) $path;

        $dirFlags = static::_dirFlags($options);
        $iteratorFlags = static::_iteratorFlags($options);

        $result = [];
        foreach ($paths as $path) {
            $result = array_merge($result, static::_scan($path, $options, $dirFlags, $iteratorFlags));
        }
        return $result;
    }
public static function scan($path, $options = [])
    {
        $defaults = [
            'iterator'       => RecursiveIteratorIterator::SELF_FIRST,
            'skipDots'       => true,
            'leavesOnly'     => false,
            'followSymlinks' => true,
            'recursive'      => true
        ];
        $options += $defaults;

        $paths = (array) $path;

        $dirFlags = static::_dirFlags($options);
        $iteratorFlags = static::_iteratorFlags($options);

        $result = [];
        foreach ($paths as $path) {
            $result = array_merge($result, static::_scan($path, $options, $dirFlags, $iteratorFlags));
        }
        return $result;
    }
public static function scan ( $ path , $ options = [ ] ) { $ defaults = [ 'iterator' => RecursiveIteratorIterator :: SELF_FIRST , 'skipDots' => true , 'leavesOnly' => false , 'followSymlinks' => true , 'recursive' => true ] ; $ options += $ defaults ; $ paths = ( array ) $ path ; $ dirFlags = static :: _dirFlags ( $ options ) ; $ iteratorFlags = static :: _iteratorFlags ( $ options ) ; $ result = [ ] ; foreach ( $ paths as $ path ) { $ result = array_merge ( $ result , static :: _scan ( $ path , $ options , $ dirFlags , $ iteratorFlags ) ) ; } return $ result ; }
Scans one or many directories for files.

@param  array|string $path    Path or paths to scan.
@param  array        $options Scanning options. Possible values are:
-`'iterator'`       _integer_     : The iterator mode.
-`'skipDots'`       _boolean_     : Keeps '.' and '..' if `true`.
-`'leavesOnly'`     _boolean_     : Keeps only leaves if `true`.
-`'followSymlinks'` _boolean_     : Follows Symlinks if `true`.
-`'recursive'`      _boolean_     : Scans recursively if `true`.
-`'include'`        _string|array_: An array of includes.
-`'exclude'`        _string|array_: An array of excludes.
-`'type'`           _string|array_: An array of types.
@return array
@throws Exception
Scans one or many directories for files .