core/model/modx/modconnectorrequest.class.php

Show: inherited
Table of Contents

modConnectorRequest

Package
modx  

\modConnectorRequest

Package: modx

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

Propertypublicstring  $action= 'null'
inherited

The action to load.Inherited from: \modManagerRequest::$$action
Default valuenullDetails
Type
string
Access
public  
Inherited_from
\modManagerRequest::$$action  
Propertypublicstring  $actionVar= ''a''
inherited

The REQUEST parameter to load actions by.Inherited from: \modManagerRequest::$$actionVar
Default value'a'Details
Type
string
Access
public  
Inherited_from
\modManagerRequest::$$actionVar  
Propertypublicmixed  $defaultAction= '0'
inherited

The default action to load from.Inherited from: \modManagerRequest::$$defaultAction
Default value0Details
Type
mixed
Access
public  
Inherited_from
\modManagerRequest::$$defaultAction  
Propertypublic\modError  $error= 'null'
inherited

The error handler for the request.Inherited from: \modManagerRequest::$$error
Default valuenullDetails
Type
\modError
Access
public  
Inherited_from
\modManagerRequest::$$error  
Propertypublicarray  $headers= 'null'
inherited

The HTTP headers sent in the request

Inherited from: \modRequest::$$headers\modManagerRequest::$$headers
Default valuenullDetails
Type
array
Inherited_from
\modRequest::$$headers  
Inherited_from
\modManagerRequest::$$headers  
Propertypublicstring  $location= ''

The base subdirectory location of the requested action.

Details
Type
string
Access
public  
Propertypublicstring  $method= 'null'
inherited

The current request method

Inherited from: \modRequest::$$method\modManagerRequest::$$method
Default valuenullDetails
Type
string
Inherited_from
\modRequest::$$method  
Inherited_from
\modManagerRequest::$$method  
Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX object

Inherited from: \modRequest::$$modx\modManagerRequest::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modRequest::$$modx  
Inherited_from
\modManagerRequest::$$modx  
Propertypublicarray  $parameters= 'null'
inherited

The parameters sent in the request

Inherited from: \modRequest::$$parameters\modManagerRequest::$$parameters
Default valuenullDetails
Type
array
Inherited_from
\modRequest::$$parameters  
Inherited_from
\modManagerRequest::$$parameters  

Methods

methodpublic__construct( \modX $modx ) : \modManagerRequest
inherited

Instantiates a modManagerRequest object.

Inherited from: \modManagerRequest::__construct()
Parameters
Name Type Description
$modx \modX
Returns
Type Description
\modManagerRequest
methodpublic_cleanResourceIdentifier( string $identifier ) : string | integer
inherited

Cleans the resource identifier from the request params.

Inherited from: \modRequest::_cleanResourceIdentifier()\modManagerRequest::_cleanResourceIdentifier()
Parameters
Name Type Description
$identifier string

The raw identifier.

Returns
Type Description
string | integer The cleansed identifier.
methodpubliccheckPublishStatus( ) : void
inherited

Checks the current status of timed publishing events.

Inherited from: \modRequest::checkPublishStatus()\modManagerRequest::checkPublishStatus()
methodpublicgetActionIDs( array $actions = array(), string $namespace = 'core' ) : array
inherited

Get the IDs for a collection of string action keys

Inherited from: \modRequest::getActionIDs()\modManagerRequest::getActionIDs()
Parameters
Name Type Description
$actions array
$namespace string
Returns
Type Description
array
methodpublicgetAllActionIDs( string $namespace = '' ) : array
inherited

Get a list of all modAction IDs

Inherited from: \modRequest::getAllActionIDs()\modManagerRequest::getAllActionIDs()
Parameters
Name Type Description
$namespace string
Returns
Type Description
array
methodpublicgetClientIp( ) : array
inherited

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
Returns
Type Description
array
Details
Access
public  
methodpublicgetHeaders( boolean $ucKeys = false ) : array
inherited

Return the HTTP headers sent through the request

Inherited from: \modRequest::getHeaders()\modManagerRequest::getHeaders()
Parameters
Name Type Description
$ucKeys boolean

if true, upper-case all keys for the headers

Returns
Type Description
array
methodpublicgetParameters( string | array $keys = array(), string $type = 'GET' ) : mixed
inherited

Get a GPC/REQUEST variable value or an array of values from the request.

Inherited from: \modRequest::getParameters()\modManagerRequest::getParameters()
Parameters
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).

Returns
Type Description
mixed
methodpublicgetResource( string $method, string | integer $identifier, array $options = array() ) : \modResource
inherited

Gets a requested resource and all required data.

Inherited from: \modRequest::getResource()\modManagerRequest::getResource()
Parameters
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

Returns
Type Description
\modResource The requested modResource instance or request is forwarded to the error page, or unauthorized page.
methodpublicgetResourceIdentifier( string $method ) : string
inherited

Gets the idetifier used to request a resource.

Inherited from: \modRequest::getResourceIdentifier()\modManagerRequest::getResourceIdentifier()
Parameters
Name Type Description
$method string

'alias' or 'id'.

Returns
Type Description
string The identifier for the requested resource.
methodpublicgetResourceMethod( ) : string
inherited

Gets the method used to request a resource.

Inherited from: \modRequest::getResourceMethod()\modManagerRequest::getResourceMethod()
Returns
Type Description
string 'alias', 'id', or an empty string.
methodpublichandleRequest( array $options = array() ) : boolean

Handles all requests specified by the action param and prepares for loading.

Parameters
Name Type Description
$options array

An array of request options

Returns
Type Description
boolean
Details
Access
public  
methodpublicinitialize( ) : bool

Initializes the connector request, loading the proper context, culture and lexicon; also loads the action map

Returns
Type Description
bool
methodpublicloadActionMap( ) : boolean
inherited

Loads the actionMap, and generates a cache file if necessary.

Inherited from: \modManagerRequest::loadActionMap()
Returns
Type Description
boolean True if successful.
Details
Access
public  
methodpublicloadErrorHandler( string $class = 'modError' ) : void
inherited

This implementation adds register logging capabilities via $_POST vars when the error handler is loaded.

Inherited from: \modManagerRequest::loadErrorHandler()
Parameters
Name Type Description
$class string
methodpublicprepareResponse( array $options = array() ) : boolean

Prepares the output with the specified processor.

Parameters
Name Type Description
$options array

An array of options

Returns
Type Description
boolean True if the response is properly prepared.
methodpublicpreserveRequest( string $key = 'referrer' ) : void
inherited

Preserves the $_REQUEST superglobal to the $_SESSION.

Inherited from: \modRequest::preserveRequest()\modManagerRequest::preserveRequest()
Parameters
Name Type Description
$key string

A key to save the $_REQUEST as; default is 'referrer'.

methodpublicregisterLogging( array $options = array() ) : void
inherited

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)
Parameters
Name Type Description
$options array

An array containing all the options required to initiate and configure logging to a modRegister instance.

methodpublicretrieveRequest( string $key = 'referrer' ) : string
inherited

Retrieve a preserved $_REQUEST from $_SESSION.

Inherited from: \modRequest::retrieveRequest()\modManagerRequest::retrieveRequest()
Parameters
Name Type Description
$key string

A key to identify a specific $_REQUEST; default is 'referrer'.

Returns
Type Description
string
methodpublicsanitizeRequest( ) : void
inherited

Harden GPC variables by removing any MODX tags, Javascript, or entities.

Inherited from: \modRequest::sanitizeRequest()\modManagerRequest::sanitizeRequest()
methodpublicsetDirectory( string $dir = '' ) : void

Sets the directory to load the processors from

Parameters
Name Type Description
$dir string

The directory to load from

Documentation was generated by DocBlox 0.18.1.