src/mako/http/Request.php
public function getBaseURL(): string
	{
		if($this->baseURL === null)
		{
			// Get the protocol

			$protocol = $this->isSecure() ? 'https://' : 'http://';

			// Get the server name and port

			if(($host = $this->server->get('HTTP_HOST')) === null)
			{
				$host = $this->server->get('SERVER_NAME');

				$port = $this->server->get('SERVER_PORT');

				if($port !== null && $port != 80)
				{
					$host = $host . ':' . $port;
				}
			}

			// Put them all together along with the base path

			$this->baseURL = $protocol . $host . $this->getBasePath();
		}

		return $this->baseURL;
	}
public function getBaseURL(): string
	{
		if($this->baseURL === null)
		{
			// Get the protocol

			$protocol = $this->isSecure() ? 'https://' : 'http://';

			// Get the server name and port

			if(($host = $this->server->get('HTTP_HOST')) === null)
			{
				$host = $this->server->get('SERVER_NAME');

				$port = $this->server->get('SERVER_PORT');

				if($port !== null && $port != 80)
				{
					$host = $host . ':' . $port;
				}
			}

			// Put them all together along with the base path

			$this->baseURL = $protocol . $host . $this->getBasePath();
		}

		return $this->baseURL;
	}
public function getBaseURL ( ) : string { if ( $ this -> baseURL === null ) { // Get the protocol $ protocol = $ this -> isSecure ( ) ? 'https://' : 'http://' ; // Get the server name and port if ( ( $ host = $ this -> server -> get ( 'HTTP_HOST' ) ) === null ) { $ host = $ this -> server -> get ( 'SERVER_NAME' ) ; $ port = $ this -> server -> get ( 'SERVER_PORT' ) ; if ( $ port !== null && $ port != 80 ) { $ host = $ host . ':' . $ port ; } } // Put them all together along with the base path $ this -> baseURL = $ protocol . $ host . $ this -> getBasePath ( ) ; } return $ this -> baseURL ; }
Returns the base url of the request.

@return string
Returns the base url of the request .