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 [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
- Subpackage
- Autoloader
- Version
- $Id: Autoloader.php 25024 2012-07-30 15:08:15Z rob $
\Zend_Loader_Autoloader
Package: Zend\Loader\AutoloaderAutoloader stack and namespace 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()
<p>Concrete autoloader callback implementations</p>
Default valuearray()
Details
- Type
- array



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



bool $_fallbackAutoloader = false
<p>Whether or not to act as a fallback autoloader</p>
Default valuefalse
Details
- Type
- bool



\Zend_Loader_Autoloader $_instance =
static<p>Singleton instance</p>



array $_internalAutoloader =
<p>Callback for internal autoloader implementation</p>



array $_namespaceAutoloaders = array()
<p>Namespace-specific autoloaders</p>
Default valuearray()
Details
- Type
- array



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



bool $_suppressNotFoundWarnings = false
<p>Whether or not to suppress file not found warnings</p>
Default valuefalse
Details
- Type
- bool
Methods



_autoload(string $class) : bool
Internal autoloader implementation
Parameters
Name |
Type |
Description |
$class |
string |
|
Returns



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



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



_getVersionType(string $version) : string
Retrieve 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_Autoloader
Set autoloaders for a specific namespace
Parameters
Name |
Type |
Description |
$autoloaders |
array |
|
$namespace |
string |
|
Returns



getClassAutoloaders(string $class) : array
Get 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 | array
Retrieve the default autoloader callback
Returns
Type |
Description |
string | array |
PHP Callback |



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



pushAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_Autoloader
Append 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_Autoloader
Register a namespace to autoload
Parameters
Name |
Type |
Description |
$namespace |
string | array |
|
Returns



removeAutoloader(object | array | string $callback, null | string | array $namespace = null) : \Zend_Loader_Autoloader
Remove 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_Autoloader
Set 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) : void
Set the default autoloader implementation
Parameters
Name |
Type |
Description |
$callback |
string | array |
PHP callback |



setFallbackAutoloader(bool $flag) : \Zend_Loader_Autoloader
Indicate 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_Autoloader
Get or set the value of the "suppress not found warnings" flag
Parameters
Name |
Type |
Description |
$flag |
null | bool |
|
Returns
Type |
Description |
bool | \Zend_Loader_Autoloader
|
Returns boolean if no argument is passed, object instance otherwise |



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



unshiftAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_Autoloader
Add 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