Jelix\Routing\ClientRequest::getDomainName PHP Method

getDomainName() public method

return the application domain name
Since: 1.2.3
public getDomainName ( ) : string
return string
    function getDomainName()
    {
        if (App::config()->domainName != '') {
            return App::config()->domainName;
        } elseif (isset($_SERVER['HTTP_HOST'])) {
            if (($pos = strpos($_SERVER['HTTP_HOST'], ':')) !== false) {
                return substr($_SERVER['HTTP_HOST'], 0, $pos);
            }
            return $_SERVER['HTTP_HOST'];
        } elseif (isset($_SERVER['SERVER_NAME'])) {
            return $_SERVER['SERVER_NAME'];
        }
        return '';
    }