core/model/modx/modconnectorrequest.class.php
modConnectorRequest
- Package
- modx
\modConnectorRequest
This is the Connector Request handler for MODX.
It serves to redirect connector requests to their appropriate processors, while validating for security.
- Parent(s)
- \modManagerRequest < \modRequest
Properties
string
$action= 'null'
null
Details- Type
- string
- Access
- public
- Inherited_from
- \modManagerRequest::$$action
string
$actionVar= ''a''
'a'
Details- Type
- string
- Access
- public
- Inherited_from
- \modManagerRequest::$$actionVar
mixed
$defaultAction= '0'
0
Details- Type
- mixed
- Access
- public
- Inherited_from
- \modManagerRequest::$$defaultAction
\modError
$error= 'null'
null
Details- Type
- \modError
- Access
- public
- Inherited_from
- \modManagerRequest::$$error
array
$headers= 'null'
The HTTP headers sent in the request
Inherited from: \modRequest::$$headers\modManagerRequest::$$headersnull
Details- Type
- array
- Inherited_from
- \modRequest::$$headers
- Inherited_from
- \modManagerRequest::$$headers
string
$location= ''
The base subdirectory location of the requested action.
- Type
- string
- Access
- public
string
$method= 'null'
The current request method
Inherited from: \modRequest::$$method\modManagerRequest::$$methodnull
Details- Type
- string
- Inherited_from
- \modRequest::$$method
- Inherited_from
- \modManagerRequest::$$method
\modX
$modx= 'null'
A reference to the modX object
Inherited from: \modRequest::$$modx\modManagerRequest::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modRequest::$$modx
- Inherited_from
- \modManagerRequest::$$modx
array
$parameters= 'null'
The parameters sent in the request
Inherited from: \modRequest::$$parameters\modManagerRequest::$$parametersnull
Details- Type
- array
- Inherited_from
- \modRequest::$$parameters
- Inherited_from
- \modManagerRequest::$$parameters
Methods
__construct(
\modX $modx
)
:
\modManagerRequest
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()\modManagerRequest::_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()\modManagerRequest::checkPublishStatus()getActionIDs(
array $actions
=
array(), string $namespace
=
'core'
)
:
array
Get the IDs for a collection of string action keys
Inherited from: \modRequest::getActionIDs()\modManagerRequest::getActionIDs()Name | Type | Description |
---|---|---|
$actions | array | |
$namespace | string |
Type | Description |
---|---|
array |
getAllActionIDs(
string $namespace
=
''
)
:
array
Get a list of all modAction IDs
Inherited from: \modRequest::getAllActionIDs()\modManagerRequest::getAllActionIDs()Name | Type | Description |
---|---|---|
$namespace | string |
Type | Description |
---|---|
array |
getClientIp(
)
:
array
Get the true client IP. Returns an array of values:
Inherited from: \modRequest::getClientIp()\modManagerRequest::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
Return the HTTP headers sent through the request
Inherited from: \modRequest::getHeaders()\modManagerRequest::getHeaders()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()\modManagerRequest::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()\modManagerRequest::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()\modManagerRequest::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()\modManagerRequest::getResourceMethod()Type | Description |
---|---|
string | 'alias', 'id', or an empty string. |
handleRequest(
array $options
=
array()
)
:
boolean
Handles all requests specified by the action param and prepares for loading.
Name | Type | Description |
---|---|---|
$options | array | An array of request options |
Type | Description |
---|---|
boolean |
- Access
- public
initialize(
)
:
bool
Initializes the connector request, loading the proper context, culture and lexicon; also loads the action map
Type | Description |
---|---|
bool |
loadActionMap(
)
:
boolean
Loads the actionMap, and generates a cache file if necessary.
Inherited from: \modManagerRequest::loadActionMap()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.
Inherited from: \modManagerRequest::loadErrorHandler()Name | Type | Description |
---|---|---|
$class | string |
prepareResponse(
array $options
=
array()
)
:
boolean
Prepares the output with the specified processor.
Name | Type | Description |
---|---|---|
$options | array | An array of options |
Type | Description |
---|---|
boolean | True if the response is properly prepared. |
preserveRequest(
string $key
=
'referrer'
)
:
void
Preserves the $_REQUEST superglobal to the $_SESSION.
Inherited from: \modRequest::preserveRequest()\modManagerRequest::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()\modManagerRequest::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()\modManagerRequest::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()\modManagerRequest::sanitizeRequest()