Example #1
0
 public function option_format($k, $v)
 {
     $formats = array();
     foreach ((array) $v as $i => $val) {
         if (!in_array($val, $formats)) {
             $formats[] = $val;
         }
     }
     Config::set_output_format($formats);
 }
Example #2
0
if (Index::requireIndexing()) {
    v("Indexing...", VERBOSE_INDEXING);
    // Create indexer
    $format = $render->attach(new Index());
    $reader->open(Config::xml_file(), NULL, $readerOpts);
    $render->execute($reader);
    $render->detach($format);
    v("Indexing done", VERBOSE_INDEXING);
} else {
    v("Skipping indexing", VERBOSE_INDEXING);
}
foreach ((array) Config::package() as $package) {
    $factory = Format_Factory::createFactory($package);
    // Default to all output formats specified by the package
    if (count(Config::output_format()) == 0) {
        Config::set_output_format((array) $factory->getOutputFormats());
    }
    // Register the formats
    foreach (Config::output_format() as $format) {
        $render->attach($factory->createFormat($format));
    }
}
// Render formats
$reader = make_reader();
$reader->open(Config::xml_file(), NULL, $readerOpts);
foreach ($render as $format) {
    $format->notify(Render::VERBOSE, true);
}
$render->execute($reader);
v("Finished rendering", VERBOSE_FORMAT_RENDERING);
/*