pushHandler($defaultHandler); // Set up json handler for ajax errors $jsonHandler = new JsonResponseHandler(); $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'); // Unset 'constants' unset($APP_DIR); unset($SRC_DIR); unset($CONF_DIR); $container = $di($config_array); // ----------------------------------------------------------------------------- // Dispatch to the current route // ----------------------------------------------------------------------------- $container->get('dispatcher')->__invoke(); // End of index.php