Controller/Plugin/ErrorHandler.php

Show: PublicProtectedPrivateinherited
Table of Contents
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 license@zend.com 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

Package: Zend\Controller\Plugins
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

>VConstant  EXCEPTION_NO_CONTROLLER = 'EXCEPTION_NO_CONTROLLER'
Const - No controller exception; controller does not exist
>VConstant  EXCEPTION_NO_ACTION = 'EXCEPTION_NO_ACTION'
Const - No action exception; controller exists, but action does not
>VConstant  EXCEPTION_NO_ROUTE = 'EXCEPTION_NO_ROUTE'
Const - No route exception; no routing was possible
>VConstant  EXCEPTION_OTHER = 'EXCEPTION_OTHER'
Const - Other Exception; exceptions thrown by application controllers

Properties

>VPropertyprotectedstring $_errorAction = 'error'
Action to use for errors; defaults to 'error'
Default value'error'Details
Type
string
>VPropertyprotectedstring $_errorController = 'error'
Controller to use for errors; defaults to 'error'
Default value'error'Details
Type
string
>VPropertyprotectedstring $_errorModule
Module to use for errors; defaults to default module in dispatcher
Details
Type
string
>VPropertyprotectedint $_exceptionCountAtFirstEncounter = 0
Exception count logged at first invocation of plugin
Default value0Details
Type
int
>VPropertyprotectedbool $_isInsideErrorHandlerLoop = false
Flag; are we already inside the error handler loop?
Default valuefalseDetails
Type
bool
>VPropertyprotected\Zend_Controller_Request_Abstract $_request
>VPropertyprotected\Zend_Controller_Response_Abstract $_response

Methods

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

Constructor

Options may include: - module - controller - action

Parameters
NameTypeDescription
$optionsArray
methodprotected_handleError(\Zend_Controller_Request_Abstract $request) : void

Handle errors and exceptions

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

Parameters
NameTypeDescription
$request\Zend_Controller_Request_Abstract
methodpublicdispatchLoopShutdown() : void
inherited

Called before Zend_Controller_Front exits its dispatch loop.

Inherited from: \Zend_Controller_Plugin_Abstract::dispatchLoopShutdown()
methodpublicdispatchLoopStartup(\Zend_Controller_Request_Abstract $request) : void
inherited

Called before Zend_Controller_Front enters its dispatch loop.

Inherited from: \Zend_Controller_Plugin_Abstract::dispatchLoopStartup()
Parameters
NameTypeDescription
$request\Zend_Controller_Request_Abstract
methodpublicgetErrorHandlerAction() : string

Retrieve the current error handler action

Returns
TypeDescription
string
methodpublicgetErrorHandlerController() : string

Retrieve the current error handler controller

Returns
TypeDescription
string
methodpublicgetErrorHandlerModule() : string

Retrieve the current error handler module

Returns
TypeDescription
string
methodpublicgetRequest() : \Zend_Controller_Request_Abstract
inherited

Get request object

Inherited from: \Zend_Controller_Plugin_Abstract::getRequest()
Returns
TypeDescription
\Zend_Controller_Request_Abstract$request
methodpublicgetResponse() : \Zend_Controller_Response_Abstract
inherited

Get response object

Inherited from: \Zend_Controller_Plugin_Abstract::getResponse()
Returns
TypeDescription
\Zend_Controller_Response_Abstract$response
methodpublicpostDispatch(\Zend_Controller_Request_Abstract $request) : void

Post 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.

Parameters
NameTypeDescription
$request\Zend_Controller_Request_Abstract
methodpublicpreDispatch(\Zend_Controller_Request_Abstract $request) : void

Pre 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.

Parameters
NameTypeDescription
$request\Zend_Controller_Request_Abstract
methodpublicrouteShutdown(\Zend_Controller_Request_Abstract $request) : void

Route shutdown hook -- Ccheck for router exceptions

Called after Zend_Controller_Front exits from the router.

Parameters
NameTypeDescription
$request\Zend_Controller_Request_Abstract
methodpublicrouteStartup(\Zend_Controller_Request_Abstract $request) : void
inherited

Called before Zend_Controller_Front begins evaluating the request against its routes.

Inherited from: \Zend_Controller_Plugin_Abstract::routeStartup()
Parameters
NameTypeDescription
$request\Zend_Controller_Request_Abstract
methodpublicsetErrorHandler(array $options = array()) : \Zend_Controller_Plugin_ErrorHandler

setErrorHandler() - setup the error handling options

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Controller_Plugin_ErrorHandler
methodpublicsetErrorHandlerAction(string $action) : \Zend_Controller_Plugin_ErrorHandler

Set the action name for the error handler

Parameters
NameTypeDescription
$actionstring
Returns
TypeDescription
\Zend_Controller_Plugin_ErrorHandler
methodpublicsetErrorHandlerController(string $controller) : \Zend_Controller_Plugin_ErrorHandler

Set the controller name for the error handler

Parameters
NameTypeDescription
$controllerstring
Returns
TypeDescription
\Zend_Controller_Plugin_ErrorHandler
methodpublicsetErrorHandlerModule(string $module) : \Zend_Controller_Plugin_ErrorHandler

Set the module name for the error handler

Parameters
NameTypeDescription
$modulestring
Returns
TypeDescription
\Zend_Controller_Plugin_ErrorHandler
methodpublicsetRequest(\Zend_Controller_Request_Abstract $request) : \Zend_Controller_Plugin_Abstract
inherited

Set request object

Inherited from: \Zend_Controller_Plugin_Abstract::setRequest()
Parameters
NameTypeDescription
$request\Zend_Controller_Request_Abstract
Returns
TypeDescription
\Zend_Controller_Plugin_Abstract
methodpublicsetResponse(\Zend_Controller_Response_Abstract $response) : \Zend_Controller_Plugin_Abstract
inherited

Set response object

Inherited from: \Zend_Controller_Plugin_Abstract::setResponse()
Parameters
NameTypeDescription
$response\Zend_Controller_Response_Abstract
Returns
TypeDescription
\Zend_Controller_Plugin_Abstract
Documentation was generated by phpDocumentor 2.0.0a12.