Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( ! defined('SUPPRESS_REQUEST'))
- {
- $ruri = Request::detect_uri();
- $cat = Request::instance()->uri;
- $segments = explode('/', $cat);
- if (count($segments) > 1)
- {
- $allowed_routes = array('emprego', 'veiculos');
- if (in_array($segments[0], $allowed_routes))
- {
- if (Request::$is_ajax)
- {
- define('CV_CAT', $segments[0]);
- $request = Request::factory('/'.$ruri);
- }
- else
- {
- define('CV_CAT', $segments[0]);
- $request = Request::factory('/'.$segments[0].'/'.$ruri);
- }
- }
- else
- $request = Request::instance();
- }
- else
- $request = Request::instance();
- try
- {
- $request->execute();
- }
- catch( ReflectionException $e )
- {
- $new_request = Request::factory('/error/404');
- $new_request->execute();
- $new_request->status = 404;
- if($new_request->send_headers())
- {
- die($new_request->response);
- }
- }
- if ( $request->send_headers()->response )
- {
- echo $request->response;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement