Exemplo n.º 1
0
try {
    // load base files
    ctx_log_start("Opening files");
    $files = array_merge(zglob("core/*.php"), zglob("ext/{" . ENABLED_EXTS . "}/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();
    $config = new DatabaseConfig($database);
    ctx_log_endok();
    // load the theme parts
    ctx_log_start("Loading themelets");
    foreach (_get_themelet_files(get_theme()) as $themelet) {
        require_once $themelet;
    }
    ctx_log_endok();
    _load_extensions();
    // start the page generation waterfall
    $page = class_exists("CustomPage") ? new CustomPage() : new Page();
    $user = _get_user();
    send_event(new InitExtEvent());
    if (!is_cli()) {
        // web request
        send_event(new PageRequestEvent(@$_GET["q"]));
        $page->display();
    } else {
        // command line request
        send_event(new CommandEvent($argv));
Exemplo n.º 2
0
';
$files = array_merge(zglob("core/*.php"), zglob("ext/{" . ENABLED_EXTS . "}/main.php"));
foreach ($files as $filename) {
    $text .= manual_include($filename);
}
$text .= '
	ctx_log_endok();

	ctx_log_start("Connecting to DB");
	// connect to the database
	$database = new Database();
	$database->db->beginTransaction();
	$config = new DatabaseConfig($database);
	ctx_log_endok();
';
foreach (_get_themelet_files(THEME) as $themelet) {
    $text .= manual_include($themelet);
}
$text .= '
	_load_extensions();

	// start the page generation waterfall
	ctx_log_start("Page generation");
	$page = class_exists("CustomPage") ? new CustomPage() : new Page();
	$user = _get_user();
	send_event(new InitExtEvent());
	if(!is_cli()) { // web request
		send_event(new PageRequestEvent(@$_GET["q"]));
		$page->display();
	}
	else { // command line request