Raydium Framework

HostManager
in package
implements HostInterface

Interfaces, Classes, Traits and Enums

HostInterface

Table of Contents

get_http_host()  : string
Retrieves the sanitized HTTP host if available, otherwise a default value.
get_request_url()  : string
Constructs the full request URL based on the current protocol and app host.
get_server_host()  : array<string|int, false|string>
Extracts the host domain and determines the protocol prefix.
is_https_secure()  : bool
Determines if the current request is made over HTTPS.
sanitize_http_host()  : null|string
Sanitizes the HTTP host.

Methods

get_http_host()

Retrieves the sanitized HTTP host if available, otherwise a default value.

public get_http_host() : string
Return values
string

The sanitized host name or a default value.

get_request_url()

Constructs the full request URL based on the current protocol and app host.

public get_request_url() : string
Return values
string

The full request URL or null if the app host is not available.

get_server_host()

Extracts the host domain and determines the protocol prefix.

public get_server_host() : array<string|int, false|string>
Tags
psalm-return

array{prefix: 'http'|'https', domain: false|string}

Return values
array<string|int, false|string>

An associative array with 'prefix' (protocol) and 'domain' (host domain).

is_https_secure()

Determines if the current request is made over HTTPS.

public is_https_secure() : bool
Return values
bool

True if the request is over HTTPS, false otherwise.

sanitize_http_host()

Sanitizes the HTTP host.

protected sanitize_http_host(string $httpHost) : null|string
Parameters
$httpHost : string

The HTTP host to sanitize.

Return values
null|string

The sanitized host or null if invalid.

Search results