protected function setPathInfo()
    {
        $query = $this->server->get('QUERY_STRING', '');
        $script = $this->server->get('SCRIPT_NAME', '');
        $uri = $this->server->get('REQUEST_URI', '/');

        $path = preg_replace(
            [
                '/\A' . preg_quote($script, '/') . '/',
                '/\A' . preg_quote(dirname($script), '/') . '/',
                '/\?' . preg_quote($query, '/') . '\z/'
            ],
            '',
            $uri
        );

        $this->path_info = '/' . ltrim($path, '/');
    }