Calculate the length of the host part of the URL.

@return int
545272
private function getHostLength()
    {
        $hostLength = strpos($this->url, '/');
        $hostLength = (false === $hostLength) ? strlen($this->url) : $hostLength;

        return $hostLength;
    }
112938
public function getContentLength(): ?int
    {
        $result = $this->getRequest()->getHeader('Content-Length');

        return $result ? (int) $result[0] : null;
    }
1225911
public function domain($tldLength = 1)
    {
        $segments = explode('.', $this->host());
        $domain = array_slice($segments, -1 * ($tldLength + 1));

        return implode('.', $domain);
    }
682481
public function getContentLength()
    {
        $length = $this->body->getContentLength();

        return $length === false
            ? $this->limit
            : min($this->limit, min($length, $this->offset + $this->limit) - $this->offset);
    }
1250975
public function getDirLevel()
	{
		if (!trim($this->getPath()))
		{
			return 0;
		}

		$dirParts = explode('/', $this->getPath());

		return count($dirParts);
	}
860468
public function getFullRef()
    {
        $config = SiteConfig::current_site_config();
        $length = $config->OrderNumberLength;
        $prefix = ($this->Prefix) ? $this->Prefix : "";
        $return = str_pad($this->Ref, $length, "0", STR_PAD_LEFT);

        // Work out if an order prefix string has been set
        if ($prefix) {
            $return = $prefix . '-' . $return;
        }

        return $return;
    }
901417
public function getPort(): int
    {
        if (!isset($this->segments['port'])) {
            throw new UrlException('Unable to get port for ' . $this->url);
        }

        return (int)$this->segments['port'];
    }
970786
public function minLength()
    {
        if ($this->minLength === null) {
            $this->minLength = $this->defaultMinLength();
        }

        return $this->minLength;
    }
779916
public function getLength()
    {
        $length = $this->length64;

        if ($length == 0) {
            $length = $this->length16;
        }

        if ($length == 0) {
            $length = $this->length;
        }

        return $length;
    }
1198839
public static function getHost()
    {
        $host = '';
        if (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && $host = $_SERVER['HTTP_X_FORWARDED_HOST']) {
            $elements = explode(',', $host);
            $host     = trim(end($elements));
        } else {
            if (isset($_SERVER['HTTP_HOST']) && !$host = $_SERVER['HTTP_HOST']) {
                if (isset($_SERVER['SERVER_NAME']) && !$host = $_SERVER['SERVER_NAME']) {
                    $host = !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '';
                }
            }
        }
        // Remove port number from host
        $host = preg_replace('/:\d+$/', '', $host);

        return trim($host);
    }
155630
public function getMinHost()
    {
        if ($this->network_size === 32 || $this->network_size === 31) {
            return $this->ip_address;
        }
        return $this->minHostCalculation(self::FORMAT_QUADS, '.');
    }
1023241
public function getLength()
    {
        return in_array($this->schema, $this->lengthSchemas, true) ? $this->size : null;
    }
196425
protected function getAdjustedKeyLength()
	{
		return $this->length - intval(strlen($this->prefix) + strlen($this->suffix));
	}
150102
public function size() : int
    {
        if ($this->bufSize == null) {
            $this->bufSize = strlen($this->buf);
        }
        return $this->bufSize;
    }
1328064
public static function getHostUri()
  {
    $sheme = (self::getHostParam("HTTPS") == "on") ? "https" : "http";

    $serverName = new Str(self::getHostParam("HTTP_HOST"));
    $serverPort = self::getHostParam("SERVER_PORT");
    $serverPort = ($serverPort != 80 && $serverPort != 443) ? ":" . $serverPort : "";

    if($serverName->endsWith($serverPort))
    {
      $serverName = $serverName->replace($serverPort, "");
    }

    return new Str($sheme . "://" . $serverName . $serverPort);
  }
1073433
public function getLength()
    {
        if (!$this->stub && !is_int($this->length)) {
            $this->length = strlen($this->data);
        }

        return $this->length;
    }
189870
private String hostAndPort() {
        int start = url.indexOf("://") + 3;
        int end = url.indexOf("/", start);
        return url.substring(start, end);
    }