<?php

/**
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package clearFusionCMS\module\dompdf
 * @copyright Copyright (c) 2013 clearFusionCMS. All rights reserved.
 * @link http://clearfusioncms.com
 */

/**
 * dompdfLib Class
 *
 * Class to initialise dompdf.
 *
 * @package clearFusionCMS\module\dompdf
 */
class dompdfLib {

	/**
	 * Loader for dompdf library.
	 *
	 * @param string $class The name of the class to load.
	 */
	static function loader($class) {
		$filename = FLMODPATH . 'dompdf/include/' . mb_strtolower($class) . '.cls.php';
		if(is_readable($filename))
			include $filename;
	}

	/**
	 * Initialise the PDF library.
	 */
	static function init() {
		require_once FLMODPATH . 'dompdf/dompdf_config.inc.php';
		spl_autoload_register('dompdfLib::loader', true, true);
	}
}