Loader/Autoloader.php
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-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Loader
- Subpackage
- Autoloader
- Version
- $Id: Autoloader.php 25024 2012-07-30 15:08:15Z rob $
\Zend_Loader_Autoloader
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
- \global\Zend_Loader_Autoloader
Properties

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

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

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

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

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

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

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

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

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

_getVersionType(string $version) : stringRetrieve the ZF version type
| Name | Type | Description |
|---|---|---|
| $version | string |
| Type | Description |
|---|---|
| string | "latest", "major", "minor", or "specific" |
| Exception | Description |
|---|---|
| \Zend_Loader_Exception | if version string contains too many dots |

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

autoload(string $class) : boolAutoload a class
| Name | Type | Description |
|---|---|---|
| $class | string |
| Type | Description |
|---|---|
| bool |

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.
| Name | Type | Description |
|---|---|---|
| $class | string |
| Type | Description |
|---|---|
| array | Array of autoloaders to use |

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

getInstance() : \Zend_Loader_AutoloaderRetrieve singleton instance
| Type | Description |
|---|---|
| \Zend_Loader_Autoloader |

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

getRegisteredNamespaces() : arrayGet a list of registered autoload namespaces
| Type | Description |
|---|---|
| array |

isFallbackAutoloader() : boolIs this instance acting as a fallback autoloader?
| Type | Description |
|---|---|
| bool |

pushAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_AutoloaderAppend an autoloader to the autoloader stack
| 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 |
| Type | Description |
|---|---|
| \Zend_Loader_Autoloader |

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

removeAutoloader(object | array | string $callback, null | string | array $namespace = null) : \Zend_Loader_AutoloaderRemove an autoloader from the autoloader stack
| 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 |
| Type | Description |
|---|---|
| \Zend_Loader_Autoloader |

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

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

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

suppressNotFoundWarnings(null | bool $flag = null) : bool | \Zend_Loader_AutoloaderGet or set the value of the "suppress not found warnings" flag
| Name | Type | Description |
|---|---|---|
| $flag | null | bool |
| Type | Description |
|---|---|
| bool | \Zend_Loader_Autoloader | Returns boolean if no argument is passed, object instance otherwise |

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

unshiftAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_AutoloaderAdd an autoloader to the beginning of the stack
| 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 |
| Type | Description |
|---|---|
| \Zend_Loader_Autoloader |