/** * Setup the request object */ $request = new Request($decryptor, $_SERVER, $_GET, $_POST, $_FILES, $_COOKIE, file_get_contents('php://input')); /** * Setup the session */ $session = new Session('/', $request->server('SERVER_NAME'), $request->isEncrypted()); /** * Setup authentication object */ $user = new User($session); /** * Setup the router */ $routeCache = $user->isLoggedIn() ? '/cache/routes-authenticated.php' : '/cache/routes.php'; $routeCollector = new RouteCollector(new RouteParser(), new RouteDataGenerator()); $router = new Router($routeCollector, function ($dispatchData) { return new RouteDispatcher($dispatchData); }, __DIR__ . $routeCache, !$production); /** * Load routes */ require_once __DIR__ . '/routes.php'; /** * Setup the theme */ $theme = new Theme(__DIR__ . '/themes', 'Default'); /** * Setup i18n */