Autoloader for future mode
[infodrom.org/infocon.infodrom.org] / src / future.php
diff --git a/src/future.php b/src/future.php
new file mode 100644 (file)
index 0000000..ef9a1ff
--- /dev/null
@@ -0,0 +1,18 @@
+<?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);
+