src/Control/Director.php
public static function is_https(HTTPRequest $request = null)
    {
        // Check override from alternate_base_url
        if ($baseURL = self::config()->uninherited('alternate_base_url')) {
            $baseURL = Injector::inst()->convertServiceProperty($baseURL);
            $protocol = parse_url($baseURL, PHP_URL_SCHEME);
            if ($protocol) {
                return $protocol === 'https';
            }
        }

        // Check the current request
        $request = static::currentRequest($request);
        if ($request && ($scheme = $request->getScheme())) {
            return $scheme === 'https';
        }

        // Check default_base_url
        if ($baseURL = self::config()->uninherited('default_base_url')) {
            $baseURL = Injector::inst()->convertServiceProperty($baseURL);
            $protocol = parse_url($baseURL, PHP_URL_SCHEME);
            if ($protocol) {
                return $protocol === 'https';
            }
        }

        return false;
    }
public static function is_https(HTTPRequest $request = null)
    {
        // Check override from alternate_base_url
        if ($baseURL = self::config()->uninherited('alternate_base_url')) {
            $baseURL = Injector::inst()->convertServiceProperty($baseURL);
            $protocol = parse_url($baseURL, PHP_URL_SCHEME);
            if ($protocol) {
                return $protocol === 'https';
            }
        }

        // Check the current request
        $request = static::currentRequest($request);
        if ($request && ($scheme = $request->getScheme())) {
            return $scheme === 'https';
        }

        // Check default_base_url
        if ($baseURL = self::config()->uninherited('default_base_url')) {
            $baseURL = Injector::inst()->convertServiceProperty($baseURL);
            $protocol = parse_url($baseURL, PHP_URL_SCHEME);
            if ($protocol) {
                return $protocol === 'https';
            }
        }

        return false;
    }
public static function is_https ( HTTPRequest $ request = null ) { // Check override from alternate_base_url if ( $ baseURL = self :: config ( ) -> uninherited ( 'alternate_base_url' ) ) { $ baseURL = Injector :: inst ( ) -> convertServiceProperty ( $ baseURL ) ; $ protocol = parse_url ( $ baseURL , PHP_URL_SCHEME ) ; if ( $ protocol ) { return $ protocol === 'https' ; } } // Check the current request $ request = static :: currentRequest ( $ request ) ; if ( $ request && ( $ scheme = $ request -> getScheme ( ) ) ) { return $ scheme === 'https' ; } // Check default_base_url if ( $ baseURL = self :: config ( ) -> uninherited ( 'default_base_url' ) ) { $ baseURL = Injector :: inst ( ) -> convertServiceProperty ( $ baseURL ) ; $ protocol = parse_url ( $ baseURL , PHP_URL_SCHEME ) ; if ( $ protocol ) { return $ protocol === 'https' ; } } return false ; }
Return whether the site is running as under HTTPS.

@param HTTPRequest $request
@return bool
Return whether the site is running as under HTTPS .