ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Complex\Autoloader Class Reference
+ Collaboration diagram for Complex\Autoloader:

Static Public Member Functions

static Register ()
 Register the Autoloader with SPL. More...
 
static Load ($pClassName)
 Autoload a class identified by name. More...
 

Detailed Description

Definition at line 13 of file Autoloader.php.

Member Function Documentation

◆ Load()

static Complex\Autoloader::Load (   $pClassName)
static

Autoload a class identified by name.

Parameters
string$pClassNameName of the object to load

Definition at line 35 of file Autoloader.php.

36  {
37  if ((class_exists($pClassName, false)) || (strpos($pClassName, 'Complex\\') !== 0)) {
38  // Either already loaded, or not a Complex class request
39  return false;
40  }
41 
42  $pClassFilePath = __DIR__ . DIRECTORY_SEPARATOR .
43  'src' . DIRECTORY_SEPARATOR .
44  str_replace(['Complex\\', '\\'], ['', '/'], $pClassName) .
45  '.php';
46 
47  if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) {
48  // Can't load
49  return false;
50  }
51  require($pClassFilePath);
52  }

◆ Register()

static Complex\Autoloader::Register ( )
static

Register the Autoloader with SPL.

Definition at line 19 of file Autoloader.php.

20  {
21  if (function_exists('__autoload')) {
22  // Register any existing autoloader function with SPL, so we don't get any clashes
23  spl_autoload_register('__autoload');
24  }
25  // Register ourselves with SPL
26  return spl_autoload_register(['Complex\\Autoloader', 'Load']);
27  }

The documentation for this class was generated from the following file: