I'm trying to setup Whoops on a Codeigniter 3 application.
I installed Whoops with composer and calling it like this :
use Whoops\Handler\PrettyPageHandler;
if (ENVIRONMENT == 'development') {
$whoops = new \Whoops\Run;
$whoops->pushHandler(new Whoops\Handler\PrettyPageHandler());
$whoops->register();
$handler = new PrettyPageHandler;
$handler->setEditor('sublime');
}
It works for warnings, notices and deprecated errors, but not for fatal errors.
CodeIgniter seems to handle them before Whoops. Is there a way to modify this behavior?
I got it working by moving the "Whoops Run" in my index.php file, right after defining my development environment and error reporting settings (around line 70 in the CI index.php file) :
A comment in this Github Whoops issue tipped me off!