Retrun current domain name

@return string Return current domain name.
977637
public function getDomain() {
		$fullBaseUrl = Router::fullBaseUrl();
		if (!empty($fullBaseUrl)) {
			$domain = parse_url($fullBaseUrl, PHP_URL_HOST);
		} else {
			$domain = 'localhost';
		}

		return $domain;
	}
769964
protected function get_current_url()
    {
        // When running from commandline the REQUEST_URI is missing.
        if (!isset($_SERVER['REQUEST_URI'])) {
            return null;
        }

        // HTTP_HOST is a client-supplied header that is optional in HTTP 1.0
        $host = (!empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST']
            : (!empty($_SERVER['LOCAL_ADDR'])  ? $_SERVER['LOCAL_ADDR']
            : (!empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '')));

        $httpS = $this->isHttps() ? 's' : '';
        return "http{$httpS}://{$host}{$_SERVER['REQUEST_URI']}";
    }
584039
protected function serverHostname()
    {
        $result = 'localhost.localdomain';
        if (!empty($this->Hostname)) {
            $result = $this->Hostname;
        } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
            $result = $_SERVER['SERVER_NAME'];
        } elseif (function_exists('gethostname') && gethostname() !== false) {
            $result = gethostname();
        } elseif (php_uname('n') !== false) {
            $result = php_uname('n');
        }
        return $result;
    }
292392
public static function domain()
	{
		$arr = self::_getConfigArray();
		array_shift($arr);
		if (is_null($arr))
		{
			$arr = [];
		}

		$domain = implode('.', $arr);
		return $domain;
	}
273508
public function currentPath()
    {
        $requestURI = $this->serverVar('REQUEST_URI');
        $sciptName  = $this->serverVar('SCRIPT_NAME');
        return rtrim(parse_url($requestURI? : $sciptName, PHP_URL_PATH), '/');
    }
4971
public function getDnsName(): string
    {
        $host = $this->environment["HTTP_HOST"] ?? "";
        $port = strpos($host, ":");
        if ($port !== false) {
            return substr($host, 0, $port);
        }
        return $host;
    }
497510
public static function getCurrentPath()
    {
        if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
            $url = $_SERVER['HTTP_X_REWRITE_URL'];
        } elseif (isset($_SERVER['REQUEST_URI'])) {
            $url = $_SERVER['REQUEST_URI'];
        } elseif (isset($_SERVER['ORIG_PATH_INFO'])) {
            $url = $_SERVER['ORIG_PATH_INFO'] . (!empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '');
        } else {
            $url = '';
        }

        return strpos($url, '?') ? strstr($url, '?', true) : $url;
    }
1061040
public function getCurrentEnvironmentName()
    {
        if (!empty($this->currentEnvironmentName)) {
            return $this->currentEnvironmentName;
        }

        // get current environments
        $environments = $this->applicationConfig->get('Application.Environments', false);

        if($environments){
            // get current url
            $currentUrl = $this->str($this->httpRequest()->getCurrentUrl());

            // loop over all registered environments in the config, and try to match the current based on the domain
            foreach ($environments as $eName => $e) {
                if ($currentUrl->contains($e->Domain)) {
                    $this->currentEnvironmentName = $eName;
                }
            }
        }

        if (empty($this->currentEnvironmentName)) {
            $this->currentEnvironmentName = 'Production';
        }

        return $this->currentEnvironmentName;
    }
999517
public function getDomain(): string
    {
        $normalizedDomain = idn_to_ascii($this->domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
        if ($normalizedDomain === false) {
            throw new FailedToNormalizeDomainException($this->domain);
        }

        return $normalizedDomain;
    }
1035853
protected static function domainWord()
    {
        $words = explode(' ', Company::name());
        shuffle($words);

        return strtolower(preg_replace('/\W/', '', current($words)));
    }
406736
public function getHostname()
    {
        if (is_null($this->hostname)) {
            $this->hostname = gethostbyaddr($this->ip);
        }

        return $this->hostname;
    }
543518
public function getCurrentRemote()
    {
        /** @var $result CallResult */
        $result = $this->getGit()->{'remote'}($this->getRepositoryPath(), array(
             '-v'
        ));
        $result->assertSuccess(sprintf('Cannot remote "%s"', $this->getRepositoryPath()));

        $tmp = $result->getStdOut();

        preg_match_all('/([a-z]*)\h(.*)\h\((.*)\)/', $tmp, $matches);

        $retVar = array();
        foreach($matches[0] as $key => $value)
            $retVar[$matches[1][$key]][$matches[3][$key]] = $matches[2][$key];

        return $retVar;
    }
501757
public static function getSysDomain()
    {
        static $ret = null;

        if ($ret !== null) {
            return $ret;
        }

        $host    = Typo3GeneralUtility::getIndpEnv('HTTP_HOST');
        $rootPid = self::getRootPid();

        $query = 'SELECT *
                    FROM sys_domain
                   WHERE pid = ' . (int)$rootPid . '
                     AND domainName = ' . DatabaseUtility::quote($host, 'sys_domain') . '
                     AND hidden = 0';
        $ret   = DatabaseUtility::getRow($query);

        return $ret;
    }
265649
public function getName(): string
    {
        $string = $this->getStringUri();
        if ($this->isSecure()) {
            $string .= ' (TLS)';
        }
        $string .= ' DC ';
        $string .= $this->getDc();
        $string .= ', via ';
        $string .= $this->getIpv6() ? 'ipv6' : 'ipv4';
        $string .= ' using ';
        foreach (array_reverse($this->nextStreams) as $k => $stream) {
            if ($k) {
                $string .= ' => ';
            }
            $string .= preg_replace('/.*\\\\/', '', $stream[0]);
            if ($stream[1]) {
                $string .= ' ('.json_encode($stream[1]).')';
            }
        }

        return $string;
    }
871026
public static function currentServerName()
    {
        if (! empty(env('SERVER_NAME'))) {
            $BASE_URL = env('SERVER_NAME');
        } elseif (! empty($_SERVER['SERVER_NAME'])) {
            $BASE_URL = $_SERVER['SERVER_NAME'];
        } elseif (! empty($_SERVER['HTTP_HOST'])) {
            $BASE_URL = $_SERVER['HTTP_HOST'];
        } else {
            $BASE_URL = 'empty';
        }
        return $BASE_URL;
    }
151137
protected function defaultDomain()
    {
        if ($suffix = $this->parser->getDomainSuffix()) {
            return strtolower(camel_case(basename(getcwd()))) . '.' . $suffix;
        }
        return '';
    }
729487
protected function ServerHostname() {
    if (!empty($this->Hostname)) {
      $result = $this->Hostname;
    } elseif (isset($_SERVER['SERVER_NAME'])) {
      $result = $_SERVER['SERVER_NAME'];
    } else {
      $result = 'localhost.localdomain';
    }

    return $result;
  }