Determine the request target based on the server params

@return string
552647
protected function determineRequestTarget()
    {
        $params = $this->getServerParams();
        
        return isset($params['REQUEST_URI'])
            ? $params['REQUEST_URI']
            : (isset($params['REQUEST_METHOD']) && $params['REQUEST_METHOD'] === 'OPTIONS' ? '*' : '/');
    }
413086
protected function pullServer() {
		if (!is_array($this->serverVars)) {
			$this->serverVars = $this->request->getServerParams();
		}
		
		return $this->serverVars;
	}
1312903
private static HttpHost determineTarget(HttpUriRequest request) throws ClientProtocolException {
		// A null target may be acceptable if there is a default target.
		// Otherwise, the null target is detected in the director.
		HttpHost target = null;
		URI requestURI = request.getURI();
		if (requestURI.isAbsolute()) {
			target = URIUtils.extractHost(requestURI);
			if (target == null) {
				throw new ClientProtocolException(
						"URI does not specify a valid host name: " + requestURI);
			}
		}
		return target;
	}
575120
public function getCTATarget()
    {
        if (!($this->nb_site_target_destination instanceof CNabuSiteTarget) &&
            $this->getTargetUseURI() === CNabuSiteTargetLink::USE_URI_TRANSLATED &&
            is_numeric($this->getTargetId())
        ) {
            $this->nb_site_target_destination = $this->nb_site_target->getSite()->getTarget($this->getTargetId());
        }

        return $this->nb_site_target_destination;
    }
1223449
public function findRouteRequest(ServerRequestInterface $request): bool
    {
        /* @var $request \Rancoud\Http\Message\ServerRequest */
        $this->method = $request->getMethod();
        $this->url = $request->getUri()->getPath();
        $this->host = null;

        $serverParams = $request->getServerParams();
        if (isset($serverParams['HTTP_HOST'])) {
            $this->host = $serverParams['HTTP_HOST'];
        } elseif (isset($serverParams['SERVER_NAME'])) {
            $this->host = $serverParams['SERVER_NAME'];
        }

        return $this->find();
    }
850836
public function getTargetController()
    {
        $target = $this->getTarget();
        if ($target instanceof Closure ||
                !preg_match(Router::TARGET_REGEX, $target)) {
            return null;
        }
        $parts = explode('@', $target);
        return isset($parts[0]) ? $parts[0] : null;
    }
305774
public function getURLWithParams()
    {
        return ($this->params ? sprintf('%s?%s', $this->url, http_build_query($this->params)) : $this->url);
    }
592051
public function getServerSamlValidateURL()
    {
        phpCAS::traceBegin();
        // the URL is build only when needed
        if ( empty($this->_server['saml_validate_url']) ) {
            switch ($this->getServerVersion()) {
            case SAML_VERSION_1_1:
                $this->_server['saml_validate_url'] = $this->_getServerBaseURL().'samlValidate';
                break;
            }
        }

        $url = $this->_buildQueryUrl(
            $this->_server['saml_validate_url'],
            'TARGET='.urlencode($this->getURL())
        );
        phpCAS::traceEnd($url);
        return $url;
    }
262840
private static function getServerParam(ServerRequestInterface $request, string $key, string $default = '-'): string
    {
        $server = $request->getServerParams();

        return empty($server[$key]) ? $default : $server[$key];
    }
457708
protected static function getRequestUrl()
    {
        $hostname = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null);

        if(isset($hostname))
        {
            $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';

            if(!isset($_SERVER['REQUEST_URI']))
            {
                if(isset($_SERVER['QUERY_STRING']))
                {
                    return $protocol . '://' . $hostname . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
                }
                else
                {
                    return $protocol . '://' . $hostname . $_SERVER['PHP_SELF'];
                }
            }
            else
            {
                return $protocol . '://' . $hostname . $_SERVER['REQUEST_URI'];
            }
        }
        else
        {
            return null;
        }
    }
824507
protected function determineServerParams(BrowserKitRequest $request, UriInterface $uri, array $queryParams)
    {
        return [
            'REQUEST_METHOD' => $request->getMethod(),
            'QUERY_STRING' => http_build_query($queryParams),
            'REQUEST_URI' => (string)($uri->withScheme('')->withHost('')->withPort('')->withUserInfo(''))
        ];
    }
1352718
protected function getTargetPath(Request $request)
    {
        $targetPath = $request->request->get('target_path');
        if (!$targetPath) {
            $targetPath = $request->query->get('target_path');
        }

        return $targetPath;
    }
923094
protected function determineProtocolVersion()
    {
        $params = $this->getServerParams();
        
        if (isset($params['SERVER_PROTOCOL'])) {
            list($protocol, $version) = explode('/', $params['SERVER_PROTOCOL']) + [1 => null];
        }
        
        return isset($protocol) && $protocol === 'HTTP' ? $version : "1.1";
    }
1106424
public function getServerParams()
    {
        if ($this->serverParams === null) {
            if ($this->serverParamsProvider !== null) {
                $this->serverParams = ($this->serverParamsProvider)();
            } else {
                $this->serverParams = [];
            }
        }
        return $this->serverParams;
    }
766372
private function get_target_user() {

        if (!$this->fixeddataset) {
            $userid = $this->userids[rand(1, self::$paramusers[$this->size])];
        } else if ($userid = current($this->userids)) {
            // Moving pointer to the next user.
            next($this->userids);
        } else {
            // Returning to the beginning if we reached the end.
            $userid = reset($this->userids);
        }

        return $userid;
    }
317157
protected function getTargetApiPath() : array
    {
        $result = [
            'fragment' => 'Controller/Api',
            'namespace' => 'App\Controller\Api',
        ];

        $versions = Utility::getApiVersions();

        if (empty($versions)) {
            return $result;
        }

        $recent = end($versions);

        if (preg_match('/^api(.*)$/', $recent['prefix'], $matches)) {
            $postfix = strtoupper($matches[1]);
            $result['fragment'] .= $postfix . '/';
            $result['namespace'] .= str_replace('/', '\\', $postfix);
        }

        return $result;
    }
481577
public function getParam(): string
    {
        if ($this->options->is_null('param')) {
            $this->options->set('param', 'page' . (1 == self::$iPagination ? '' : self::$iPagination));
        }

        return $this->options->get('param');
    }