Example #1
0
if (!is_dir(Config::xml_root()) || !is_file(Config::xml_file())) {
    trigger_error("No Docbook file given. Specify it on the command line with --docbook.", E_USER_ERROR);
}
if (!file_exists(Config::output_dir())) {
    v("Creating output directory..", VERBOSE_MESSAGES);
    if (!mkdir(Config::output_dir(), 0777, True)) {
        v("Can't create output directory : %s", Config::output_dir(), E_USER_ERROR);
    }
} elseif (!is_dir(Config::output_dir())) {
    v("Output directory is not a file?", E_USER_ERROR);
}
// This needs to be moved. Preferably into the PHP package.
if (!$conf) {
    Config::init(array("lang_dir" => __INSTALLDIR__ . DIRECTORY_SEPARATOR . "phpdotnet" . DIRECTORY_SEPARATOR . "phd" . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "langs" . DIRECTORY_SEPARATOR, "phpweb_version_filename" => Config::xml_root() . DIRECTORY_SEPARATOR . 'version.xml', "phpweb_acronym_filename" => Config::xml_root() . DIRECTORY_SEPARATOR . 'entities' . DIRECTORY_SEPARATOR . 'acronyms.xml'));
}
if (Config::saveconfig()) {
    v("Writing the config file", VERBOSE_MESSAGES);
    file_put_contents("phd.config.php", "<?php\nreturn " . var_export(Config::getAllFiltered(), 1) . ";");
}
if (Config::quit()) {
    exit(0);
}
function make_reader()
{
    //Partial Rendering
    $idlist = Config::render_ids() + Config::skip_ids();
    if (!empty($idlist)) {
        v("Running partial build", VERBOSE_RENDER_STYLE);
        $reader = new Reader_Partial();
    } else {
        v("Running full build", VERBOSE_RENDER_STYLE);