NiceException!
Requirements
-PHP 5.3.3+ (uses polyfills)
-PHP 5.4+, (*1)
Using with ZF2
Since ZF2 has a try/catch around the Controller dispatch theres no method for NiceException
to function.. however by attaching an event in the Module bootstrap you can rethrow the
exception to restores PHP default behaviour, (*2)
getApplication()->getEventManager();
// Restore PHPs default behaviour
$events->attach(MvcEvent::EVENT_DISPATCH_ERROR, function (MvcEvent $e) {
throw $e->getParam('exception');
});
}
```
Configuration
---------------------
```php
'development',
/**
* If you know your application will create a buffer you could
* disable this to save abit of time
*/
'obStart' => true,
/**
* Should NiceException register a shutdown function
* to attempt to catch(fake catch) fatal errors
*/
'register_shutdown_function' => true, // @todo true,
/**
* Should NiceException set the errors as on (-1)
*/
'error_reporting' => true,
// Should NiceException set a error handler
'set_error_handler' => true,
));
$niceException->run();
?>