core/Route.php
public static function parse($url = null)
    {
        $request_uri = null;
        if ($url === null) {
            if (IS_CLI) {
                if (isset($_SERVER['argv']) && !empty($_SERVER['argv'][1])) {
                    $request_uri = $_SERVER['REQUEST_URI'] = $_SERVER['argv'][1];
                    self::parseUrl($_SERVER['argv'][1]);
                    $data = parse_url($_SERVER['REQUEST_URI']);
                    if (isset($data['query'])) {
                        parse_str($data['query'], $args);
                        foreach ($args as $key => $val) {
                            $_GET[$key] = $val;
                            $_REQUEST[$key] = $val;
                        }
                    }
                } else {
                    $request_uri = $_SERVER['REQUEST_URI'] = '/';
                    self::parseUrl('/');
                }
            } else {
                if (isset($_SERVER['PATH_INFO'])) {
                    $request_uri = $_SERVER['PATH_INFO'];
                } else {
                    $request_uri = $_SERVER['REQUEST_URI'];
                }
                if (empty($request_uri)) {
                    $request_uri = '/';
                }
                self::parseUrl($request_uri);
            }
        } else {
            $request_uri = $url;
            self::parseUrl($url);
        }

        return $request_uri;
    }
public static function parse($url = null)
    {
        $request_uri = null;
        if ($url === null) {
            if (IS_CLI) {
                if (isset($_SERVER['argv']) && !empty($_SERVER['argv'][1])) {
                    $request_uri = $_SERVER['REQUEST_URI'] = $_SERVER['argv'][1];
                    self::parseUrl($_SERVER['argv'][1]);
                    $data = parse_url($_SERVER['REQUEST_URI']);
                    if (isset($data['query'])) {
                        parse_str($data['query'], $args);
                        foreach ($args as $key => $val) {
                            $_GET[$key] = $val;
                            $_REQUEST[$key] = $val;
                        }
                    }
                } else {
                    $request_uri = $_SERVER['REQUEST_URI'] = '/';
                    self::parseUrl('/');
                }
            } else {
                if (isset($_SERVER['PATH_INFO'])) {
                    $request_uri = $_SERVER['PATH_INFO'];
                } else {
                    $request_uri = $_SERVER['REQUEST_URI'];
                }
                if (empty($request_uri)) {
                    $request_uri = '/';
                }
                self::parseUrl($request_uri);
            }
        } else {
            $request_uri = $url;
            self::parseUrl($url);
        }

        return $request_uri;
    }
解析URL
@param null $url
@return null|string