// 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. $response->setStatusCode(200); //-------------------------------------------------------------------- // Try to Route It //-------------------------------------------------------------------- require APPPATH . 'config/Routes.php'; $router = \App\Config\Services::router($routes, true); $path = is_cli() ? $request->getPath() : $request->uri->getPath(); $controller = $router->handle($path); ob_start(); // Is it routed to a Closure? if (is_callable($controller)) { echo $controller(...$router->params()); } else {