/** * Init function * @ingroup Core */ function xanth_init() { global $start_time; $start_time = gettimeofday(TRUE); ob_start(); xanth_db_query_reset_count(); set_error_handler('xanth_php_error_handler'); xanth_db_connect(xanth_conf_get('db_host', ''), xanth_conf_get('db_name', ''), xanth_conf_get('db_user', ''), xanth_conf_get('db_pass', ''), xanth_conf_get('db_port', '')); session_set_save_handler("on_session_start", "on_session_end", "on_session_read", "on_session_write", "on_session_destroy", "on_session_gc"); session_start(); xComponent::init_all(); xModule::init_all(); //xTheme::find_default()->init(); xanth_invoke_multi_hook(MULTI_HOOK_PAGE_CREATE_EVT, NULL); xanth_invoke_mono_hook(MONO_HOOK_PAGE_CREATE, NULL); //print log echo '<br />'; echo '<br />'; echo '<br />'; echo '<br />'; echo '<br />'; foreach (xanth_get_screen_log() as $entry) { echo '<br />' . $entry->level . ' ' . $entry->component . ' ' . $entry->message . ' ' . $entry->filename . '@' . $entry->line; } session_write_close(); echo ob_get_clean(); }
function xanth_install_db() { //install core db require_once './engine/install.inc.php'; xanth_db_start_transaction(); xanth_db_install_core(); $weighted_components = array(); foreach (xComponent::find_existing() as $component) { include_once $component->path . '/install.inc.php'; $weight_func = 'xanth_db_install_weight_' . $component->name; $weighted_components[] = array($weight_func(), $component); } usort($weighted_components, 'weight_cmp'); foreach ($weighted_components as $component) { $inst_func = 'xanth_db_install_' . $component[1]->name; $inst_func(); } $weighted_modules = array(); foreach (xModule::find_existing() as $module) { include_once $module->path . '/install.inc.php'; $weight_func = 'xanth_db_install_weight_' . $module->name; $weighted_modules[] = array($weight_func(), $module); } usort($weighted_modules, 'weight_cmp'); foreach ($weighted_modules as $module) { $inst_func = 'xanth_db_install_' . $module[1]->name; $inst_func(); } xanth_db_commit(); }
/** * Include enabled components and call xanth_init_component_[componentname] for every ones. */ function init_all() { //first init constants xComponent::init_all_constants(); foreach (xComponent::find_existing() as $component) { include_once $component->path . $component->name . '.inc.php'; $init_func = "xanth_init_component_" . $component->name; $init_func(); } }