public static function scan($path, $mod = GLOB_ONLYDIR, $returnRelative = false)
    {
        $path = Normalize::diskFullPath($path);

        if (!self::exist($path)) {
            return false;
        }

        $pattern = rtrim($path, '/') . '/*';
        $entry = glob($pattern, $mod);

        if ($returnRelative === true) {
            foreach ($entry as $key => $value) {
                $entry[$key] = trim(str_replace($path, null, $value), '/');
            }
        }

        return $entry;
    }
public static function scan($path, $mod = GLOB_ONLYDIR, $returnRelative = false)
    {
        $path = Normalize::diskFullPath($path);

        if (!self::exist($path)) {
            return false;
        }

        $pattern = rtrim($path, '/') . '/*';
        $entry = glob($pattern, $mod);

        if ($returnRelative === true) {
            foreach ($entry as $key => $value) {
                $entry[$key] = trim(str_replace($path, null, $value), '/');
            }
        }

        return $entry;
    }
public static function scan ( $ path , $ mod = GLOB_ONLYDIR , $ returnRelative = false ) { $ path = Normalize :: diskFullPath ( $ path ) ; if ( ! self :: exist ( $ path ) ) { return false ; } $ pattern = rtrim ( $ path , '/' ) . '/*' ; $ entry = glob ( $ pattern , $ mod ) ; if ( $ returnRelative === true ) { foreach ( $ entry as $ key => $ value ) { $ entry [ $ key ] = trim ( str_replace ( $ path , null , $ value ) , '/' ) ; } } return $ entry ; }
Scan files in directory and return full or relative path
@param string $path
@param int $mod
@param bool|false $returnRelative
@return array|bool
Scan files in directory and return full or relative path