* @package TinyMVC * @version $Id$ * */ /** * custom autoload function * @param string $className */ function __autoload($className) { if($className == 'TinyMVC') { // TinyMVC class is called before include_path setting, so we do the trick here require_once(realpath(dirname(__FILE__)) . '/TinyMVC.class.php'); } else { try { include_once($className . '.class.php'); if(!class_exists($className) && !interface_exists($className)) { throw new TinyMVCException("Unable to load reqired class: $className (include_path='" . ini_get('include_path') . "')"); } } catch(Exception $exception) { $exception->handleException(); } } }