diff --git a/classes/db/abstract.php b/classes/Db/Abstract.php similarity index 100% rename from classes/db/abstract.php rename to classes/Db/Abstract.php diff --git a/classes/db/interface.php b/classes/Db/Interface.php similarity index 100% rename from classes/db/interface.php rename to classes/Db/Interface.php diff --git a/classes/db/mysql.php b/classes/Db/Mysql.php similarity index 100% rename from classes/db/mysql.php rename to classes/Db/Mysql.php diff --git a/classes/db/pgsql.php b/classes/Db/Pgsql.php similarity index 100% rename from classes/db/pgsql.php rename to classes/Db/Pgsql.php diff --git a/include/classloader.php b/include/classloader.php deleted file mode 100644 index 4b8b3738e..000000000 --- a/include/classloader.php +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/include/db.php b/include/db.php index 020fd08a4..28718fb02 100644 --- a/include/db.php +++ b/include/db.php @@ -1,9 +1,13 @@ quote($str); } -?> +?> \ No newline at end of file diff --git a/include/functions.php b/include/functions.php index caea2576a..4dc286eb6 100644 --- a/include/functions.php +++ b/include/functions.php @@ -5,7 +5,19 @@ $fetch_last_error = false; $pluginhost = false; - require_once "classloader.php"; + function __autoload($class) { + $class_file1 = str_replace("_", "/", basename($class)); // PSR-0 + $class_file2 = str_replace("_", "/", strtolower(basename($class))); + + $file1 = dirname(__FILE__)."/../classes/$class_file1.php"; + $file2 = dirname(__FILE__)."/../classes/$class_file2.php"; + + if (file_exists($file1)) { + require $file1; + } elseif (file_exists($file2)) { + require $file2; + } + } mb_internal_encoding("UTF-8"); date_default_timezone_set('UTC'); @@ -3891,4 +3903,4 @@ return in_array($interface, class_implements($class)); } -?> +?> \ No newline at end of file