Properties

$_includeFileCache

$_includeFileCache : string

Class map cache file

Type

string

$_loadedPluginPaths

$_loadedPluginPaths : array

Instance loaded plugin paths

Type

array

$_loadedPlugins

$_loadedPlugins : array

Instance loaded plugins

Type

array

$_prefixToPaths

$_prefixToPaths : array

Instance registry property

Type

array

$_staticLoadedPluginPaths

$_staticLoadedPluginPaths : array

Statically loaded plugin path mappings

Type

array

$_staticLoadedPlugins

$_staticLoadedPlugins : array

Statically loaded plugins

Type

array

$_staticPrefixToPaths

$_staticPrefixToPaths : array

Static registry property

Type

array

$_useStaticRegistry

$_useStaticRegistry : string|null

Whether to use a statically named registry for loading plugins

Type

string|null

Methods

__construct()

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

Constructor

Parameters

array $prefixToPaths
string $staticRegistryName

OPTIONAL

addPrefixPath()

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

Add prefixed paths to the registry of paths

Parameters

string $prefix
string $path

Returns

\Zend_Loader_PluginLoader

getPaths()

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

Get path stack

Parameters

string $prefix

Returns

false|array —

False if prefix does not exist, array otherwise

clearPaths()

clearPaths(string  $prefix = null) : boolean

Clear path stack

Parameters

string $prefix

Returns

boolean —

False only if $prefix does not exist

removePrefixPath()

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

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

Parameters

string $prefix
string $path

OPTIONAL

Returns

\Zend_Loader_PluginLoader

isLoaded()

isLoaded(string  $name) : \Zend_Loader_PluginLoader

Whether or not a Plugin by a specific name is loaded

Parameters

string $name

Returns

\Zend_Loader_PluginLoader

getClassName()

getClassName(string  $name) : string|false

Return full class name for a named plugin

Parameters

string $name

Returns

string|false —

False if class not found, class name otherwise

getClassPath()

getClassPath(mixed  $name) : string|false

Get path to plugin class

Parameters

mixed $name

Returns

string|false —

False if not found

load()

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

Load a plugin via the name provided

Parameters

string $name
boolean $throwExceptions

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

Throws

\Zend_Loader_Exception

if class not found

Returns

string|false —

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

setIncludeFileCache()

setIncludeFileCache(string  $file) : void

Set path to class file cache

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

string $file

Throws

\Zend_Loader_PluginLoader_Exception

if file is not writeable or path does not exist

getIncludeFileCache()

getIncludeFileCache() : string|null

Retrieve class file cache path

Returns

string|null

_formatPrefix()

_formatPrefix(string  $prefix) : string

Format prefix for internal use

Parameters

string $prefix

Returns

string

_formatName()

_formatName(string  $name) : string

Normalize plugin name

Parameters

string $name

Returns

string

_appendIncFile()

_appendIncFile(string  $incFile) : void

Append an include_once statement to the class file cache

Parameters

string $incFile