2010-11-21 23:48:11 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Autoloader function.
|
|
|
|
* All classes will be in Classes/$Package$/$ClassName$.php
|
|
|
|
* @throws Exception_GeneralException
|
|
|
|
* @param string $className
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function __autoload($className) {
|
2011-06-26 17:26:01 +02:00
|
|
|
$file = "Classes" . DIRECTORY_SEPARATOR . str_replace("_", DIRECTORY_SEPARATOR, $className) . ".php";
|
2010-11-21 23:48:11 +01:00
|
|
|
if(file_exists($file) === TRUE) {
|
|
|
|
require_once($file);
|
|
|
|
} else {
|
|
|
|
throw new Exception_GeneralException("Could not autoload class: '" . $className . "' - File does not exist: '" . $file . "'!", 1289659295);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|