pushHandler($defaultHandler); // Set up json handler for ajax errors $jsonHandler = new JsonResponseHandler(); $jsonHandler->onlyForAjaxRequests(TRUE); $whoops->pushHandler($jsonHandler); // Register as the error handler $whoops->register(); // ----------------------------------------------------------------------------- // Dependency Injection setup // ----------------------------------------------------------------------------- require _dir(CONF_DIR, 'base_config.php'); // $base_config require _dir(CONF_DIR, 'config.php'); // $config $config_array = array_merge($base_config, $config); $di = require _dir(APP_DIR, 'bootstrap.php'); $container = $di($config_array); $container->set('error-handler', $defaultHandler); // ----------------------------------------------------------------------------- // Dispatch to the current route // ----------------------------------------------------------------------------- $container->get('dispatcher')->__invoke(); // End of index.php