Loader/ClassMapAutoloader.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Loader
\Zend_Loader_ClassMapAutoloader
Class-map autoloader
Utilizes class-map files to lookup classfile locations.
- Implements
- \Zend_Loader_SplAutoloader
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD {@link http://framework.zend.com/license/new-bsd}
Properties
Methods

__construct(null | array | \Traversable $options = null) : voidConstructor
Create a new instance, and optionally configure the autoloader.
| Name | Type | Description |
|---|---|---|
| $options | null | array | \Traversable |

autoload(string $class) : voidDefined by Autoloadable
| Name | Type | Description |
|---|---|---|
| $class | string |

concatPharParts(string $part) : boolHelper callback for filtering phar paths
| Name | Type | Description |
|---|---|---|
| $part | string |
| Type | Description |
|---|---|
| bool |

loadMapFromFile(string $location) : \Zend_Loader_ClassMapAutoloader | mixedLoad 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.
| Name | Type | Description |
|---|---|---|
| $location | string |
| Type | Description |
|---|---|
| \Zend_Loader_ClassMapAutoloader | mixed |
| Exception | Description |
|---|---|
| \Zend_Loader_Exception_InvalidArgumentException | for nonexistent locations |

realPharPath(string $path) : stringResolve the real_path() to a file within a phar.
| Name | Type | Description |
|---|---|---|
| $path | string |
| Type | Description |
|---|---|
| string |
- See
- \global\https://bugs.php.net/bug.php?id=52769

register() : voidRegister the autoloader with spl_autoload registry
Typically, the body of this will simply be:
spl_autoload_register(array($this, 'autoload'));

registerAutoloadMap( $map) : \Zend_Loader_ClassMapAutoloaderRegister 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.
| Name | Type | Description |
|---|---|---|
| $map |
| Type | Description |
|---|---|
| \Zend_Loader_ClassMapAutoloader |

registerAutoloadMaps(array $locations) : \Zend_Loader_ClassMapAutoloaderRegister many autoload maps at once
| Name | Type | Description |
|---|---|---|
| $locations | array |
| Type | Description |
|---|---|
| \Zend_Loader_ClassMapAutoloader |

resolvePharParentPath(string $value, int $key, array $parts) : voidHelper callback to resolve a parent path in a Phar archive
| Name | Type | Description |
|---|---|---|
| $value | string | |
| $key | int | |
| $parts | array |

setOptions(array | \Traversable $options) : \Zend_Loader_ClassMapAutoloaderConfigure the autoloader
Proxies to registerAutoloadMaps().
| Name | Type | Description |
|---|---|---|
| $options | array | \Traversable |
| Type | Description |
|---|---|
| \Zend_Loader_ClassMapAutoloader |