public static function getServerNameOrIp($withProtocol = false)
    {
        $host = Miscellaneous::getSafelyGlobalVariable(INPUT_SERVER, 'HTTP_HOST');

        /*
         * Unknown host / server?
         * Nothing to do
         */
        if (empty($host)) {
            return '';
        }

        /*
         * With protocol?
         * Let's include the protocol
         */
        if ($withProtocol) {
            return sprintf('%s://%s', self::getProtocolName(), $host);
        }

        return $host;
    }