Ouzo\ExceptionHandling\ErrorHandler::register PHP Method

register() public method

public register ( )
    public function register()
    {
        set_exception_handler(array(__CLASS__, 'exceptionHandler'));
        set_error_handler(array(__CLASS__, 'errorHandler'));
        register_shutdown_function(array(__CLASS__, 'shutdownHandler'));
    }

Usage Example

Beispiel #1
0
 /**
  * @return void
  */
 private function registerErrorHandlers()
 {
     if (Config::getValue('debug')) {
         $handler = new DebugErrorHandler();
     } else {
         $handler = new ErrorHandler();
     }
     $handler->register();
 }