die; } unset($continue); } /* * get a router to handle and generate URLs. */ require_once APPDIR . '/router.class.php'; $router = new AppRouter(); $router->decode_url($_SERVER['REQUEST_URI']); /* * Find the controller that registered for the requested URI. Note that here * $_REQUEST['controller'] stand for an alias and not a controller class, hence * the need of the router's logic. */ $controller = $router->find_route(isset($_REQUEST['controller']) ? $_REQUEST['controller'] : NULL, isset($_REQUEST['action']) ? $_REQUEST['action'] : NULL, $_SERVER['REQUEST_METHOD']); if (is_null($controller)) { require_once APPDIR . '/controllers/error.class.php'; $controller = new ErrorController(No2_HTTP::NOT_FOUND); } /* * Execute the requested action in order to be able to render the ressource. */ invoke_it: if (No2_Logger::$level >= No2_Logger::DEBUG) { $controller->invoke(); } else { try { $controller->invoke(); } catch (Exception $_) { // Something Bad™ happened. This exception wasn't expected, so we