Loader/Autoloader.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 license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Loader
- Subpackage
- Autoloader
- Version
- $Id$
\Zend_Loader_Autoloader
Package: Zend_Loader\AutoloaderAutoloader stack and namespace autoloader
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
-
Properties



array $_autoloaders = array()Concrete autoloader callback implementations
Default valuearray()Details- Type
- array



array $_defaultAutoloader = array('Zend_Loader', 'loadClass')Default autoloader callback
Default valuearray('Zend_Loader', 'loadClass')Details- Type
- array



bool $_fallbackAutoloader = falseWhether or not to act as a fallback autoloader
Default valuefalseDetails- Type
- bool



array $_namespaceAutoloaders = array()Namespace-specific autoloaders
Default valuearray()Details- Type
- array



array $_namespaces = array('Zend_' => true, 'ZendX_' => true)Supported namespaces 'Zend' and 'ZendX' by default.
Default valuearray('Zend_' => true, 'ZendX_' => true)Details- Type
- array



bool $_suppressNotFoundWarnings = falseWhether or not to suppress file not found warnings
Default valuefalseDetails- Type
- bool
Methods



_autoload(string $class) : boolInternal autoloader implementation
Parameters| Name | Type | Description |
|---|
| $class | string | |
|---|
Returns 


_getAvailableVersions(string $path, string $version) : arrayGet available versions for the version type requested
Parameters| Name | Type | Description |
|---|
| $path | string | |
|---|
| $version | string | |
|---|
Returns 


_getVersionPath(string $path, string $version) : voidRetrieve the filesystem path for the requested ZF version
Parameters| Name | Type | Description |
|---|
| $path | string | |
|---|
| $version | string | |
|---|



_getVersionType(string $version) : stringRetrieve the ZF version type
Parameters| Name | Type | Description |
|---|
| $version | string | |
|---|
Returns| Type | Description |
|---|
| string | "latest", "major", "minor", or "specific" |
Throws 


_setNamespaceAutoloaders(array $autoloaders, string $namespace = '') : \Zend_Loader_AutoloaderSet autoloaders for a specific namespace
Parameters| Name | Type | Description |
|---|
| $autoloaders | array | |
|---|
| $namespace | string | |
|---|
Returns 


getClassAutoloaders(string $class) : arrayGet autoloaders to use when matching class
Determines if the class matches a registered namespace, and, if so,
returns only the autoloaders for that namespace. Otherwise, it returns
all non-namespaced autoloaders.
Parameters| Name | Type | Description |
|---|
| $class | string | |
|---|
Returns| Type | Description |
|---|
| array | Array of autoloaders to use |



getDefaultAutoloader() : string | arrayRetrieve the default autoloader callback
Returns| Type | Description |
|---|
| string | array | PHP Callback |



getNamespaceAutoloaders(string $namespace) : arrayReturn all autoloaders for a given namespace
Parameters| Name | Type | Description |
|---|
| $namespace | string | |
|---|
Returns 


pushAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_AutoloaderAppend an autoloader to the autoloader stack
Parameters| Name | Type | Description |
|---|
| $callback | object | array | string | PHP callback or Zend_Loader_Autoloader_Interface implementation |
|---|
| $namespace | string | array | Specific namespace(s) under which to register callback |
|---|
Returns 


registerNamespace(string | array $namespace) : \Zend_Loader_AutoloaderRegister a namespace to autoload
Parameters| Name | Type | Description |
|---|
| $namespace | string | array | |
|---|
Returns 


removeAutoloader(object | array | string $callback, null | string | array $namespace = null) : \Zend_Loader_AutoloaderRemove an autoloader from the autoloader stack
Parameters| Name | Type | Description |
|---|
| $callback | object | array | string | PHP callback or Zend_Loader_Autoloader_Interface implementation |
|---|
| $namespace | null | string | array | Specific namespace(s) from which to remove autoloader |
|---|
Returns 


setAutoloaders(array $autoloaders) : \Zend_Loader_AutoloaderSet several autoloader callbacks at once
Parameters| Name | Type | Description |
|---|
| $autoloaders | array | Array of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders |
|---|
Returns 


setDefaultAutoloader(string | array $callback) : voidSet the default autoloader implementation
Parameters| Name | Type | Description |
|---|
| $callback | string | array | PHP callback |
|---|



setFallbackAutoloader(bool $flag) : \Zend_Loader_AutoloaderIndicate whether or not this autoloader should be a fallback autoloader
Parameters| Name | Type | Description |
|---|
| $flag | bool | |
|---|
Returns 


suppressNotFoundWarnings(null | bool $flag = null) : bool | \Zend_Loader_AutoloaderGet or set the value of the "suppress not found warnings" flag
Parameters| Name | Type | Description |
|---|
| $flag | null | bool | |
|---|
Returns 


unregisterNamespace(string | array $namespace) : \Zend_Loader_AutoloaderUnload a registered autoload namespace
Parameters| Name | Type | Description |
|---|
| $namespace | string | array | |
|---|
Returns 


unshiftAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_AutoloaderAdd an autoloader to the beginning of the stack
Parameters| Name | Type | Description |
|---|
| $callback | object | array | string | PHP callback or Zend_Loader_Autoloader_Interface implementation |
|---|
| $namespace | string | array | Specific namespace(s) under which to register callback |
|---|
Returns