Class-map autoloader

Utilizes class-map files to lookup classfile locations.

catebory ZendX
package ZendX_Loader
copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD {@link http://framework.zend.com/license/new-bsd}

 Methods

Constructor

__construct(null | array | \Traversable $options) : void

Create a new instance, and optionally configure the autoloader.

Parameters

$options

nullarray\Traversable

Defined by Autoloadable

autoload(string $class) : void

Parameters

$class

string

Retrieve current autoload map

getAutoloadMap() : array

Returns

array

Register the autoloader with spl_autoload registry

register() : void

Typically, the body of this will simply be:

spl_autoload_register(array($this, 'autoload'));

Register an autoload map

registerAutoloadMap($map) : \ClassMapAutoloader

An autoload map may be either an associative array, or a file returning an associative array.

An autoload map should be an associative array containing classname/file pairs.

Parameters

$map

Returns

\ClassMapAutoloader

Register many autoload maps at once

registerAutoloadMaps(array $locations) : \ClassMapAutoloader

Parameters

$locations

array

Returns

\ClassMapAutoloader

Configure the autoloader

setOptions(array | \Traversable $options) : \ClassMapAutoloader

Proxies to registerAutoloadMaps().

Parameters

$options

array\Traversable

Returns

\ClassMapAutoloader

Load a map from a file

loadMapFromFile(string $location) : \ClassMapAutoloader | mixed

If the map has been previously loaded, returns the current instance; otherwise, returns whatever was returned by calling include() on the location.

Parameters

$location

string

Exceptions

\Exception\InvalidArgumentException for nonexistent locations

Returns

\ClassMapAutoloadermixed

 Properties

 

Class name/filename map

$map : array

 

Registry of map files that have already been loaded

$mapsLoaded : array