core/model/modx/modmanagerrequest.class.php
modManagerRequest
- Package
- modx
\modManagerRequest
Encapsulates the interaction of MODX manager with an HTTP request.
This class represents the functional portion of the MODX {@link http://www.martinfowler.com/eaaCatalog/frontController.html front- controller}, and is responsible for sanitizing, interpretting, and dispatching a web request to the appropriate MODX {@link modResource Web Resource}.
- Parent(s)
- \modRequest
- Children
- \modConnectorRequest
Properties
string
$actionVar= ''a''
'a'
Details- Type
- string
- Access
- public
mixed
$defaultAction= '0'
0
Details- Type
- mixed
- Access
- public
\modError
$error= 'null'
null
Details- Type
- \modError
- Access
- public
- Deprecated
- 2.0.0 Use $modx->error instead.
array
$parameters= 'null'
null
Details- Type
- array
- Inherited_from
- \modRequest::$$parameters
Methods
__construct(
\modX $modx
)
:
\modManagerRequest
Instantiates a modManagerRequest object.
Name | Type | Description |
---|---|---|
$modx | \modX |
Type | Description |
---|---|
\modManagerRequest |
_cleanResourceIdentifier(
string $identifier
)
:
string | integer
Cleans the resource identifier from the request params.
Inherited from: \modRequest::_cleanResourceIdentifier()Name | Type | Description |
---|---|---|
$identifier | string | The raw identifier. |
Type | Description |
---|---|
string | integer | The cleansed identifier. |
checkPublishStatus(
)
:
void
Checks the current status of timed publishing events.
Inherited from: \modRequest::checkPublishStatus()getActionIDs(
array $actions
=
array(), string $namespace
=
'core'
)
:
array
Get the IDs for a collection of string action keys
Inherited from: \modRequest::getActionIDs()Name | Type | Description |
---|---|---|
$actions | array | |
$namespace | string |
Type | Description |
---|---|
array |
getAllActionIDs(
string $namespace
=
''
)
:
array
Name | Type | Description |
---|---|---|
$namespace | string |
Type | Description |
---|---|
array |
getClientIp(
)
:
array
Get the true client IP. Returns an array of values:
Inherited from: \modRequest::getClientIp()- ip - The real, true client IP
- suspected - The suspected IP, if not alike to REMOTE_ADDR
- network - The client's network IP
Type | Description |
---|---|
array |
- Access
- public
getHeaders(
boolean $ucKeys
=
false
)
:
array
Name | Type | Description |
---|---|---|
$ucKeys | boolean | if true, upper-case all keys for the headers |
Type | Description |
---|---|
array |
getParameters(
string | array $keys
=
array(), string $type
=
'GET'
)
:
mixed
Get a GPC/REQUEST variable value or an array of values from the request.
Inherited from: \modRequest::getParameters()Name | Type | Description |
---|---|---|
$keys | string | array | A key or array of keys to retrieve from the GPC variable. An empty array means get all keys of the variable. |
$type | string | The type of GPC variable, GET by default (GET, POST, COOKIE or REQUEST). |
Type | Description |
---|---|
mixed |
getResource(
string $method, string | integer $identifier, array $options
=
array()
)
:
\modResource
Gets a requested resource and all required data.
Inherited from: \modRequest::getResource()Name | Type | Description |
---|---|---|
$method | string | The method, 'id', or 'alias', by which to perform the resource lookup. |
$identifier | string | integer | The identifier with which to search. |
$options | array | An array of options for the resource fetching |
Type | Description |
---|---|
\modResource | The requested modResource instance or request is forwarded to the error page, or unauthorized page. |
getResourceIdentifier(
string $method
)
:
string
Gets the idetifier used to request a resource.
Inherited from: \modRequest::getResourceIdentifier()Name | Type | Description |
---|---|---|
$method | string | 'alias' or 'id'. |
Type | Description |
---|---|
string | The identifier for the requested resource. |
getResourceMethod(
)
:
string
Gets the method used to request a resource.
Inherited from: \modRequest::getResourceMethod()Type | Description |
---|---|
string | 'alias', 'id', or an empty string. |
handleRequest(
)
:
boolean
The primary MODX manager request handler (a.k.a. controller).
Type | Description |
---|---|
boolean | True if a request is handled without interruption. |
- Access
- public
initialize(
)
:
boolean
Initializes the manager request.
Type | Description |
---|---|
boolean | True if successful. |
- Access
- public
loadActionMap(
)
:
boolean
Loads the actionMap, and generates a cache file if necessary.
Type | Description |
---|---|
boolean | True if successful. |
- Access
- public
loadErrorHandler(
string $class
=
'modError'
)
:
void
This implementation adds register logging capabilities via $_POST vars when the error handler is loaded.
Name | Type | Description |
---|---|---|
$class | string |
prepareResponse(
array $options
=
array()
)
:
boolean
Prepares the MODX response to a mgr request that is being handled.
Name | Type | Description |
---|---|---|
$options | array | An array of options |
Type | Description |
---|---|
boolean | True if the response is properly prepared. |
- Access
- public
preserveRequest(
string $key
=
'referrer'
)
:
void
Preserves the $_REQUEST superglobal to the $_SESSION.
Inherited from: \modRequest::preserveRequest()Name | Type | Description |
---|---|---|
$key | string | A key to save the $_REQUEST as; default is 'referrer'. |
registerLogging(
array $options
=
array()
)
:
void
Provides an easy way to initiate register logging.
Inherited from: \modRequest::registerLogging()Through an array of options, you can have all calls to modX::log() recorded in a topic of a modRegister instance. The options include:
- register: the name of the register (required)
- topic: the topic to record to (required)
- register_class: the modRegister class (defaults to modFileRegister)
- log_level: the logging level (defaults to MODX_LOG_LEVEL_INFO)
Name | Type | Description |
---|---|---|
$options | array | An array containing all the options required to initiate and configure logging to a modRegister instance. |
retrieveRequest(
string $key
=
'referrer'
)
:
string
Retrieve a preserved $_REQUEST from $_SESSION.
Inherited from: \modRequest::retrieveRequest()Name | Type | Description |
---|---|---|
$key | string | A key to identify a specific $_REQUEST; default is 'referrer'. |
Type | Description |
---|---|
string |
sanitizeRequest(
)
:
void
Harden GPC variables by removing any MODX tags, Javascript, or entities.
Inherited from: \modRequest::sanitizeRequest()