function run_update_scripts() { global $path_prefix, $base_url; if (!defined("PEEPAGG_UPDATING")) { define("PEEPAGG_UPDATING", 1); } upd_write("Running database upgrade script ..."); $upd = new db_update_page(); $upd->main(); upd_write("Installing default module settings ..."); if (!(include "{$path_prefix}/db/script_module_settings_data.php")) { throw new PAException(GENERAL_SOME_ERROR, "Unable to install default module settings"); } }
function run_update_scripts($silent = false) { if (!defined("PEEPAGG_UPDATING")) { define("PEEPAGG_UPDATING", 1); } if (!$silent) { upd_write("Running database upgrade script ..."); } $upd = new db_update_page(); $upd->main(); /* No longer used upd_write("Installing default module settings ..."); if (!include("api/DB/script_module_settings_data.php")) throw new PAException(GENERAL_SOME_ERROR, "Unable to install default module settings"); */ }
$res = Dal::query($sql); while(list($tname) = Dal::row($res)) { if ($tname == $tablename) { return TRUE; } } return FALSE; } function column_exists($tablename,$column_name) { $sql = "SHOW COLUMNS FROM $tablename LIKE '%$column_name%'"; $res = Dal::query($sql); if ($res->numrows() > 0) { return TRUE; } else { return FALSE; } } } if (realpath(@$_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) { if (!db_update_page::check_quiet()) { echo "<h1>update PeopleAggregator database schema</h1>"; } $p = new db_update_page(); $p->main(); } ?>