execute()->response(); } catch (HttpNotFoundException $e) { \Request::reset_request(true); $route = array_key_exists('_404_', Router::$routes) ? Router::$routes['_404_']->translation : Config::get('routes._404_'); if ($route instanceof Closure) { $response = $route(); if (!$response instanceof Response) { $response = Response::forge($response); } } elseif ($route) { $response = Request::forge($route, false)->execute()->response(); } else { throw $e; } } // Render the output $response->body((string) $response); // This will add the execution time and memory usage to the output. // Comment this out if you don't use it. if (strpos($response->body(), '{exec_time}') !== false or strpos($response->body(), '{mem_usage}') !== false) { $bm = Profiler::app_total(); $response->body( str_replace( array('{exec_time}', '{mem_usage}'), array(round($bm[0], 4), round($bm[1] / pow(1024, 2), 3)), $response->body() ) ); } $response->send(true);