ircbot/AutoLoader.php
Jan Philipp Timme 952af43b97
2010-11-21 22:48:11 +00:00

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);
}
}
?>