Example #1
0
function fs_activate()
{
    $FS_PATH = fs_get_firestats_path();
    if (!$FS_PATH) {
        return;
    }
    require_once $FS_PATH . '/php/db-setup.php';
    fs_install();
    fs_register_wordpress();
    fs_update_post_titles();
}
Example #2
0
function fs_ajax_install_db_tables(&$response)
{
    if (!fs_ajax_assert_admin($response)) {
        return;
    }
    if (!fs_ajax_attach_to_database($response)) {
        return;
    }
    # force databae connection to be re-initialized
    fs_get_db_conn(true);
    ob_start();
    $res = fs_install();
    $output = ob_get_clean();
    if (!$res) {
        ajax_error($response, fs_r('Error installing tables') . ': ' . $output);
    } else {
        $response['db_status'] = 'ok';
        fs_sendDBConfig($response);
    }
}