ctx_log_start("Opening files"); $files = array_merge(glob("core/*.php"), glob("ext/*/main.php")); foreach ($files as $filename) { require_once $filename; } ctx_log_endok(); ctx_log_start("Connecting to DB"); // connect to the database $database = new Database(); //$database->db->fnExecute = '_count_execs'; // FIXME: PDO equivalent $database->db->beginTransaction(); $config = new DatabaseConfig($database); ctx_log_endok(); ctx_log_start("Loading themelets"); // load the theme parts $_theme = $config->get_string("theme", "default"); if (!file_exists("themes/{$_theme}")) { $_theme = "default"; } if (file_exists("themes/{$_theme}/custompage.class.php")) { require_once "themes/{$_theme}/custompage.class.php"; } require_once "themes/{$_theme}/layout.class.php"; require_once "themes/{$_theme}/themelet.class.php"; $themelets = glob("ext/*/theme.php"); foreach ($themelets as $filename) { require_once $filename; } $custom_themelets = glob("themes/{$_theme}/*.theme.php"); if ($custom_themelets) { $m = array();