Returns the fully qualified Domain. A fully qualified Domain always ends with a dot (like 'www.example.com.')

@return string
515569
public function toFullyQualifiedString() : string
   {

      if ( empty( $this->_subDomainName ) )
      {

         if ( null === $this->_sld )
         {
            return '';
         }

         return $this->_sld->toFullyQualifiedString();

      }

      if ( null === $this->_sld )
      {
         return $this->_subDomainName;
      }

      return $this->_subDomainName . '.' . $this->_sld->toFullyQualifiedString();

   }
1026402
public function getDomain()
    {
        $uri = $this->getServiceLocator()->get('Application')->getMvcEvent()->getRequest()->getUri();
        return sprintf('%s://%s', $uri->getScheme(), $uri->getHost());
    }
30284
private String fullyQualifiedRegistrationDomain() {
    if (job.getRegistrationDomain().endsWith(".")) {
      return job.getRegistrationDomain();
    } else if ("".equals(job.getRegistrationDomain())) {
      return defaultRegistrationDomain;
    } else {
      return job.getRegistrationDomain() + "." + defaultRegistrationDomain;
    }
  }
1075163
public function getSubstitutedDomain()
    {
        $currentHost = $_SERVER['HTTP_HOST'];

        // If there are wildcards in the primary domain (not recommended), make some
        // educated guesses about what to replace them with:
        $domain = preg_replace('/\.\*$/', ".{$currentHost}", $this->Domain);

        // Default to "subsite." prefix for first wildcard
        // TODO Whats the significance of "subsite" in this context?!
        $domain = preg_replace('/^\*\./', "subsite.", $domain);

        // *Only* removes "intermediate" subdomains, so 'subdomain.www.domain.com' becomes 'subdomain.domain.com'
        $domain = str_replace('.www.', '.', $domain);

        return $domain;
    }
292392
public static function domain()
	{
		$arr = self::_getConfigArray();
		array_shift($arr);
		if (is_null($arr))
		{
			$arr = [];
		}

		$domain = implode('.', $arr);
		return $domain;
	}
926154
public static function top_level_domains() {
		if ( empty( self::$top_level_domains_pattern ) ) {
			// Initialize valid top level domains from IANA list.
			self::$top_level_domains_pattern = self::get_top_level_domains_from_file( __DIR__ . '/IANA/tlds-alpha-by-domain.txt' );
		}

		return self::$top_level_domains_pattern;
	}
592926
public function clean($domain)
    {
        $domain = trim($domain);
        $domain = preg_replace('#^https?://#', '', $domain);
        if (substr(strtolower($domain), 0, 4) == "www.") $domain = substr($domain, 4);

        return $domain;
    }
1362309
public function toString() : string
   {

      if ( empty( $this->_subDomainName ) )
      {

         if ( null === $this->_sld )
         {
            return '';
         }

         return $this->_sld->toString();

      }

      if ( null === $this->_sld )
      {
         return $this->_subDomainName;
      }

      return $this->_subDomainName . '.' . $this->_sld->toString();

   }
1095978
public function toRouteDefinition()
    {
        $routes = [];

        foreach ($this->paths as $path) {
            $routes[] = sprintf(
                $this->getTemplate(), $path->verb, $path->path, $this->uses, var_export($path->as, true),
                $this->getMiddleware($path), $this->implodeArray($path->where), var_export($path->domain, true)
            );
        }

        return implode(PHP_EOL.PHP_EOL, $routes);
    }
262272
public function getUrlHost()
    {
        $host = '';
        
        if (!empty($_SERVER['HTTP_FORWARDED'])) {
            extract($this->parseForwardedString($_SERVER['HTTP_FORWARDED']));
        }
        
        if (empty($host)) {
            if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
                $host = $_SERVER['HTTP_X_FORWARDED_HOST'];
            } elseif (!empty($_SERVER['HTTP_HOST'])) {
                $parts = explode(':', $_SERVER['HTTP_HOST']);
                $host = $parts[0];
            } elseif (!empty($_SERVER['SERVER_NAME'])) {
                $host = $_SERVER['SERVER_NAME'];
            } else {
                $host = 'unknown';
            }
        }
        
        return $host;
    }
837615
public function getTld() : ?string 
    {
        if ( ! $this->hasTld()) {
            $this->setTld($this->getDefaultTld());
        }
        return $this->tld;
    }
1276290
public function toString()
   {
      if ( empty( $this->_hostName ) )
      {
         if ( \is_null( $this->_tld ) )
         {
            return '';
         }
         return $this->_tld->toString();
      }
      if ( \is_null( $this->_tld ) )
      {
         return $this->_hostName;
      }
      return $this->_hostName . '.' . $this->_tld->toString();
   }
711327
public static function fullServerName()
    {
        //$protocol = ($_SERVER['SERVER_PORT'] == '443') ? 'https://' : 'http://';
        $protocol = $_SERVER['REQUEST_SCHEME'] . '://';

        if ( isset($_SERVER['HTTP_X_FORWARDED_SERVER']) ) {
            $host = $_SERVER['HTTP_X_FORWARDED_SERVER'];
        } else {
            $host = $_SERVER['SERVER_NAME'] ?? '';
        }

        $port = ($_SERVER['SERVER_PORT'] == 80) ? '' : ":{$_SERVER['SERVER_PORT']}";

        return $protocol . $host . $port;
    }
258171
public function getDomain()
    {
        $current = $this->server['HTTP_HOST'];
        $parts = explode('.', $current);

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

        return $provider . '.' . $zone;
    }
1221039
public function getFullName()
    {
        if ($this->firstName && $this->lastName) {
            return "{$this->firstName} {$this->lastName}";
        } elseif ($this->firstName) {
            return $this->firstName;
        } elseif ($this->lastName) {
            return $this->lastName;
        } else {
            return '';
        }
    }
211694
public function asHeader()
    {
        $header = urlencode($this->name).'='.urlencode((string) $this->value);
        
        if($this->domain !== null) {
            $header.= '; domain='.$this->domain;
        }
        
        if($this->path !== null) {
            $header.= '; path='.$this->path;
        }
        
        if($this->expires !== null) {
            $header.= '; expires=' . gmdate('D, d-M-Y H:i:s e', $this->expires);
        }
        
        if($this->secure) {
            $header.= '; secure';
        }
        
        if($this->httpOnly) {
            $header.= '; HttpOnly';
        }
        
        return $header;
    }
1131096
public function getWebPath()
    {
        $webPath = $this->environment->getCurrentEnvironmentConfig()->get('Domain', false);
        if (!$webPath) {
            $webPath = Request::getInstance()->getCurrentUrl(true)->getDomain() . '/';
        }

        return $webPath;
    }