Documentation

Horde_Autoloader
in package

Horde autoloader implementation.

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.

Tags
author

Bob Mckee bmckee@bywires.com

author

Chuck Hagenbuch chuck@horde.org

category

Horde

copyright

2008-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

$_callbacks  : array<string|int, mixed>
List of callback methods.
$_mappers  : array<string|int, mixed>
List of classpath mappers.
addCallback()  : mixed
Add a callback to run when a class is loaded through loadClass().
addClassPathMapper()  : Horde_Autoloader
Adds a class path mapper to the beginning of the queue.
loadClass()  : bool
Loads a class into the current environment by classname.
mapToPath()  : mixed
Search registered mappers in LIFO order.
registerAutoloader()  : mixed
Register the autoloader with PHP (in a way to play well with as many configurations as possible).
_fileExists()  : bool
Does a file exist?
_include()  : bool
Include a file.
_lower()  : string
Locale independant strtolower() implementation.

Properties

$_callbacks

List of callback methods.

private array<string|int, mixed> $_callbacks = array()

$_mappers

List of classpath mappers.

private array<string|int, mixed> $_mappers = array()

Methods

addCallback()

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

public addCallback(string $class, mixed $callback) : mixed
Parameters
$class : string

The classname.

$callback : mixed

The callback to run when the class is loaded.

Return values
mixed

loadClass()

Loads a class into the current environment by classname.

public loadClass(string $className) : bool
Parameters
$className : string

Classname to load.

Return values
bool

True if the class was successfully loaded.

mapToPath()

Search registered mappers in LIFO order.

public mapToPath(string $className) : mixed
Parameters
$className : string

Classname to load.

Return values
mixed

Pathname to class, or null if not found.

registerAutoloader()

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

public registerAutoloader() : mixed
Return values
mixed

_fileExists()

Does a file exist?

protected _fileExists(string $path) : bool
Parameters
$path : string

Pathname of file to check.

Return values
bool

Does file exist?

_include()

Include a file.

protected _include(string $path) : bool
Parameters
$path : string

Pathname of file to include.

Return values
bool

Success.

_lower()

Locale independant strtolower() implementation.

protected _lower(string $string) : string
Parameters
$string : string

The string to convert to lowercase.

Return values
string

The lowercased string, based on ASCII encoding.

Search results