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();
}
 /**
  *
  */
 function find_enabled()
 {
     $enabled_mod = array();
     foreach (xModule::find_existing() as $module) {
         $result = xanth_db_query("SELECT enabled FROM modules WHERE name = '%s'", $module->name);
         if ($row = xanth_db_fetch_array($result)) {
             if ($row['enabled'] !== 0) {
                 $enabled_mod[] = $module;
             }
         }
     }
     return $enabled_mod;
 }