db->beginTransaction(); $config = new DatabaseConfig($database); ctx_log_endok(); // load the theme parts ctx_log_start("Loading themelets"); $_theme = $config->get_string("theme", "default"); if(!file_exists("themes/$_theme")) $_theme = "default"; foreach(_get_themelet_files($_theme) as $themelet) { require_once $themelet; } ctx_log_endok(); _load_extensions(); ctx_log_endok("Initialisation"); ctx_log_start("Page generation"); // start the page generation waterfall $page = class_exists("CustomPage") ? new CustomPage() : new Page(); $user = _get_user(); send_event(new InitExtEvent()); send_event(_get_page_request()); $page->display(); ctx_log_endok("Page generation"); $database->db->commit(); _end_cache(); ctx_log_endok(); } catch(Exception $e) { if($database && $database->db) $database->db->rollback(); _fatal_error($e); ctx_log_ender(); } ?>