public static function getSiteUrl()
    {
        if (!self::hasServerVariable('HTTP_HOST')) {
            return null;
        }
        
        $protocol = (self::looksLikeHttps()) ? 'https' : 'http';
        $port = self::getServerVariable('SERVER_PORT', 80);
        
        list ($host) = explode(':', self::getServerVariable('HTTP_HOST'));
        
        if (!in_array($port, [
            80,
            443
        ]) || ($protocol != 'https' && $port == 443)) {
            $host .= ':' . $port;
        }
        
        $fullUrl = $protocol . '://' . $host . '/';
        if (USE_INDEX_FILE) {
            $fullUrl .= 'index.php/';
        }
        
        return $fullUrl;
    }
public static function getSiteUrl()
    {
        if (!self::hasServerVariable('HTTP_HOST')) {
            return null;
        }
        
        $protocol = (self::looksLikeHttps()) ? 'https' : 'http';
        $port = self::getServerVariable('SERVER_PORT', 80);
        
        list ($host) = explode(':', self::getServerVariable('HTTP_HOST'));
        
        if (!in_array($port, [
            80,
            443
        ]) || ($protocol != 'https' && $port == 443)) {
            $host .= ':' . $port;
        }
        
        $fullUrl = $protocol . '://' . $host . '/';
        if (USE_INDEX_FILE) {
            $fullUrl .= 'index.php/';
        }
        
        return $fullUrl;
    }
public static function getSiteUrl ( ) { if ( ! self :: hasServerVariable ( 'HTTP_HOST' ) ) { return null ; } $ protocol = ( self :: looksLikeHttps ( ) ) ? 'https' : 'http' ; $ port = self :: getServerVariable ( 'SERVER_PORT' , 80 ) ; list ( $ host ) = explode ( ':' , self :: getServerVariable ( 'HTTP_HOST' ) ) ; if ( ! in_array ( $ port , [ 80 , 443 ] ) || ( $ protocol != 'https' && $ port == 443 ) ) { $ host .= ':' . $ port ; } $ fullUrl = $ protocol . '://' . $ host . '/' ; if ( USE_INDEX_FILE ) { $ fullUrl .= 'index.php/' ; } return $ fullUrl ; }
Getthe base url of the site opened with the current request.

@return string The base url of the site opened with the current request.
Getthe base url of the site opened with the current request .