route($method, $uri); if ( ! is_null(Request::$route)) { $response = Request::$route->call(); } else { $response = Response::error('404'); } /** * Stringify the response. We need to force the response to be * stringed before closing the session, since the developer may * be using the session within their views, so we cannot age * the session data until the view is rendered. */ $response->content = $response->render(); /** * Close the session and write the active payload to persistent * storage. The session cookie will also be written and if the * driver is a sweeper, session garbage collection might be * performed depending on the "sweepage" probability. */ if (Config::$items['session']['driver'] !== '') { IoC::core('session')->save($driver); } $response->send();