HttpContext extends Context
Class HttpContext extends Context with http specific methods.
Table of Contents
Constants
- CACHE_TTL = 86400
Methods
- __construct() : mixed
- Creates new instance of context.
- getApplication() : Application
- Returns backreference to Application.
- getCulture() : Culture|null
- Returns culture of the context.
- getCurrent() : Context
- Static method returns current instance of context.
- getEnvironment() : mixed
- getLanguage() : string|null
- Returns current language ID (en, ru).
- getLanguageObject() : EO_Language|null
- Returns current language object.
- getRequest() : Request|HttpRequest
- Returns request object of the context.
- getResponse() : Response|HttpResponse
- Returns response object of the context.
- getServer() : Server
- Returns server object of the context.
- getSite() : string
- Returns current site
- getSiteObject() : EO_Site|null
- Returns current language object.
- initialize() : mixed
- Initializes context by request and response objects.
- initializeCulture() : void
- rewriteUri() : mixed
- setCulture() : $this
- Sets culture of the context.
- setLanguage() : $this
- Sets language of the context.
- setResponse() : $this
- Sets response of the context.
- setSite() : $this
- Sets site of the context.
- transferUri() : mixed
Constants
CACHE_TTL
public
mixed
CACHE_TTL
= 86400
Methods
__construct()
Creates new instance of context.
public
__construct(HttpApplication $application) : mixed
Parameters
- $application : HttpApplication
getApplication()
Returns backreference to Application.
public
getApplication() : Application
Return values
ApplicationgetCulture()
Returns culture of the context.
public
getCulture() : Culture|null
Return values
Culture|nullgetCurrent()
Static method returns current instance of context.
public
static getCurrent() : Context
Tags
Return values
ContextgetEnvironment()
public
getEnvironment() : mixed
getLanguage()
Returns current language ID (en, ru).
public
getLanguage() : string|null
Return values
string|nullgetLanguageObject()
Returns current language object.
public
getLanguageObject() : EO_Language|null
Return values
EO_Language|nullgetRequest()
Returns request object of the context.
public
getRequest() : Request|HttpRequest
Return values
Request|HttpRequestgetResponse()
Returns response object of the context.
public
getResponse() : Response|HttpResponse
Return values
Response|HttpResponsegetServer()
Returns server object of the context.
public
getServer() : Server
Return values
ServergetSite()
Returns current site
public
getSite() : string
Return values
stringgetSiteObject()
Returns current language object.
public
getSiteObject() : EO_Site|null
Return values
EO_Site|nullinitialize()
Initializes context by request and response objects.
public
initialize(Request $request, Response $response, Server $server[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
initializeCulture()
public
initializeCulture([string|null $definedSite = null ][, string|null $definedLanguage = null ]) : void
Parameters
- $definedSite : string|null = null
- $definedLanguage : string|null = null
Tags
rewriteUri()
public
rewriteUri(mixed $url, mixed $queryString[, mixed $redirectStatus = null ]) : mixed
Parameters
- $url : mixed
- $queryString : mixed
- $redirectStatus : mixed = null
setCulture()
Sets culture of the context.
public
setCulture(Culture $culture) : $this
Parameters
- $culture : Culture
Return values
$thissetLanguage()
Sets language of the context.
public
setLanguage(string|EO_Language $language) : $this
Parameters
- $language : string|EO_Language
Return values
$thissetResponse()
Sets response of the context.
public
setResponse(Response $response) : $this
Parameters
- $response : Response
-
Response.
Return values
$thissetSite()
Sets site of the context.
public
setSite(string|EO_Site $site) : $this
Parameters
- $site : string|EO_Site
Return values
$thistransferUri()
public
transferUri(mixed $url, mixed $queryString) : mixed
Parameters
- $url : mixed
- $queryString : mixed