Loader/Autoloader.php

Show: PublicProtectedPrivateinherited
Table of Contents
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\Autoloader
Autoloader stack and namespace autoloader
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
 

Properties

>VPropertyprotectedarray $_autoloaders = array()

Concrete autoloader callback implementations

Default valuearray()Details
Type
array
>VPropertyprotectedarray $_defaultAutoloader = array('Zend_Loader', 'loadClass')

Default autoloader callback

Default valuearray('Zend_Loader', 'loadClass')Details
Type
array
>VPropertyprotectedbool $_fallbackAutoloader = false

Whether or not to act as a fallback autoloader

Default valuefalseDetails
Type
bool
>VPropertyprotected\Zend_Loader_Autoloader $_instance
static

Singleton instance

>VPropertyprotectedarray $_internalAutoloader

Callback for internal autoloader implementation

Details
Type
array
>VPropertyprotectedarray $_namespaceAutoloaders = array()

Namespace-specific autoloaders

Default valuearray()Details
Type
array
>VPropertyprotectedarray $_namespaces = array('Zend_' => true, 'ZendX_' => true)

Supported namespaces 'Zend' and 'ZendX' by default.

Default valuearray('Zend_' => true, 'ZendX_' => true)Details
Type
array
>VPropertyprotectedbool $_suppressNotFoundWarnings = false

Whether or not to suppress file not found warnings

Default valuefalseDetails
Type
bool
>VPropertyprotectednull|string $_zfPath
Details
Type
null | string

Methods

methodprotected__construct() : void

Constructor

Registers instance with spl_autoload stack
methodprotected_autoload(string $class) : bool

Internal autoloader implementation

Parameters
NameTypeDescription
$classstring
Returns
TypeDescription
bool
methodprotected_getAvailableVersions(string $path, string $version) : array

Get available versions for the version type requested

Parameters
NameTypeDescription
$pathstring
$versionstring
Returns
TypeDescription
array
methodprotected_getVersionPath(string $path, string $version) : void

Retrieve the filesystem path for the requested ZF version

Parameters
NameTypeDescription
$pathstring
$versionstring
methodprotected_getVersionType(string $version) : string

Retrieve the ZF version type

Parameters
NameTypeDescription
$versionstring
Returns
TypeDescription
string"latest", "major", "minor", or "specific"
Throws
ExceptionDescription
\Zend_Loader_Exceptionif version string contains too many dots
methodprotected_setNamespaceAutoloaders(array $autoloaders, string $namespace = '') : \Zend_Loader_Autoloader

Set autoloaders for a specific namespace

Parameters
NameTypeDescription
$autoloadersarray
$namespacestring
Returns
TypeDescription
\Zend_Loader_Autoloader
methodpublicautoload(string $class) : bool
static

Autoload a class

Parameters
NameTypeDescription
$classstring
Returns
TypeDescription
bool
methodpublicgetAutoloaders() : array

Get attached autoloader implementations

Returns
TypeDescription
array
methodpublicgetClassAutoloaders(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
NameTypeDescription
$classstring
Returns
TypeDescription
arrayArray of autoloaders to use
methodpublicgetDefaultAutoloader() : string | array

Retrieve the default autoloader callback

Returns
TypeDescription
string | arrayPHP Callback
methodpublicgetInstance() : \Zend_Loader_Autoloader
static

Retrieve singleton instance

Returns
TypeDescription
\Zend_Loader_Autoloader
methodpublicgetNamespaceAutoloaders(string $namespace) : array

Return all autoloaders for a given namespace

Parameters
NameTypeDescription
$namespacestring
Returns
TypeDescription
array
methodpublicgetRegisteredNamespaces() : array

Get a list of registered autoload namespaces

Returns
TypeDescription
array
methodpublicgetZfPath() : void

methodpublicisFallbackAutoloader() : bool

Is this instance acting as a fallback autoloader?

Returns
TypeDescription
bool
methodpublicpushAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_Autoloader

Append an autoloader to the autoloader stack

Parameters
NameTypeDescription
$callbackobject | array | string

PHP callback or Zend_Loader_Autoloader_Interface implementation

$namespacestring | array

Specific namespace(s) under which to register callback

Returns
TypeDescription
\Zend_Loader_Autoloader
methodpublicregisterNamespace(string | array $namespace) : \Zend_Loader_Autoloader

Register a namespace to autoload

Parameters
NameTypeDescription
$namespacestring | array
Returns
TypeDescription
\Zend_Loader_Autoloader
methodpublicremoveAutoloader(object | array | string $callback, null | string | array $namespace = null) : \Zend_Loader_Autoloader

Remove an autoloader from the autoloader stack

Parameters
NameTypeDescription
$callbackobject | array | string

PHP callback or Zend_Loader_Autoloader_Interface implementation

$namespacenull | string | array

Specific namespace(s) from which to remove autoloader

Returns
TypeDescription
\Zend_Loader_Autoloader
methodpublicresetInstance() : void
static

Reset the singleton instance

methodpublicsetAutoloaders(array $autoloaders) : \Zend_Loader_Autoloader

Set several autoloader callbacks at once

Parameters
NameTypeDescription
$autoloadersarray

Array of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders

Returns
TypeDescription
\Zend_Loader_Autoloader
methodpublicsetDefaultAutoloader(string | array $callback) : void

Set the default autoloader implementation

Parameters
NameTypeDescription
$callbackstring | array

PHP callback

methodpublicsetFallbackAutoloader(bool $flag) : \Zend_Loader_Autoloader

Indicate whether or not this autoloader should be a fallback autoloader

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Loader_Autoloader
methodpublicsetZfPath( $spec,  $version = 'latest') : void

Parameters
NameTypeDescription
$spec
$version
methodpublicsuppressNotFoundWarnings(null | bool $flag = null) : bool | \Zend_Loader_Autoloader

Get or set the value of the "suppress not found warnings" flag

Parameters
NameTypeDescription
$flagnull | bool
Returns
TypeDescription
bool | \Zend_Loader_AutoloaderReturns boolean if no argument is passed, object instance otherwise
methodpublicunregisterNamespace(string | array $namespace) : \Zend_Loader_Autoloader

Unload a registered autoload namespace

Parameters
NameTypeDescription
$namespacestring | array
Returns
TypeDescription
\Zend_Loader_Autoloader
methodpublicunshiftAutoloader(object | array | string $callback, string | array $namespace = '') : \Zend_Loader_Autoloader

Add an autoloader to the beginning of the stack

Parameters
NameTypeDescription
$callbackobject | array | string

PHP callback or Zend_Loader_Autoloader_Interface implementation

$namespacestring | array

Specific namespace(s) under which to register callback

Returns
TypeDescription
\Zend_Loader_Autoloader
Documentation was generated by phpDocumentor 2.2.0 .