class MapClassLoader

A class loader that uses a mapping file to look up paths.

Methods

__construct(array $map)

Constructor.

register(Boolean $prepend = false)

Registers this instance as an autoloader.

loadClass(string $class)

Loads the given class or interface.

string|null
findFile(string $class)

Finds the path to the file where the class is defined.

Details

at line line 28
__construct(array $map)

Constructor.

Parameters

array $map A map where keys are classes and values the absolute file path

at line line 38
register(Boolean $prepend = false)

Registers this instance as an autoloader.

Parameters

Boolean $prepend Whether to prepend the autoloader or not

at line line 48
loadClass(string $class)

Loads the given class or interface.

Parameters

string $class The name of the class

at line line 62
string|null findFile(string $class)

Finds the path to the file where the class is defined.

Parameters

string $class The name of the class

Return Value

string|null The path, if found