public static function marshalUriFromServer(array $server, array $headers)
    {
        $uri = parent::marshalUriFromServer($server, $headers);
        list($base, $webroot) = static::getBase($uri, $server);

        // Look in PATH_INFO first, as this is the exact value we need prepared
        // by PHP.
        $pathInfo = Hash::get($server, 'PATH_INFO');
        if ($pathInfo) {
            $uri = $uri->withPath($pathInfo);
        } else {
            $uri = static::updatePath($base, $uri);
        }

        if (!$uri->getHost()) {
            $uri = $uri->withHost('localhost');
        }

        // Splat on some extra attributes to save
        // some method calls.
        $uri->base = $base;
        $uri->webroot = $webroot;

        return $uri;
    }