17 lines
534 B
PHP
17 lines
534 B
PHP
<?php
|
|
/**
|
|
* Autoloader function.
|
|
* All classes will be in Classes/$Package$/$ClassName$.php
|
|
* @throws Exception_GeneralException
|
|
* @param string $className
|
|
* @return void
|
|
*/
|
|
function __autoload($className) {
|
|
$file = "Classes" . DIRECTORY_SEPARATOR . str_replace("_", DIRECTORY_SEPARATOR, $className) . ".php";
|
|
if(file_exists($file) === TRUE) {
|
|
require_once($file);
|
|
} else {
|
|
throw new Exception_GeneralException("Could not autoload class: '" . $className . "' - File does not exist: '" . $file . "'!", 1289659295);
|
|
}
|
|
}
|
|
?>
|