\Horde_Autoloader_Default

Default autoloader definition that uses the include path with default class path mappers.

Manages an application's class name to file name mapping conventions. One or more class-to-filename mappers are defined, and are searched in LIFO order.

Summary

Methods
Properties
Constants
registerAutoloader()
loadClass()
addClassPathMapper()
addCallback()
mapToPath()
__construct()
No public properties found
No constants found
_include()
_fileExists()
_lower()
No protected properties found
N/A
No private methods found
$_callbacks
$_mappers
N/A

Properties

$_callbacks

$_callbacks : array

List of callback methods.

Type

array

$_mappers

$_mappers : array

List of classpath mappers.

Type

array

Methods

registerAutoloader()

registerAutoloader() 

Register the autoloader with PHP (in a way to play well with as many configurations as possible).

loadClass()

loadClass(string  $className) : boolean

Loads a class into the current environment by classname.

Parameters

string $className

Classname to load.

Returns

boolean —

True if the class was successfully loaded.

addClassPathMapper()

addClassPathMapper(\Horde_Autoloader_ClassPathMapper  $mapper) : \Horde_Autoloader

Adds a class path mapper to the beginning of the queue.

Parameters

\Horde_Autoloader_ClassPathMapper $mapper

A mapper object.

Returns

\Horde_Autoloader

This instance.

addCallback()

addCallback(string  $class, mixed  $callback) 

Add a callback to run when a class is loaded through loadClass().

Parameters

string $class

The classname.

mixed $callback

The callback to run when the class is loaded.

mapToPath()

mapToPath(string  $className) : mixed

Search registered mappers in LIFO order.

Parameters

string $className

Classname to load.

Returns

mixed —

Pathname to class, or null if not found.

__construct()

__construct() 

_include()

_include(string  $path) : boolean

Include a file.

Parameters

string $path

Pathname of file to include.

Returns

boolean —

Success.

_fileExists()

_fileExists(string  $path) : boolean

Does a file exist?

Parameters

string $path

Pathname of file to check.

Returns

boolean —

Does file exist?

_lower()

_lower(string  $string) : string

Locale independant strtolower() implementation.

Parameters

string $string

The string to convert to lowercase.

Returns

string —

The lowercased string, based on ASCII encoding.