Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Kohana::$is_cli)
- {
- $args = CLI::options('uri');
- $uri = $args['uri'];
- }
- else
- {
- $uri = Arr::get($_GET, 'kohana_uri');
- }
- $request = Request::instance($uri);
- try
- {
- // Attempt to fire the request
- $request->execute();
- } catch (Exception $e)
- {
- if (!IN_PRODUCTION)
- {
- // Just throw the exception
- throw $e;
- }
- // Log the error
- Kohana::$log->add(Kohana::ERROR, Kohana::exception_text($e));
- // Create a 404 response
- $request->status = 404;
- $request->response = View::factory('errors/pageNotFound', array(
- 'menu' => (strpos($host, 'admin.') !== FALSE) ? '' : HTML::menu()
- ));
- }
- echo $request->send_headers()
- ->response;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement