// and "legacy" support.
$loader = \App\Config\Services::autoloader();
$loader->initialize(new App\Config\AutoloadConfig());
// The register function will prepend
// the psr4 loader.
$loader->register();
/*
 * ------------------------------------------------------
 *  Set custom exception handling
 * ------------------------------------------------------
 */
\App\Config\Services::exceptions(true)->initialize();
//--------------------------------------------------------------------
// Start the Benchmark
//--------------------------------------------------------------------
$benchmark = \App\Config\Services::timer(true);
$benchmark->start('total_execution');
//--------------------------------------------------------------------
// CSRF Protection
//--------------------------------------------------------------------
$config = new \App\Config\AppConfig();
if ($config->CSRFProtection === true && !is_cli()) {
    $security = \App\Config\Services::security($config);
    $security->CSRFVerify();
}
//--------------------------------------------------------------------
// Get our Request and Response objects
//--------------------------------------------------------------------
$request = is_cli() ? \App\Config\Services::clirequest($config) : \App\Config\Services::request($config);
$response = \App\Config\Services::response();
// Assume success until proven otherwise.