generated from jric11/baseProject
Codex's updates...
This commit is contained in:
+13
-11
@@ -13,35 +13,37 @@ class Base_Autoloader {
|
||||
if (function_exists("__autoload")) {
|
||||
spl_autoload_register("__autoload");
|
||||
}
|
||||
|
||||
|
||||
return spl_autoload_register(array("Base_Autoloader", "Load"), true, true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static function Load($pClassName) {
|
||||
|
||||
|
||||
if (class_exists($pClassName, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!preg_match('/\A[A-Za-z_][A-Za-z0-9_]*\z/', $pClassName)) return false;
|
||||
|
||||
// Try for a "classes" Class first, then a "reports" Class.
|
||||
|
||||
$pClassFilePath = "classes/{$pClassName}.php";
|
||||
|
||||
$pClassFilePath = __DIR__ . "/{$pClassName}.php";
|
||||
|
||||
if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) {
|
||||
|
||||
$pClassFilePath = "reports/{$pClassName}.php";
|
||||
|
||||
|
||||
$pClassFilePath = __DIR__ . "/../reports/{$pClassName}.php";
|
||||
|
||||
if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
require($pClassFilePath);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user