Handle exceptions that bubble up based on missing controllers, actions, or application errors, and forward to an error handler.

uses
category Zend
package Zend_Controller
subpackage Plugins
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
version $Id$
inherited_from \Zend_Controller_Plugin_Abstract

 Methods

Constructor

__construct(Array $options = array()) : void

Options may include:

  • module
  • controller
  • action

Parameters

$options

Array

Called before Zend_Controller_Front exits its dispatch loop.

dispatchLoopShutdown() : void
Inherited

Called before Zend_Controller_Front enters its dispatch loop.

dispatchLoopStartup(\Zend_Controller_Request_Abstract $request) : void
Inherited

Parameters

$request

\Zend_Controller_Request_Abstract

Retrieve the current error handler action

getErrorHandlerAction() : string

Returns

string

Retrieve the current error handler controller

getErrorHandlerController() : string

Returns

string

Retrieve the current error handler module

getErrorHandlerModule() : string

Returns

string

Get request object

getRequest() : \Zend_Controller_Request_Abstract
Inherited

Returns

\Zend_Controller_Request_Abstract$request

Get response object

getResponse() : \Zend_Controller_Response_Abstract
Inherited

Returns

\Zend_Controller_Response_Abstract$response

Post dispatch hook -- check for exceptions and dispatch error handler if necessary

postDispatch(\Zend_Controller_Request_Abstract $request) 

This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (via setDispatched(false)), a new action may be specified for dispatching.

inherited_from \Zend_Controller_Plugin_Abstract::postDispatch()

Parameters

$request

\Zend_Controller_Request_Abstract

Called after an action is dispatched by Zend_Controller_Dispatcher.

postDispatch(\Zend_Controller_Request_Abstract $request) : void
Inherited

This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (via setDispatched(false)), a new action may be specified for dispatching.

Parameters

$request

\Zend_Controller_Request_Abstract

Pre dispatch hook -- check for exceptions and dispatch error handler if necessary

preDispatch(\Zend_Controller_Request_Abstract $request) 

This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (via setDispatched(false)), the current action may be skipped.

inherited_from \Zend_Controller_Plugin_Abstract::preDispatch()

Parameters

$request

\Zend_Controller_Request_Abstract

Called before an action is dispatched by Zend_Controller_Dispatcher.

preDispatch(\Zend_Controller_Request_Abstract $request) : void
Inherited

This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (via setDispatched(false)), the current action may be skipped.

Parameters

$request

\Zend_Controller_Request_Abstract

Route shutdown hook -- Ccheck for router exceptions

routeShutdown(\Zend_Controller_Request_Abstract $request) 

Called after Zend_Controller_Front exits from the router.

inherited_from \Zend_Controller_Plugin_Abstract::routeShutdown()

Parameters

$request

\Zend_Controller_Request_Abstract

Called after Zend_Controller_Router exits.

routeShutdown(\Zend_Controller_Request_Abstract $request) : void
Inherited

Called after Zend_Controller_Front exits from the router.

Parameters

$request

\Zend_Controller_Request_Abstract

Called before Zend_Controller_Front begins evaluating the request against its routes.

routeStartup(\Zend_Controller_Request_Abstract $request) : void
Inherited

Parameters

$request

\Zend_Controller_Request_Abstract

setErrorHandler() - setup the error handling options

setErrorHandler(array $options = array()) : \Zend_Controller_Plugin_ErrorHandler

Parameters

$options

array

Returns

\Zend_Controller_Plugin_ErrorHandler

Set the action name for the error handler

setErrorHandlerAction(string $action) : \Zend_Controller_Plugin_ErrorHandler

Parameters

$action

string

Returns

\Zend_Controller_Plugin_ErrorHandler

Set the controller name for the error handler

setErrorHandlerController(string $controller) : \Zend_Controller_Plugin_ErrorHandler

Parameters

$controller

string

Returns

\Zend_Controller_Plugin_ErrorHandler

Set the module name for the error handler

setErrorHandlerModule(string $module) : \Zend_Controller_Plugin_ErrorHandler

Parameters

$module

string

Returns

\Zend_Controller_Plugin_ErrorHandler

Set request object

setRequest(\Zend_Controller_Request_Abstract $request) : \Zend_Controller_Plugin_Abstract
Inherited

Parameters

$request

\Zend_Controller_Request_Abstract

Returns

\Zend_Controller_Plugin_Abstract

Set response object

setResponse(\Zend_Controller_Response_Abstract $response) : \Zend_Controller_Plugin_Abstract
Inherited

Parameters

$response

\Zend_Controller_Response_Abstract

Returns

\Zend_Controller_Plugin_Abstract

Handle errors and exceptions

_handleError(\Zend_Controller_Request_Abstract $request) : void

If the 'noErrorHandler' front controller flag has been set, returns early.

Parameters

$request

\Zend_Controller_Request_Abstract

 Properties

 

Action to use for errors; defaults to 'error'

$_errorAction : string

Default

'error'
 

Controller to use for errors; defaults to 'error'

$_errorController : string

Default

'error'
 

Module to use for errors; defaults to default module in dispatcher

$_errorModule : string

Default

 

Exception count logged at first invocation of plugin

$_exceptionCountAtFirstEncounter : integer

Default

0
 

Flag; are we already inside the error handler loop?

$_isInsideErrorHandlerLoop : boolean

Default

false
 

$_request

$_request : \Zend_Controller_Request_Abstract

Default

 

$_response

$_response : \Zend_Controller_Response_Abstract

Default

 Constants

 

Const - No action exception; controller exists, but action does not

EXCEPTION_NO_ACTION = 'EXCEPTION_NO_ACTION' 
 

Const - No controller exception; controller does not exist

EXCEPTION_NO_CONTROLLER = 'EXCEPTION_NO_CONTROLLER' 
 

Const - No route exception; no routing was possible

EXCEPTION_NO_ROUTE = 'EXCEPTION_NO_ROUTE' 
 

Const - Other Exception; exceptions thrown by application controllers

EXCEPTION_OTHER = 'EXCEPTION_OTHER'