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); }
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); }