Autoloader for future mode
authorJoey Schulze <joey@infodrom.org>
Mon, 14 Dec 2015 21:13:10 +0000 (21:13 +0000)
committerJoey Schulze <joey@infodrom.org>
Mon, 14 Dec 2015 21:13:10 +0000 (21:13 +0000)
src/future.php [new file with mode: 0644]

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);
+