public static function exists($path)
    {
        if (file_exists($path) === false) {
            return false;
        }

        $path = preg_replace('#^file:/+([a-z]:/|/)#i', '$1', $path);
        $pinfo = pathinfo($path);

        $rpath = strtr(realpath($path), '\\', '/');

        if ($pinfo['dirname'] !== '.') {
            $path = Uri::canonpath($pinfo['dirname']) . '/' . $pinfo['basename'];
        }

        $pinfo = null;

        return $rpath === $path || substr($rpath, strlen($rpath) - strlen($path)) === $path;
    }