core/model/modx/modmanagerrequest.class.php

Show: inherited
Table of Contents

modManagerRequest

Package
modx  

\modManagerRequest

Package: modx

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

Propertypublicstring  $action= 'null'

The action to load.
Default valuenullDetails
Type
string
Access
public  
Propertypublicstring  $actionVar= ''a''

The REQUEST parameter to load actions by.
Default value'a'Details
Type
string
Access
public  
Propertypublicmixed  $defaultAction= '0'

The default action to load from.
Default value0Details
Type
mixed
Access
public  
Propertypublic\modError  $error= 'null'

The error handler for the request.
Default valuenullDetails
Type
\modError
Access
public  
Deprecated
2.0.0 Use $modx->error instead.  
Propertypublicarray  $headers= 'null'
inherited

The HTTP headers sent in the request

Inherited from: \modRequest::$$headers
Default valuenullDetails
Type
array
Inherited_from
\modRequest::$$headers  
Propertypublicstring  $method= 'null'
inherited

The current request method

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

A reference to the modX object

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

The parameters sent in the request

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

Methods

methodpublic__construct( \modX $modx ) : \modManagerRequest

Instantiates a modManagerRequest object.

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()
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()
methodpublicgetActionIDs( array $actions = array(), string $namespace = 'core' ) : array
inherited

Get the IDs for a collection of string action keys

Inherited from: \modRequest::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()
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()
  • 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()
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()
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()
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()
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()
Returns
Type Description
string 'alias', 'id', or an empty string.
methodpublichandleRequest( ) : boolean

The primary MODX manager request handler (a.k.a. controller).

Returns
Type Description
boolean True if a request is handled without interruption.
Details
Access
public  
methodpublicinitialize( ) : boolean

Initializes the manager request.

Returns
Type Description
boolean True if successful.
Details
Access
public  
methodpublicloadActionMap( ) : boolean

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

Returns
Type Description
boolean True if successful.
Details
Access
public  
methodpublicloadErrorHandler( string $class = 'modError' ) : void

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

Parameters
Name Type Description
$class string
methodpublicprepareResponse( array $options = array() ) : boolean

Prepares the MODX response to a mgr request that is being handled.

Parameters
Name Type Description
$options array

An array of options

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

Preserves the $_REQUEST superglobal to the $_SESSION.

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

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()
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()
Documentation was generated by DocBlox 0.18.1.