/**
 * Uninstall the custom infrastsructure set up here by the plugin
 */
function clean_out_dictionary_data()
{
    $delete_taxonomies = $_POST['delete_taxonomies'];
    //deletes the xhtml file, if still there because import didn't get completed
    $import = new sil_pathway_xhtml_Import();
    $file = $import->get_latest_xhtmlfile();
    if (isset($file->ID)) {
        wp_delete_attachment($file->ID);
    }
    // Remove all the old dictionary entries.
    remove_entries();
    // Uninstall the custom table(s) and taxonomies.
    if ($delete_taxonomies == 1) {
        unregister_custom_taxonomies();
    }
    uninstall_custom_tables();
    // Reinstall custom table(s) and taxonomies.
    create_search_tables();
    if ($delete_taxonomies == 1) {
        register_semantic_domains_taxonomy();
        register_part_of_speech_taxonomy();
        register_language_taxonomy();
    }
}
    require $argv[1] . "wp-load.php";
    switch_to_blog($argv[2]);
    require $argv[1] . "wp-content/plugins/sil-dictionary-webonary/include/infrastructure.php";
    install_sil_dictionary_infrastructure();
    require $argv[1] . "wp-content/plugins/sil-dictionary-webonary/include/xhtml-importer.php";
    //it isn't actually from the api, but saves us renaming the variable to "background" or something like that...
    $api = true;
    $verbose = true;
    $filetype = $argv[3];
    $xhtmlFileURL = $argv[4];
} else {
    $api = false;
    $verbose = false;
}
global $wpdb;
$import = new sil_pathway_xhtml_Import();
$import->api = $api;
$import->verbose = $verbose;
$xhtml_file = file_get_contents($xhtmlFileURL);
if ($xhtml_file == null) {
    echo "<div style=color:red>ERROR: XHTML file empty. Try uploading again.</div><br>";
    return;
}
update_option("importStatus", $filetype);
// Some of these variables could eventually become user options.
$dom = new DOMDocument('1.0', 'utf-8');
$dom->preserveWhiteSpace = false;
$dom->loadXML($xhtml_file);
$dom_xpath = new DOMXPath($dom);
$dom_xpath->registerNamespace('xhtml', 'http://www.w3.org/1999/xhtml');
/*