class Psr4Autoloader (View source)

PSR4 Autoloader Class

As implemented by PHP FIG

Methods

void
register()

Register loader with SPL autoloader stack.

void
addNamespace( string $prefix, string $base_dir, bool $prepend = false)

Adds a base directory for a namespace prefix.

mixed
loadClass( string $class)

Loads the class file for a given class name.

Details

at line 33
void register()

Register loader with SPL autoloader stack.

Return Value

void

at line 48
void addNamespace( string $prefix, string $base_dir, bool $prepend = false)

Adds a base directory for a namespace prefix.

Parameters

string $prefix The namespace prefix.
string $base_dir A base directory for class files in the namespace.
bool $prepend If true, prepend the base directory to the stack instead of appending it; this causes it to be searched first rather than last.

Return Value

void

at line 75
mixed loadClass( string $class)

Loads the class file for a given class name.

Parameters

string $class The fully-qualified class name.

Return Value

mixed The mapped file name on success, or boolean false on failure.