jServer
in package
Static class providing some utilities to retrieve informations about the server.
Tags
Table of Contents
- $domainPortCache : mixed
- getDomainName() : string
- return the application domain name.
- getDomainPortFromServer() : array<string|int, mixed>
- Return the domain and the port from the server parameters.
- getPort() : string
- return the server port of the application.
- getProtocol() : string
- return the protocol.
- getServerURI() : string
- return the server URI of the application (protocol + server name + port).
- isCLI() : bool
- tells if we are in a CLI (Command Line Interface) context or not.
- isHttps() : bool
- Indicate if the request is done or should be done with HTTPS,.
- isHttpsFromServer() : mixed
- Indicate if the request is done with HTTPS, as indicated by the server parameters.
Properties
$domainPortCache
protected
static mixed
$domainPortCache
Tags
Methods
getDomainName()
return the application domain name.
public
static getDomainName() : string
Tags
Return values
string —getDomainPortFromServer()
Return the domain and the port from the server parameters.
public
static getDomainPortFromServer([bool $cache = true ]) : array<string|int, mixed>
Parameters
- $cache : bool = true
Tags
Return values
array<string|int, mixed> —the domain and the port number
getPort()
return the server port of the application.
public
static getPort([null|mixed $forceHttps = null ]) : string
Parameters
- $forceHttps : null|mixed = null
Tags
Return values
string —the ":port" or empty string
getProtocol()
return the protocol.
public
static getProtocol() : string
Tags
Return values
string —http:// or https://
getServerURI()
return the server URI of the application (protocol + server name + port).
public
static getServerURI([null|mixed $forceHttps = null ]) : string
Parameters
- $forceHttps : null|mixed = null
Tags
Return values
string —the serveur uri
isCLI()
tells if we are in a CLI (Command Line Interface) context or not.
public
static isCLI() : bool
If this is the case, fills some missing $_SERVER variables when cgi is used.
Tags
Return values
bool —true if we are in a CLI context
isHttps()
Indicate if the request is done or should be done with HTTPS,.
public
static isHttps() : bool
It takes care about the Jelix configuration, else from the server parameters.
Tags
Return values
bool —true if the request is done or should be done with HTTPS
isHttpsFromServer()
Indicate if the request is done with HTTPS, as indicated by the server parameters.
public
static isHttpsFromServer() : mixed