translation : Config::get('routes.'.$route); if ($route instanceof Closure) { $response = $route(); if( ! $response instanceof Response) { $response = Response::forge($response); } } elseif ($e === false) { $response = Request::forge()->execute()->response(); } elseif ($route) { $response = Request::forge($route, false)->execute(array($e))->response(); } else { throw $e; } return $response; }; // Generate the request, execute it and send the output. try { // Boot the app... require APPPATH.'bootstrap.php'; // ... and execute the main request $response = $routerequest(); } catch (HttpBadRequestException $e) { $response = $routerequest('_400_', $e); } catch (HttpNoAccessException $e) { $response = $routerequest('_403_', $e); } catch (HttpNotFoundException $e) { $response = $routerequest('_404_', $e); } catch (HttpServerErrorException $e) { $response = $routerequest('_500_', $e); } // This will add the execution time and memory usage to the output. // Comment this out if you don't use it. $response->body((string) $response); 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() ) ); } // Send the output to the client $response->send(true);