ErrorHandler.php

Go to the documentation of this file.
00001 <?php
00002 
00033 class Robo47_Application_Resource_Plugin_ErrorHandler
00034 extends Zend_Application_Resource_ResourceAbstract
00035 {
00036 
00040     protected $_errorHandler = null;
00041     
00042     public function init()
00043     {
00044         $this->_errorHandler = $this->_setupErrorHandler($this->_options);
00045     }
00046     
00047     public function _setupErrorHandler($options)
00048     {
00049         $errorHandler = new Zend_Controller_Plugin_ErrorHandler($options);
00050 
00051         if (isset($options['module'])) {
00052             $errorHandler->setErrorHandlerModule($options['module']);
00053         }
00054 
00055         if (isset($options['controller'])) {
00056             $errorHandler->setErrorHandlerController($options['controller']);
00057         }
00058 
00059         if (isset($options['action'])) {
00060             $errorHandler->setErrorHandlerAction($options['action']);
00061         }
00062         $fc = Zend_Controller_Front::getInstance();
00063         $fc->registerPlugin($errorHandler);
00064 
00065         return $errorHandler;
00066     }
00067 
00071     public function getErrorHandler()
00072     {
00073         return $this->_errorHandler;
00074     }
00075 }