Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

Zend_Loader_Autoloader Class Reference

Public Member Functions

 setDefaultAutoloader ($callback)
 getDefaultAutoloader ()
 setAutoloaders (array $autoloaders)
 getAutoloaders ()
 getNamespaceAutoloaders ($namespace)
 registerNamespace ($namespace)
 unregisterNamespace ($namespace)
 getRegisteredNamespaces ()
 setZfPath ($spec, $version= 'latest')
 getZfPath ()
 suppressNotFoundWarnings ($flag=null)
 setFallbackAutoloader ($flag)
 isFallbackAutoloader ()
 getClassAutoloaders ($class)
 unshiftAutoloader ($callback, $namespace= '')
 pushAutoloader ($callback, $namespace= '')
 removeAutoloader ($callback, $namespace=null)

Static Public Member Functions

static getInstance ()
static resetInstance ()
static autoload ($class)

Protected Member Functions

 __construct ()
 _autoload ($class)
 _setNamespaceAutoloaders (array $autoloaders, $namespace= '')
 _getVersionPath ($path, $version)
 _getVersionType ($version)
 _getAvailableVersions ($path, $version)

Protected Attributes

 $_autoloaders = array()
 $_defaultAutoloader = array('Zend_Loader', 'loadClass')
 $_fallbackAutoloader = false
 $_internalAutoloader
 $_namespaces
 $_namespaceAutoloaders = array()
 $_suppressNotFoundWarnings = false
 $_zfPath

Static Protected Attributes

static $_instance

Detailed Description

Definition at line 35 of file Autoloader.php.


Constructor & Destructor Documentation

__construct (  ) [protected]

Constructor

Registers instance with spl_autoload stack

Returns:
void

Definition at line 455 of file Autoloader.php.


Member Function Documentation

_autoload ( class ) [protected]

Internal autoloader implementation

Parameters:
string$class
Returns:
bool

Definition at line 467 of file Autoloader.php.

_getAvailableVersions ( path,
version 
) [protected]

Get available versions for the version type requested

Parameters:
string$path
string$version
Returns:
array

Definition at line 554 of file Autoloader.php.

_getVersionPath ( path,
version 
) [protected]

Retrieve the filesystem path for the requested ZF version

Parameters:
string$path
string$version
Returns:
void

Definition at line 503 of file Autoloader.php.

_getVersionType ( version ) [protected]

Retrieve the ZF version type

Parameters:
string$version
Returns:
string "latest", "major", "minor", or "specific"
Exceptions:
Zend_Loader_Exceptionif version string contains too many dots

Definition at line 527 of file Autoloader.php.

_setNamespaceAutoloaders ( array $  autoloaders,
namespace = '' 
) [protected]

Set autoloaders for a specific namespace

Parameters:
array$autoloaders
string$namespace
Returns:
Zend_Loader_Autoloader

Definition at line 489 of file Autoloader.php.

static autoload ( class ) [static]

Autoload a class

Parameters:
string$class
Returns:
bool

Definition at line 114 of file Autoloader.php.

getAutoloaders (  )

Get attached autoloader implementations

Returns:
array

Definition at line 182 of file Autoloader.php.

getClassAutoloaders ( class )

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:
string$class
Returns:
array Array of autoloaders to use

Definition at line 329 of file Autoloader.php.

getDefaultAutoloader (  )

Retrieve the default autoloader callback

Returns:
string|array PHP Callback

Definition at line 160 of file Autoloader.php.

static getInstance (  ) [static]

Retrieve singleton instance

Returns:
Zend_Loader_Autoloader

Definition at line 90 of file Autoloader.php.

getNamespaceAutoloaders ( namespace )

Return all autoloaders for a given namespace

Parameters:
string$namespace
Returns:
array

Definition at line 193 of file Autoloader.php.

getRegisteredNamespaces (  )

Get a list of registered autoload namespaces

Returns:
array

Definition at line 251 of file Autoloader.php.

isFallbackAutoloader (  )

Is this instance acting as a fallback autoloader?

Returns:
bool

Definition at line 314 of file Autoloader.php.

pushAutoloader ( callback,
namespace = '' 
)

Append an autoloader to the autoloader stack

Parameters:
object | array | string$callbackPHP callback or Zend_Loader_Autoloader_Interface implementation
string | array$namespaceSpecific namespace(s) under which to register callback
Returns:
Zend_Loader_Autoloader

Definition at line 396 of file Autoloader.php.

registerNamespace ( namespace )

Register a namespace to autoload

Parameters:
string | array$namespace
Returns:
Zend_Loader_Autoloader

Definition at line 208 of file Autoloader.php.

removeAutoloader ( callback,
namespace = null 
)

Remove an autoloader from the autoloader stack

Parameters:
object | array | string$callbackPHP callback or Zend_Loader_Autoloader_Interface implementation
null | string | array$namespaceSpecific namespace(s) from which to remove autoloader
Returns:
Zend_Loader_Autoloader

Definition at line 419 of file Autoloader.php.

static resetInstance (  ) [static]

Reset the singleton instance

Returns:
void

Definition at line 103 of file Autoloader.php.

setAutoloaders ( array $  autoloaders )

Set several autoloader callbacks at once

Parameters:
array$autoloadersArray of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders
Returns:
Zend_Loader_Autoloader

Definition at line 171 of file Autoloader.php.

setDefaultAutoloader ( callback )

Set the default autoloader implementation

Parameters:
string | array$callbackPHP callback
Returns:
void

Definition at line 145 of file Autoloader.php.

setFallbackAutoloader ( flag )

Indicate whether or not this autoloader should be a fallback autoloader

Parameters:
bool$flag
Returns:
Zend_Loader_Autoloader

Definition at line 303 of file Autoloader.php.

suppressNotFoundWarnings ( flag = null )

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

Parameters:
null | bool$flag
Returns:
bool|Zend_Loader_Autoloader Returns boolean if no argument is passed, object instance otherwise

Definition at line 288 of file Autoloader.php.

unregisterNamespace ( namespace )

Unload a registered autoload namespace

Parameters:
string | array$namespace
Returns:
Zend_Loader_Autoloader

Definition at line 230 of file Autoloader.php.

unshiftAutoloader ( callback,
namespace = '' 
)

Add an autoloader to the beginning of the stack

Parameters:
object | array | string$callbackPHP callback or Zend_Loader_Autoloader_Interface implementation
string | array$namespaceSpecific namespace(s) under which to register callback
Returns:
Zend_Loader_Autoloader

Definition at line 373 of file Autoloader.php.


Field Documentation

$_namespaces [protected]
Initial value:
 array(
        'Zend_'  => true,
        'ZendX_' => true,
    )

Definition at line 65 of file Autoloader.php.


The documentation for this class was generated from the following file: