public function getHost() { $host = parse_url($this->getUrl(), PHP_URL_HOST); if ($port = parse_url($this->getUrl(), PHP_URL_PORT)) { $host .= ':' . $port; } return $host; }