Jelix\Routing\ClientRequest::getServerURI PHP Method

getServerURI() public method

return the server URI of the application (protocol + server name + port)
Since: 1.2.4
public getServerURI ( $forceHttps = null ) : string
return string the serveur uri
    function getServerURI($forceHttps = null)
    {
        $isHttps = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] != 'off';
        if ($forceHttps === null && $isHttps || $forceHttps) {
            $uri = 'https://';
        } else {
            $uri = 'http://';
        }
        $uri .= $this->getDomainName();
        $uri .= $this->getPort($forceHttps);
        return $uri;
    }