Generic plugin class loader

category Zend
package Zend_Loader
subpackage PluginLoader
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Constructor

__construct(array $prefixToPaths = array(), string $staticRegistryName = null

Parameters

$prefixToPaths

array

$staticRegistryName

string

OPTIONAL

Add prefixed paths to the registry of paths

addPrefixPath(string $prefix, string $path) : \Zend_Loader_PluginLoader
inherited_from \Zend_Loader_PluginLoader_Interface::addPrefixPath()

Parameters

$prefix

string

$path

string

Returns

\Zend_Loader_PluginLoader

Clear path stack

clearPaths(string $prefix = null) : boolean

Parameters

$prefix

string

Returns

booleanFalse only if $prefix does not exist

Return full class name for a named plugin

getClassName(string $name) : string | false
inherited_from \Zend_Loader_PluginLoader_Interface::getClassName()

Parameters

$name

string

Returns

stringfalseFalse if class not found, class name otherwise

Get path to plugin class

getClassPath(mixed $name) : string | false

Parameters

$name

mixed

Returns

stringfalseFalse if not found

Retrieve class file cache path

getIncludeFileCache() : string | null
Static

Returns

stringnull

Get path stack

getPaths(string $prefix = null) : false | array

Parameters

$prefix

string

Returns

falsearrayFalse if prefix does not exist, array otherwise

Whether or not a Plugin by a specific name is loaded

isLoaded(string $name) : \Zend_Loader_PluginLoader
inherited_from \Zend_Loader_PluginLoader_Interface::isLoaded()

Parameters

$name

string

Returns

\Zend_Loader_PluginLoader

Load a plugin via the name provided

load(string $name, boolean $throwExceptions = true) : string | false
inherited_from \Zend_Loader_PluginLoader_Interface::load()

Parameters

$name

string

$throwExceptions

boolean

Whether or not to throw exceptions if the class is not resolved

Exceptions

\Zend_Loader_Exception if class not found

Returns

stringfalseClass name of loaded class; false if $throwExceptions if false and no class found

Remove a prefix (or prefixed-path) from the registry

removePrefixPath(string $prefix, string $path = null) : \Zend_Loader_PluginLoader
inherited_from \Zend_Loader_PluginLoader_Interface::removePrefixPath()

Parameters

$prefix

string

$path

string

OPTIONAL

Returns

\Zend_Loader_PluginLoader

Set path to class file cache

setIncludeFileCache(string $file) : void
Static

Specify a path to a file that will add include_once statements for each plugin class loaded. This is an opt-in feature for performance purposes.

Parameters

$file

string

Exceptions

\Zend_Loader_PluginLoader_Exception if file is not writeable or path does not exist

Append an include_once statement to the class file cache

_appendIncFile(string $incFile) : void
Static

Parameters

$incFile

string

Normalize plugin name

_formatName(string $name) : string

Parameters

$name

string

Returns

string

Format prefix for internal use

_formatPrefix(string $prefix) : string

Parameters

$prefix

string

Returns

string

 Properties

 

Class map cache file

$_includeFileCache : string

Default

Static
 

Class map cache file handler

$_includeFileCacheHandler : resource

Default

Static
 

Instance loaded plugin paths

$_loadedPluginPaths : array

Default

array()
 

Instance loaded plugins

$_loadedPlugins : array

Default

array()
 

Instance registry property

$_prefixToPaths : array

Default

array()
 

Statically loaded plugin path mappings

$_staticLoadedPluginPaths : array

Default

array()
Static
 

Statically loaded plugins

$_staticLoadedPlugins : array

Default

array()
Static
 

Static registry property

$_staticPrefixToPaths : array

Default

array()
Static
 

Whether to use a statically named registry for loading plugins

$_useStaticRegistry : string | null

Default

null