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(); } }