Zend Framework  2.4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ClassMapAutoloader Class Reference

Class-map autoloader. More...

Public Member Functions

 __construct ($options=null)
 Constructor.
 
 setOptions ($options)
 Configure the autoloader.
 
 registerAutoloadMap ($map)
 Register an autoload map.
 
 registerAutoloadMaps ($locations)
 Register many autoload maps at once.
 
 getAutoloadMap ()
 Retrieve current autoload map.
 
 autoload ($class)
 Autoload a class.
Parameters
$class
Returns
mixed False [if unable to load $class] get_class($class) [if $class is successfully loaded]

 
 register ()
 Register the autoloader with spl_autoload registry.
 

Static Public Member Functions

static realPharPath ($path)
 Resolve the real_path() to a file within a phar.
 

Protected Member Functions

 loadMapFromFile ($location)
 Load a map from a file.
 

Protected Attributes

 $mapsLoaded = array()
 
 $map = array()
 

Detailed Description

Class-map autoloader.

Utilizes class-map files to lookup classfile locations.

Constructor & Destructor Documentation

__construct (   $options = null)

Constructor.

Create a new instance, and optionally configure the autoloader.

Parameters
null | array | Traversable$options

Implements SplAutoloader.

Member Function Documentation

autoload (   $class)

Autoload a class.

Parameters
$class
Returns
mixed False [if unable to load $class] get_class($class) [if $class is successfully loaded]

Implements SplAutoloader.

getAutoloadMap ( )

Retrieve current autoload map.

Returns
array
loadMapFromFile (   $location)
protected

Load a map from a file.

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

Parameters
string$location
Returns
ClassMapAutoloader|mixed
Exceptions
Exception\InvalidArgumentExceptionfor nonexistent locations
static realPharPath (   $path)
static

Resolve the real_path() to a file within a phar.

See Also
https://bugs.php.net/bug.php?id=52769
Parameters
string$path
Returns
string
register ( )

Register the autoloader with spl_autoload registry.

Returns
void

Implements SplAutoloader.

registerAutoloadMap (   $map)

Register an autoload map.

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
string | array$map
Exceptions
Exception\InvalidArgumentException
Returns
ClassMapAutoloader
registerAutoloadMaps (   $locations)

Register many autoload maps at once.

Parameters
array$locations
Exceptions
Exception\InvalidArgumentException
Returns
ClassMapAutoloader
setOptions (   $options)

Configure the autoloader.

Proxies to registerAutoloadMaps().

Parameters
array | Traversable$options
Returns
ClassMapAutoloader

Implements SplAutoloader.

Member Data Documentation

$map = array()
protected
$mapsLoaded = array()
protected