src/Config/Config.php
protected function getHostName()
    {
        if (!empty($_SERVER['REQUEST_URI'])) {
            $hostName = parse_url($_SERVER['REQUEST_URI'], PHP_URL_HOST);
        }
        if (!empty($hostName)) {
            if ($pos = strpos($hostName, 'www.') !== false) {
                $hostName = substr($hostName, $pos + strlen('www.'));
            }
        } else {
            $hostName = 'example.com';
        }
        return $hostName;
    }
protected function getHostName()
    {
        if (!empty($_SERVER['REQUEST_URI'])) {
            $hostName = parse_url($_SERVER['REQUEST_URI'], PHP_URL_HOST);
        }
        if (!empty($hostName)) {
            if ($pos = strpos($hostName, 'www.') !== false) {
                $hostName = substr($hostName, $pos + strlen('www.'));
            }
        } else {
            $hostName = 'example.com';
        }
        return $hostName;
    }
protected function getHostName ( ) { if ( ! empty ( $ _SERVER [ 'REQUEST_URI' ] ) ) { $ hostName = parse_url ( $ _SERVER [ 'REQUEST_URI' ] , PHP_URL_HOST ) ; } if ( ! empty ( $ hostName ) ) { if ( $ pos = strpos ( $ hostName , 'www.' ) !== false ) { $ hostName = substr ( $ hostName , $ pos + strlen ( 'www.' ) ) ; } } else { $ hostName = 'example.com' ; } return $ hostName ; }
Returns the hostname of the current request.

The hostname is returned without www. so it can be used as domain name
in constructing e-mail addresses.

@return string
The hostname of the current request.
Returns the hostname of the current request .