Exemple #1
0
function create_tables($dbh)
{
    global $drop_tables, $phpc_includes_path;
    require_once "{$phpc_includes_path}/schema.php";
    foreach (phpc_table_schemas() as $table) {
        $table->create($dbh, $drop_tables);
    }
}
Exemple #2
0
function phpc_updatedb($dbh)
{
    global $phpc_script, $phpcdb;
    $message_tags = tag('div', tag('div', __("Updating calendar")));
    $updated = false;
    foreach (phpc_table_schemas() as $table) {
        $tags = $table->update($dbh);
        $message_tags->add($tags);
        if (sizeof($tags) > 0) {
            $updated = true;
        }
    }
    $phpcdb->set_config("version", PHPC_DB_VERSION);
    if (!$updated) {
        $message_tags->add(tag('div', __('Already up to date.')));
    }
    message_redirect($message_tags, $phpc_script);
}