Returns scheme and host which contains scheme://domain[:port]

@return string
436594
public function getSchemeAndHost()
    {
        $port = $this->getServer('SERVER_PORT');
        if ($port == 80 || $port == 443 || empty($port)) {
            $port = '';
        } else {
            $port = ':' . $port;
        }
        return $this->getScheme() . '://' . $this->getHost() . $port;
    }
33265
public static function getHostname()
    {
        // Check trusted requires config file which is not ready yet
        $host = Url::getHost($checkIfTrusted = false);

        // Remove any port number to get actual hostname
        $host = Url::getHostSanitized($host);

        return $host;
    }
1221456
public function getScheme()
    {
        if (isset($_SERVER['REQUEST_SCHEME'])) {
            // Apache 2.4+
            return $_SERVER['REQUEST_SCHEME'];
        }
        if (isset($_SERVER['REDIRECT_REQUEST_SCHEME'])) {
            return $_SERVER['REDIRECT_REQUEST_SCHEME'];
        }
        if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
            // Sometimes available in proxy-forwarded requests
            return $_SERVER['HTTP_X_FORWARDED_PROTO'];
        }
        if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
            // Old-style but compatible with IIS
            return 'https';
        }
        if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {
            // This doesn't say much, but this is our last attempt, so why not try
            return 'https';
        }
        return 'http';
    }
1311978
protected function getAddress() {
        $address = "{".$this->host.":".$this->port."/".($this->protocol ? $this->protocol : 'imap');
        if (!$this->validate_cert) {
            $address .= '/novalidate-cert';
        }
        if (in_array($this->encryption,['tls','ssl'])) {
            $address .= '/'.$this->encryption;
        }

        $address .= '}';

        return $address;
    }
1283908
public function getSiteUrl(): string
    {
        $url = $this->getStringValue(PlatformConfigurationInterface::KEY_SITE_URL);

        if (empty($url)) {
            $scheme = \filter_input(INPUT_SERVER, 'REQUEST_SCHEME');
            $server = \filter_input(INPUT_SERVER, 'SERVER_NAME');
            $url = $scheme.'://'.$server;
        }

        return $url;
    }
682543
public function getServerInfo()
    {
        return sprintf('%s:%s%s%s', $this->host, $this->port, $this->path, $this->core);
    }
960680
public function getPort()
    {
        return $this->port === null || $this->isDefaultPort($this->scheme, $this->port) ? null : $this->port;
    }
65270
protected function _getNormalizeHostTarget() {
        $configHost = trim(Mage::getStoreConfig(
            'turpentine_vcl/normalization/host_target' ));
        if ($configHost) {
            return $configHost;
        } else {
            $baseUrl = parse_url(Mage::getBaseUrl());
            if (isset($baseUrl['port'])) {
                return sprintf('%s:%d', $baseUrl['host'], $baseUrl['port']);
            } else {
                return $baseUrl['host'];
            }
        }
    }
336742
public function getUrl()
    {
        $scheme = $this->scheme!=null ? $this->scheme . '://' : MString::EMPTY_STRING;
        $host = $this->host!=null ? $this->host : MString::EMPTY_STRING;
        $port = $this->port!=null ? ':' . $this->port : MString::EMPTY_STRING;
        $user = $this->user!=null ? $this->user : MString::EMPTY_STRING;
        $pass = $this->password!=null ? ':' . $this->password : MString::EMPTY_STRING;
        $pass = ($user||$pass) ? "$pass@" : MString::EMPTY_STRING;
        $path = $this->path!=null ? $this->path : MString::EMPTY_STRING;
        $query = $this->query!=null ? '?' . $this->query : MString::EMPTY_STRING;
        $fragment = $this->fragment!=null ? '#' . $this->fragment : MString::EMPTY_STRING;

        return $scheme . $user . $pass . $host . $port . $path . $query . $fragment;
    }
258171
public function getDomain()
    {
        $current = $this->server['HTTP_HOST'];
        $parts = explode('.', $current);

        $zone = array_pop($parts);
        $provider = array_pop($parts);

        return $provider . '.' . $zone;
    }
1047648
protected function vhost()
	{
		if (isset($_SERVER['HTTP_X_FORWARDED_HOST']))
		{
			return preg_replace('/[^A-Za-z0-9\[\]\.:-]/', '', rtrim($_SERVER['HTTP_X_FORWARDED_HOST'],'/'));
		}
		
		$host = rtrim($_SERVER['HTTP_HOST']);
		if ($host == '')
		{
			$host = rtrim($_SERVER['SERVER_NAME']);
		}
		$host  = preg_replace('/[^A-Za-z0-9\[\]\.:-]/', '', $host);
		return $host;
	}
1316163
public function domain($domain = null) {
        if (!is_null($domain)) {
            $this->domain = $domain;
            return $this;
        } elseif (!$this->domain) {
            $this->domain = $this->scheme() . '://' . $this->host();
        }
        return $this->domain;
    }
1041685
public function getHostName()
    {
        $possibleHostSources = ['HTTP_X_FORWARDED_HOST', 'HTTP_HOST', 'SERVER_NAME', 'SERVER_ADDR'];
        $sourceTransformations = [
            "HTTP_X_FORWARDED_HOST" => function ($value) {
                $elements = explode(',', $value);
                return trim(end($elements));
            },
        ];
        $host = '';
        foreach ($possibleHostSources as $source) {
            if (!empty($host)) {
                break;
            }

            if (empty($_SERVER[$source])) {
                continue;
            }

            $host = $_SERVER[$source];
            if (array_key_exists($source, $sourceTransformations)) {
                $host = $sourceTransformations[$source]($host);
            }
        }

        // Remove port number from host
        $host = preg_replace('/:\d+$/', '', $host);

        return trim($host);
    }
719769
protected function prepareHost($scheme, $host)
    {
        $host = $this->stripScheme($host);

        if (substr($host, -1) === "/") {
            $host = substr($host, 0, -1);
        }

        return $scheme . $host;
    }
363817
public static function scheme()
    {
        $scheme = 'cli';

        if (PHP_SAPI !== 'cli') {
            $isSSL = false;

            if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
                $isSSL = true;
            }

            if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 1) {
                $isSSL = true;
            }

            if (isset($_SERVER['SERVER_PORT']) && ($_SERVER['SERVER_PORT'] == 443)) {
                $isSSL = true;
            }

            if (isset($_SERVER['HTTP_HTTPS']) && strtolower($_SERVER['HTTP_HTTPS']) == 'on') {
                $isSSL = true;
            }

            if (isset($_SERVER['HTTP_USESSL']) && $_SERVER['HTTP_USESSL'] == true) {
                $isSSL = true;
            }

            $scheme = ($isSSL) ? 'https' : 'http';
        }

        return $scheme;
    }
270617
public function getPort() : int
   {

      if ( null !== $this->port )
      {
         return $this->port;
      }

      if ( null === $this->scheme )
      {
         $this->scheme = static::$fallbackScheme;
      }

      switch ( \strtolower( $this->scheme ) )
      {
         case UrlScheme::HTTP : return 80;
         case UrlScheme::SSL  : return 443;
         case UrlScheme::FTP  : return 21;
         default              : return 0;
      }

   }
701897
function GetSubdomain()
    {
        $host = $this->host;
        $sub = substr($host, 0, strlen($host) - strlen($this->GetDomain()));
        return rtrim($sub, '.');
    }