21 if (function_exists(
'__autoload')) {
23 spl_autoload_register(
'__autoload');
26 return spl_autoload_register([
'Complex\\Autoloader',
'Load']);
35 public static function Load($pClassName)
37 if ((class_exists($pClassName,
false)) || (strpos($pClassName,
'Complex\\') !== 0)) {
42 $pClassFilePath = __DIR__ . DIRECTORY_SEPARATOR .
43 'src' . DIRECTORY_SEPARATOR .
44 str_replace([
'Complex\\',
'\\'], [
'',
'/'], $pClassName) .
47 if ((file_exists($pClassFilePath) ===
false) || (is_readable($pClassFilePath) ===
false)) {
51 require($pClassFilePath);
static Register()
Register the Autoloader with SPL.
static Load($pClassName)
Autoload a class identified by name.