private function loadPackageHandlers() { $packageList = Config::getSupportedPackages(); $list = array(); foreach ($packageList as $package) { if ($handler = Format_Factory::createFactory($package)->getOptionsHandler()) { $list[strtolower($package)] = $handler; } } return $list; }
/** * Prints out the current PhD and PHP version. * Exits directly. * * @return void */ public function option_version($k, $v) { $color = Config::phd_info_color(); $output = Config::phd_info_output(); fprintf($output, "%s\n", term_color('PhD Version: ' . Config::VERSION, $color)); $packageList = Config::getSupportedPackages(); foreach ($packageList as $package) { $version = Format_Factory::createFactory($package)->getPackageVersion(); fprintf($output, "\t%s: %s\n", term_color($package, $color), term_color($version, $color)); } fprintf($output, "%s\n", term_color('PHP Version: ' . phpversion(), $color)); fprintf($output, "%s\n", term_color(Config::copyright(), $color)); exit(0); }
$readerOpts |= LIBXML_XINCLUDE; } // Indexing 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); }
public function option_list($k, $v) { $packageList = Config::getSupportedPackages(); echo "Supported packages:\n"; foreach ($packageList as $package) { $formats = Format_Factory::createFactory($package)->getOutputFormats(); echo "\t" . $package . "\n\t\t" . implode("\n\t\t", $formats) . "\n"; } exit(0); }