<?php
include_once(dirname(__FILE__) . '/printer.inc.php');

// printer goes here
include_once(dirname(__FILE__) . '/printers/default.inc.php');

class BibtexPrinterFactory {
	private static $printers = array();

	public static function init() {
		self::$printers = array(
			'default' => new DefaultBibtexPrinter(),
		);
	}

	public static function getPrinter($name) {
		$result = self::$printers[$name];
		if(!$result)
			throw new Exception('BibtexPrinter not found: ' . $name);

		return $result;
	}

	public static function getAvailablePrinters() {
		return array_keys(self::$printers);
	}
}

BibtexPrinterFactory::init();
?>
