HostManager
in package
implements
HostInterface
Interfaces, Classes, Traits and Enums
Table of Contents
- getHttpHost() : string
- Retrieves the sanitized HTTP host if available, otherwise a default value.
- getRequestUrl() : string
- Constructs the full request URL based on the current protocol and app host.
- getServerHost() : array<string|int, false|string>
- Extracts the host domain and determines the protocol prefix.
- isHttpsSecure() : bool
- Determines if the current request is made over HTTPS.
- sanitizeHttpHost() : null|string
- Sanitizes the HTTP host.
Methods
getHttpHost()
Retrieves the sanitized HTTP host if available, otherwise a default value.
public
getHttpHost() : string
Return values
string —The sanitized host name or a default value.
getRequestUrl()
Constructs the full request URL based on the current protocol and app host.
public
getRequestUrl() : string
Return values
string —The full request URL or null if the app host is not available.
getServerHost()
Extracts the host domain and determines the protocol prefix.
public
getServerHost() : array<string|int, false|string>
Tags
Return values
array<string|int, false|string> —An associative array with 'prefix' (protocol) and 'domain' (host domain).
isHttpsSecure()
Determines if the current request is made over HTTPS.
public
isHttpsSecure() : bool
Return values
bool —True if the request is over HTTPS, false otherwise.
sanitizeHttpHost()
Sanitizes the HTTP host.
protected
sanitizeHttpHost(string $httpHost) : null|string
Parameters
- $httpHost : string
-
The HTTP host to sanitize.
Return values
null|string —The sanitized host or null if invalid.