Jelix\Routing\ClientRequest::getServerURI PHP Méthode

getServerURI() public méthode

return the server URI of the application (protocol + server name + port)
Since: 1.2.4
public getServerURI ( $forceHttps = null ) : string
Résultat 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;
    }