Get the application base url
@return string
@task [ROUTER] gerer https
178611
public function getBaseUrl(bool $withHostName = false):string
    {
        if (!$this->baseUrl) {
            $this->baseUrl = dirname(filter_input(INPUT_SERVER, 'SCRIPT_NAME'));
        }
        return ($withHostName ? self::getHttpHost() : '') . $this->baseUrl;
    }
1132425
protected function getBaseUrl()
    {
        $uri = '';

        $scheme = $this->getScheme();
        if ($scheme !== '') {
            $uri .= $scheme . ':';
        }

        $authority = $this->getAuthority();
        if ($authority !== '' || $scheme === 'file') {
            $uri .= '//' . $authority;
        }

        return $uri;
    }
329120
public function getUrl()
    {
        $protocol = strpos(strtolower($this->PATH_INFO), 'https') === false ? 'http' : 'https';

        return $protocol . '://' . $this->getHost();
    }
365910
public static function getBaseUrl()
    {
        $protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
        $url = $protocol . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];

        // cut at last '/' (we dont want to see index.php)
        return substr($url, 0, strrpos($url, '/'));
    }
299120
public static function baseURL()
    {
        // Check override base_url
        $alternate = self::config()->get('alternate_base_url');
        if ($alternate) {
            $alternate = Injector::inst()->convertServiceProperty($alternate);
            return rtrim(parse_url($alternate, PHP_URL_PATH), '/') . '/';
        }

        // Get env base url
        $baseURL = rtrim(BASE_URL, '/') . '/';

        // Check if BASE_SCRIPT_URL is defined
        // e.g. `index.php/`
        if (defined('BASE_SCRIPT_URL')) {
            return $baseURL . BASE_SCRIPT_URL;
        }

        return $baseURL;
    }
990578
public function baseUrl()
    {
        if (!$this->baseUrl) {
            $this->baseUrl = $this->request->getScheme()
                . '://' . $this->request->getHttpHost();
        }
        return $this->baseUrl;
    }
545535
static function BaseUrl()
    {
        $port = self::Port();
        
        $result =  self::Protocol() . '://' . self::Host();
        if ($port != 80 && $port != 443)
        {
            $result .= ':' . $port;
        }
        return $result;
    }
248020
protected function defaultBaseAuthUrl()
    {
        $baseAuthUrl = [
            Yii::$app->controller->getRoute()
        ];
        $params = $_GET;
        unset($params[$this->clientIdGetParamName]);
        $baseAuthUrl = array_merge($baseAuthUrl, $params);

        return $baseAuthUrl;
    }
1217473
public static function getUrl()
    {
        if (static::isCLI()) {
            return null;
        }

        if (static::$url === null) {
            $url = 'http';
            if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
                $url .= 's';
            }
            $url .= '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            static::$url = new Url($url);
        }

        return static::$url;
    }
734052
public function getPazpar2BaseURL()
    {
        $URL = 'http://' . GeneralUtility::getIndpEnv('HTTP_HOST') . $this->getPazpar2Path();
        if ($this->pazpar2BaseURL) {
            $URL = $this->pazpar2BaseURL;
        }
        return $URL;
    }
1303880
public function getBaseUrl()
    {
        if ($this->external == false) {
            return $this->baseUrl = Url::getBase();
        }

        return $this->baseUrl;
    }
1366027
public function getBaseAuthorizationUrl()
    {
        $base = new Uri($this->authUrl);
        $path = new Uri('/authorization');
        return (string) UriResolver::resolve($base, $path);
        ;
    }
1327647
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;
	}
362359
public function getBaseUri()
    {
        $script = $this->get('script');
        $base   = str_replace('\\', '/', dirname($script));

        if ($base != '/') {
            $url = strtolower($this->get('scheme')) . $this->get('name') . $base;
        } else {
            $url = strtolower($this->get('scheme')) . $this->get('name');
        }

        return $url;
    }
1225172
private static function getBaseUrl()
    {
        if (isset($_SERVER['SERVER_NAME'])) {
            $sProtocol = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])
                == 'on' ? 'https' : 'http';
            return $sProtocol.'://'.$_SERVER['SERVER_NAME'];
        }
        return null;
    }
504481
public static function getBaseUrl() : string
    {
        $https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://';

        return $https . rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/');
    }
814489
public function url()
    {
        if ($this->type === self::FORGOT_PASSWORD) {
            return $this->getApp()['base_url'].'users/forgot/'.$this->link;
        } else if ($this->type === self::TEMPORARY) {
            return $this->getApp()['base_url'].'users/signup/'.$this->link;
        }

        return false;
    }