Controller/Plugin/ErrorHandler.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Controller
- Subpackage
- Plugins
\Zend_Controller_Plugin_ErrorHandler
Handle exceptions that bubble up based on missing controllers, actions, or application errors, and forward to an error handler.
- Parent(s)
- \Zend_Controller_Plugin_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
- \global\Zend_Controller_Plugin_Abstract
- Version
- $Id: ErrorHandler.php 24593 2012-01-05 20:35:02Z matthew $
Constants
EXCEPTION_NO_CONTROLLER
= 'EXCEPTION_NO_CONTROLLER'Const - No controller exception; controller does not exist
EXCEPTION_NO_ACTION
= 'EXCEPTION_NO_ACTION'Const - No action exception; controller exists, but action does not
Properties

string $_errorAction = 'error'Action to use for errors; defaults to 'error'
'error'Details- Type
- string

string $_errorController = 'error'Controller to use for errors; defaults to 'error'
'error'Details- Type
- string

string $_errorModule = Module to use for errors; defaults to default module in dispatcher
- Type
- string

int $_exceptionCountAtFirstEncounter = 0Exception count logged at first invocation of plugin
0Details- Type
- int

bool $_isInsideErrorHandlerLoop = falseFlag; are we already inside the error handler loop?
falseDetails- Type
- bool

\Zend_Controller_Request_Abstract $_request = - Type
- \Zend_Controller_Request_Abstract
- Inherited_from
- \Zend_Controller_Plugin_Abstract::$$_request

\Zend_Controller_Response_Abstract $_response = - Type
- \Zend_Controller_Response_Abstract
- Inherited_from
- \Zend_Controller_Plugin_Abstract::$$_response
Methods

__construct(Array $options = array()) : voidConstructor
Options may include: - module - controller - action
| Name | Type | Description |
|---|---|---|
| $options | Array |

_handleError(\Zend_Controller_Request_Abstract $request) : voidHandle errors and exceptions
If the 'noErrorHandler' front controller flag has been set, returns early.
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |

dispatchLoopShutdown() : voidCalled before Zend_Controller_Front exits its dispatch loop.
Inherited from: \Zend_Controller_Plugin_Abstract::dispatchLoopShutdown()
dispatchLoopStartup(\Zend_Controller_Request_Abstract $request) : voidCalled before Zend_Controller_Front enters its dispatch loop.
Inherited from: \Zend_Controller_Plugin_Abstract::dispatchLoopStartup()| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |

getErrorHandlerAction() : stringRetrieve the current error handler action
| Type | Description |
|---|---|
| string |

getErrorHandlerController() : stringRetrieve the current error handler controller
| Type | Description |
|---|---|
| string |

getErrorHandlerModule() : stringRetrieve the current error handler module
| Type | Description |
|---|---|
| string |

getRequest() : \Zend_Controller_Request_Abstract
| Type | Description |
|---|---|
| \Zend_Controller_Request_Abstract | $request |

getResponse() : \Zend_Controller_Response_Abstract
| Type | Description |
|---|---|
| \Zend_Controller_Response_Abstract | $response |

postDispatch(\Zend_Controller_Request_Abstract $request) : voidPost dispatch hook -- check for exceptions and dispatch error handler if necessary
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.
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |

preDispatch(\Zend_Controller_Request_Abstract $request) : voidPre dispatch hook -- check for exceptions and dispatch error handler if necessary
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.
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |

routeShutdown(\Zend_Controller_Request_Abstract $request) : voidRoute shutdown hook -- Ccheck for router exceptions
Called after Zend_Controller_Front exits from the router.
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |

routeStartup(\Zend_Controller_Request_Abstract $request) : voidCalled before Zend_Controller_Front begins evaluating the request against its routes.
Inherited from: \Zend_Controller_Plugin_Abstract::routeStartup()| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |

setErrorHandler(array $options = array()) : \Zend_Controller_Plugin_ErrorHandlersetErrorHandler() - setup the error handling options
| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Controller_Plugin_ErrorHandler |

setErrorHandlerAction(string $action) : \Zend_Controller_Plugin_ErrorHandlerSet the action name for the error handler
| Name | Type | Description |
|---|---|---|
| $action | string |
| Type | Description |
|---|---|
| \Zend_Controller_Plugin_ErrorHandler |

setErrorHandlerController(string $controller) : \Zend_Controller_Plugin_ErrorHandlerSet the controller name for the error handler
| Name | Type | Description |
|---|---|---|
| $controller | string |
| Type | Description |
|---|---|
| \Zend_Controller_Plugin_ErrorHandler |

setErrorHandlerModule(string $module) : \Zend_Controller_Plugin_ErrorHandlerSet the module name for the error handler
| Name | Type | Description |
|---|---|---|
| $module | string |
| Type | Description |
|---|---|
| \Zend_Controller_Plugin_ErrorHandler |

setRequest(\Zend_Controller_Request_Abstract $request) : \Zend_Controller_Plugin_Abstract
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |
| Type | Description |
|---|---|
| \Zend_Controller_Plugin_Abstract |

setResponse(\Zend_Controller_Response_Abstract $response) : \Zend_Controller_Plugin_Abstract
| Name | Type | Description |
|---|---|---|
| $response | \Zend_Controller_Response_Abstract |
| Type | Description |
|---|---|
| \Zend_Controller_Plugin_Abstract |