17 lines
497 B
PHP
17 lines
497 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/" . str_replace("_", "/", $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);
|
||
|
}
|
||
|
}
|
||
|
?>
|