public static function getLocalPath($path, $webDir, $hostPattern = '/(.*)+/')
    {
        if (false !== strpos($path, '://')) {
            $url = parse_url($path);

            if (isset($url['host'], $url['path'])
                    && preg_match($hostPattern, $url['host'], $matches)) {
                $path = static::getExistingPath($url['path'], $webDir, $path);
            }
        } else {
            $path = static::getExistingPath($path, $webDir);
        }

        return $path;
    }
public static function getLocalPath($path, $webDir, $hostPattern = '/(.*)+/')
    {
        if (false !== strpos($path, '://')) {
            $url = parse_url($path);

            if (isset($url['host'], $url['path'])
                    && preg_match($hostPattern, $url['host'], $matches)) {
                $path = static::getExistingPath($url['path'], $webDir, $path);
            }
        } else {
            $path = static::getExistingPath($path, $webDir);
        }

        return $path;
    }
public static function getLocalPath ( $ path , $ webDir , $ hostPattern = '/(.*)+/' ) { if ( false !== strpos ( $ path , '://' ) ) { $ url = parse_url ( $ path ) ; if ( isset ( $ url [ 'host' ] , $ url [ 'path' ] ) && preg_match ( $ hostPattern , $ url [ 'host' ] , $ matches ) ) { $ path = static :: getExistingPath ( $ url [ 'path' ] , $ webDir , $ path ) ; } } else { $ path = static :: getExistingPath ( $ path , $ webDir ) ; } return $ path ; }
Get the local path of file.

@param string $path        The path
@param string $webDir      The absolute web directory
@param string $hostPattern The pattern of allowed host

@return string
Get the local path of file .