+<?php
+function __autoload($class)
+{
+ if (!defined('CLASS_PATH')) throw new Exception('Class path not defined');
+
+ $fname = CLASS_PATH . '/'.strtolower($class).'.class.php';
+
+ if (!file_exists($fname)) throw new Exception(sprintf('Class %s not found', $class));
+
+ require_once($fname);
+}
+
+#global $db;
+
+#$dsn = sprintf('%s:host=%s;dbname=%s', DBDRIVER, DBHOST, DBNAME);
+#$db = new Database(DBDRIVER, DBHOST, DBNAME, DBUSER, DBPASS);
+#if (defined('MAIL_ERROR')) $db->setErrorMail(MAIL_ERROR);
+