Mage_Core_Controller_Request_Http
in package
HTTP Request class wrapping Symfony Request
Provides compatibility layer for Mage_Core_Controller_Request_Http while using Symfony HttpFoundation
Table of Contents
Constants
- DEFAULT_HTTP_PORT : mixed = 80
- DEFAULT_HTTPS_PORT : mixed = 443
- SCHEME_HTTP : mixed = 'http'
- SCHEME_HTTPS : mixed = 'https'
- XML_NODE_DIRECT_FRONT_NAMES : mixed = 'global/request/direct_front_name'
Properties
- $_action : string|null
- $_actionKey : string
- $_aliases : array<string|int, mixed>
- Aliases
- $_basePath : string|null
- Base path
- $_baseUrl : string|null
- Base URL
- $_beforeForwardInfo : array<string|int, mixed>
- Request's original information before forward.
- $_controller : string|null
- $_controllerKey : string
- $_controllerModule : string|null
- $_directFrontNames : array<string|int, mixed>|null
- $_dispatched : bool
- Has the action been dispatched?
- $_internallyForwarded : bool
- Flag for recognizing if request internally forwarded
- $_isStraight : bool
- Straight request flag.
- $_module : string|null
- Module/Controller/Action info
- $_moduleKey : string
- Keys for retrieving MCA from params
- $_originalPathInfo : string
- ORIGINAL_PATH_INFO
- $_params : array<string|int, mixed>
- Request parameters
- $_paramSources : array<string|int, mixed>
- Allowed parameter sources
- $_pathInfo : string
- PATH_INFO
- $_rawBody : string|false|null
- Raw request body
- $_requestedRouteName : string|null
- $_requestString : string
- $_requestUri : string|null
- REQUEST_URI
- $_rewritedPathInfo : array<string|int, mixed>|null
- Path info array used before applying rewrite from config
- $_route : string|null
- $_routingInfo : array<string|int, mixed>
- $_storeCode : string|null
- $_storeCodeInPath : bool
- $symfonyRequest : Request
- Symfony Request instance
Methods
- __construct() : mixed
- __get() : mixed
- __isset() : bool
- __set() : void
- clearParams() : self
- get() : mixed
- getActionKey() : string
- getActionName() : string|null
- getAlias() : string|null
- getAliases() : array<string|int, mixed>
- getBasePath() : string
- getBaseUrl() : string
- getBeforeForwardInfo() : array<string|int, mixed>|string|null
- Retrieve property's value which was before _forward call.
- getClientIp() : string|null
- getControllerKey() : string
- getControllerModule() : string|null
- Get module name of currently used controller
- getControllerName() : string|null
- getCookie() : mixed
- getDirectFrontNames() : array<string|int, mixed>
- Get list of front names available with access without store code
- getEnv() : mixed
- getHeader() : string|false
- getHeaders() : array<string|int, mixed>
- Get all headers
- getHost() : string
- Get host from request
- getHttpHost() : false|string
- getInternallyForwarded() : bool
- Checks if request was forwarded internally
- getMethod() : string
- getModuleKey() : string
- getModuleName() : string|null
- getOriginalPathInfo() : string
- getOriginalRequest() : self
- getParam() : mixed
- getParams() : array<string|int, mixed>
- getParamSources() : array<string|int, mixed>
- getPathInfo() : string
- getPost() : mixed
- getQuery() : mixed
- getRawBody() : string|false
- getRequestedActionName() : string|null
- Get action name used in request (ignore rewrite)
- getRequestedControllerName() : string|null
- Get controller name used in request (ignore rewrite)
- getRequestedRouteName() : string|null
- Get route name used in request (ignore rewrite)
- getRequestString() : string
- getRequestUri() : string|null
- getRouteName() : string|null
- getRoutingInfo() : array<string|int, mixed>
- Get routing info
- getScheme() : string
- getServer() : mixed
- getStoreCodeFromPath() : string|null
- getSymfonyRequest() : Request
- Get the Symfony Request instance (for internal use)
- getUserParam() : mixed
- getUserParams() : array<string|int, mixed>
- has() : bool
- initForward() : self
- Collect properties changed by _forward in protected storage before _forward was called first time.
- isAjax() : bool
- Check is Request from AJAX
- isDelete() : bool
- isDirectAccessFrontendName() : bool
- Check if code declared as direct access frontend name this mean what this url can be used without store code
- isDispatched() : bool
- isFlashRequest() : bool
- isGet() : bool
- isHead() : bool
- isOptions() : bool
- isPatch() : bool
- isPost() : bool
- isPut() : bool
- isSecure() : bool
- isStoreCodeInPath() : bool
- Whether the request URI carried a store code prefix that setPathInfo() stripped.
- isStraight() : bool
- Specify/get _isStraight flag value
- isXmlHttpRequest() : bool
- rewritePathInfo() : self
- Specify new path info It happen when occur rewrite based on configuration
- set() : void
- setActionKey() : self
- setActionName() : self
- setAlias() : self
- setBasePath() : self
- setBaseUrl() : self
- setBeforeForwardInfo() : self
- Set before forward info
- setControllerKey() : self
- setControllerModule() : self
- Specify module name where was found currently used controller
- setControllerName() : self
- setDispatched() : self
- setInternallyForwarded() : self
- Define that request was forwarded internally
- setIsStraight() : self
- Set _isStraight flag value
- setModuleKey() : self
- setModuleName() : self
- setOriginalPathInfo() : self
- Set original path info
- setParam() : self
- setParams() : self
- setParamSources() : self
- setPathInfo() : self
- setPost() : self
- setQuery() : self
- setRequestUri() : self
- setRouteName() : self
- setRoutingInfo() : self
- Set routing info data
- setStoreCodeFromPath() : self
- Set store code from path
- _canBeStoreCodeInUrl() : bool
- Check if can be store code as part of url
Constants
DEFAULT_HTTP_PORT
public
mixed
DEFAULT_HTTP_PORT
= 80
DEFAULT_HTTPS_PORT
public
mixed
DEFAULT_HTTPS_PORT
= 443
SCHEME_HTTP
public
mixed
SCHEME_HTTP
= 'http'
SCHEME_HTTPS
public
mixed
SCHEME_HTTPS
= 'https'
XML_NODE_DIRECT_FRONT_NAMES
public
mixed
XML_NODE_DIRECT_FRONT_NAMES
= 'global/request/direct_front_name'
Properties
$_action
protected
string|null
$_action
= \null
$_actionKey
protected
string
$_actionKey
= 'action'
$_aliases
Aliases
protected
array<string|int, mixed>
$_aliases
= []
$_basePath
Base path
protected
string|null
$_basePath
= \null
$_baseUrl
Base URL
protected
string|null
$_baseUrl
= \null
$_beforeForwardInfo
Request's original information before forward.
protected
array<string|int, mixed>
$_beforeForwardInfo
= []
$_controller
protected
string|null
$_controller
= \null
$_controllerKey
protected
string
$_controllerKey
= 'controller'
$_controllerModule
protected
string|null
$_controllerModule
= \null
$_directFrontNames
protected
array<string|int, mixed>|null
$_directFrontNames
= \null
$_dispatched
Has the action been dispatched?
protected
bool
$_dispatched
= \false
$_internallyForwarded
Flag for recognizing if request internally forwarded
protected
bool
$_internallyForwarded
= \false
$_isStraight
Straight request flag.
protected
bool
$_isStraight
= \false
If flag is determined no additional logic is applicable
$_module
Module/Controller/Action info
protected
string|null
$_module
= \null
$_moduleKey
Keys for retrieving MCA from params
protected
string
$_moduleKey
= 'module'
$_originalPathInfo
ORIGINAL_PATH_INFO
protected
string
$_originalPathInfo
= ''
$_params
Request parameters
protected
array<string|int, mixed>
$_params
= []
$_paramSources
Allowed parameter sources
protected
array<string|int, mixed>
$_paramSources
= ['_GET', '_POST']
$_pathInfo
PATH_INFO
protected
string
$_pathInfo
= ''
$_rawBody
Raw request body
protected
string|false|null
$_rawBody
= \null
$_requestedRouteName
protected
string|null
$_requestedRouteName
= \null
$_requestString
protected
string
$_requestString
= ''
$_requestUri
REQUEST_URI
protected
string|null
$_requestUri
= \null
$_rewritedPathInfo
Path info array used before applying rewrite from config
protected
array<string|int, mixed>|null
$_rewritedPathInfo
= \null
$_route
protected
string|null
$_route
= \null
$_routingInfo
protected
array<string|int, mixed>
$_routingInfo
= []
$_storeCode
protected
string|null
$_storeCode
= \null
$_storeCodeInPath
protected
bool
$_storeCodeInPath
= \false
$symfonyRequest
Symfony Request instance
protected
Request
$symfonyRequest
Methods
__construct()
public
__construct([string|Request|null $uri = null ]) : mixed
Parameters
- $uri : string|Request|null = null
__get()
public
__get(string $key) : mixed
Parameters
- $key : string
__isset()
public
__isset(string $key) : bool
Parameters
- $key : string
Return values
bool__set()
public
__set(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
clearParams()
public
clearParams() : self
Return values
selfget()
public
get(string $key) : mixed
Parameters
- $key : string
getActionKey()
public
getActionKey() : string
Return values
stringgetActionName()
public
getActionName() : string|null
Return values
string|nullgetAlias()
public
getAlias(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetAliases()
public
getAliases() : array<string|int, mixed>
Return values
array<string|int, mixed>getBasePath()
public
getBasePath() : string
Return values
stringgetBaseUrl()
public
getBaseUrl([bool $raw = false ]) : string
Parameters
- $raw : bool = false
Return values
stringgetBeforeForwardInfo()
Retrieve property's value which was before _forward call.
public
getBeforeForwardInfo([string|null $name = null ]) : array<string|int, mixed>|string|null
If property was not changed during _forward call null will be returned. If passed name will be null whole state array will be returned.
Parameters
- $name : string|null = null
Return values
array<string|int, mixed>|string|nullgetClientIp()
public
getClientIp([bool $checkProxy = true ]) : string|null
Parameters
- $checkProxy : bool = true
Return values
string|nullgetControllerKey()
public
getControllerKey() : string
Return values
stringgetControllerModule()
Get module name of currently used controller
public
getControllerModule() : string|null
Return values
string|nullgetControllerName()
public
getControllerName() : string|null
Return values
string|nullgetCookie()
public
getCookie([string|null $key = null ][, mixed $default = null ]) : mixed
Parameters
- $key : string|null = null
- $default : mixed = null
getDirectFrontNames()
Get list of front names available with access without store code
public
getDirectFrontNames() : array<string|int, mixed>
Return values
array<string|int, mixed>getEnv()
public
getEnv([string|null $key = null ][, mixed $default = null ]) : mixed
Parameters
- $key : string|null = null
- $default : mixed = null
getHeader()
public
getHeader(string $header) : string|false
Parameters
- $header : string
Return values
string|falsegetHeaders()
Get all headers
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getHost()
Get host from request
public
getHost() : string
Return values
stringgetHttpHost()
public
getHttpHost([bool $trimPort = true ]) : false|string
Parameters
- $trimPort : bool = true
Return values
false|stringgetInternallyForwarded()
Checks if request was forwarded internally
public
getInternallyForwarded() : bool
Return values
boolgetMethod()
public
getMethod() : string
Return values
stringgetModuleKey()
public
getModuleKey() : string
Return values
stringgetModuleName()
public
getModuleName() : string|null
Return values
string|nullgetOriginalPathInfo()
public
getOriginalPathInfo() : string
Return values
stringgetOriginalRequest()
public
getOriginalRequest() : self
Return values
selfgetParam()
public
getParam(string|int|null $key[, mixed $default = null ]) : mixed
Parameters
- $key : string|int|null
- $default : mixed = null
getParams()
public
getParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getParamSources()
public
getParamSources() : array<string|int, mixed>
Return values
array<string|int, mixed>getPathInfo()
public
getPathInfo() : string
Return values
stringgetPost()
public
getPost([string|null $key = null ][, mixed $default = null ]) : mixed
Parameters
- $key : string|null = null
- $default : mixed = null
getQuery()
public
getQuery([string|null $key = null ][, mixed $default = null ]) : mixed
Parameters
- $key : string|null = null
- $default : mixed = null
getRawBody()
public
getRawBody() : string|false
Return values
string|falsegetRequestedActionName()
Get action name used in request (ignore rewrite)
public
getRequestedActionName() : string|null
Return values
string|nullgetRequestedControllerName()
Get controller name used in request (ignore rewrite)
public
getRequestedControllerName() : string|null
Return values
string|nullgetRequestedRouteName()
Get route name used in request (ignore rewrite)
public
getRequestedRouteName() : string|null
Return values
string|nullgetRequestString()
public
getRequestString() : string
Return values
stringgetRequestUri()
public
getRequestUri() : string|null
Return values
string|nullgetRouteName()
public
getRouteName() : string|null
Return values
string|nullgetRoutingInfo()
Get routing info
public
getRoutingInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>getScheme()
public
getScheme() : string
Return values
stringgetServer()
public
getServer([string|null $key = null ][, mixed $default = null ]) : mixed
Parameters
- $key : string|null = null
- $default : mixed = null
getStoreCodeFromPath()
public
getStoreCodeFromPath() : string|null
Return values
string|nullgetSymfonyRequest()
Get the Symfony Request instance (for internal use)
public
getSymfonyRequest() : Request
Return values
RequestgetUserParam()
public
getUserParam(string|int $key[, mixed $default = null ]) : mixed
Parameters
- $key : string|int
- $default : mixed = null
getUserParams()
public
getUserParams() : array<string|int, mixed>
Return values
array<string|int, mixed>has()
public
has(string $key) : bool
Parameters
- $key : string
Return values
boolinitForward()
Collect properties changed by _forward in protected storage before _forward was called first time.
public
initForward() : self
Return values
selfisAjax()
Check is Request from AJAX
public
isAjax() : bool
Return values
boolisDelete()
public
isDelete() : bool
Return values
boolisDirectAccessFrontendName()
Check if code declared as direct access frontend name this mean what this url can be used without store code
public
isDirectAccessFrontendName(string $code) : bool
Parameters
- $code : string
Return values
boolisDispatched()
public
isDispatched() : bool
Return values
boolisFlashRequest()
public
isFlashRequest() : bool
Return values
boolisGet()
public
isGet() : bool
Return values
boolisHead()
public
isHead() : bool
Return values
boolisOptions()
public
isOptions() : bool
Return values
boolisPatch()
public
isPatch() : bool
Return values
boolisPost()
public
isPost() : bool
Return values
boolisPut()
public
isPut() : bool
Return values
boolisSecure()
public
isSecure() : bool
Return values
boolisStoreCodeInPath()
Whether the request URI carried a store code prefix that setPathInfo() stripped.
public
isStoreCodeInPath() : bool
Return values
boolisStraight()
Specify/get _isStraight flag value
public
isStraight([bool|null $flag = null ]) : bool
Parameters
- $flag : bool|null = null
Return values
boolisXmlHttpRequest()
public
isXmlHttpRequest() : bool
Return values
boolrewritePathInfo()
Specify new path info It happen when occur rewrite based on configuration
public
rewritePathInfo(string $pathInfo) : self
Parameters
- $pathInfo : string
Return values
selfset()
public
set(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
setActionKey()
public
setActionKey(string $key) : self
Parameters
- $key : string
Return values
selfsetActionName()
public
setActionName(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetAlias()
public
setAlias(string $name, string $target) : self
Parameters
- $name : string
- $target : string
Return values
selfsetBasePath()
public
setBasePath([string|null $basePath = null ]) : self
Parameters
- $basePath : string|null = null
Return values
selfsetBaseUrl()
public
setBaseUrl([string|null $baseUrl = null ]) : self
Parameters
- $baseUrl : string|null = null
Return values
selfsetBeforeForwardInfo()
Set before forward info
public
setBeforeForwardInfo(array<string|int, mixed> $info) : self
Parameters
- $info : array<string|int, mixed>
Return values
selfsetControllerKey()
public
setControllerKey(string $key) : self
Parameters
- $key : string
Return values
selfsetControllerModule()
Specify module name where was found currently used controller
public
setControllerModule(string $module) : self
Parameters
- $module : string
Return values
selfsetControllerName()
public
setControllerName(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetDispatched()
public
setDispatched([bool $flag = true ]) : self
Parameters
- $flag : bool = true
Return values
selfsetInternallyForwarded()
Define that request was forwarded internally
public
setInternallyForwarded([bool $flag = true ]) : self
Parameters
- $flag : bool = true
Return values
selfsetIsStraight()
Set _isStraight flag value
public
setIsStraight(bool $flag) : self
Parameters
- $flag : bool
Return values
selfsetModuleKey()
public
setModuleKey(string $key) : self
Parameters
- $key : string
Return values
selfsetModuleName()
public
setModuleName(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetOriginalPathInfo()
Set original path info
public
setOriginalPathInfo(string $pathInfo) : self
Parameters
- $pathInfo : string
Return values
selfsetParam()
public
setParam(string|int $key, mixed $value) : self
Parameters
- $key : string|int
- $value : mixed
Return values
selfsetParams()
public
setParams(array<string|int, mixed> $array) : self
Parameters
- $array : array<string|int, mixed>
Return values
selfsetParamSources()
public
setParamSources([array<string|int, mixed> $paramSources = [] ]) : self
Parameters
- $paramSources : array<string|int, mixed> = []
Return values
selfsetPathInfo()
public
setPathInfo([string|null $pathInfo = null ]) : self
Parameters
- $pathInfo : string|null = null
Return values
selfsetPost()
public
setPost(array<string|int, mixed>|string $spec[, mixed $value = null ]) : self
Parameters
- $spec : array<string|int, mixed>|string
- $value : mixed = null
Return values
selfsetQuery()
public
setQuery(array<string|int, mixed>|string $spec[, mixed $value = null ]) : self
Parameters
- $spec : array<string|int, mixed>|string
- $value : mixed = null
Return values
selfsetRequestUri()
public
setRequestUri([string|null $requestUri = null ]) : self
Parameters
- $requestUri : string|null = null
Return values
selfsetRouteName()
public
setRouteName(string $route) : self
Parameters
- $route : string
Return values
selfsetRoutingInfo()
Set routing info data
public
setRoutingInfo(array<string|int, mixed> $data) : self
Parameters
- $data : array<string|int, mixed>
Return values
selfsetStoreCodeFromPath()
Set store code from path
public
setStoreCodeFromPath(string $storeCode) : self
Parameters
- $storeCode : string
Return values
self_canBeStoreCodeInUrl()
Check if can be store code as part of url
protected
_canBeStoreCodeInUrl() : bool