Property | Type | Description | |
---|---|---|---|
$autoload | boolean | Flag indicating whether plugin classes should be instantiated on demand if they are requested but no instance currently exists | |
$config | Phergie_Config | Phergie_Config instance that should be passed in to any plugin instantiated within the handler | |
$events | Phergie_Event_Handler | Phergie_Event_Handler instance that should be passed in to any plugin instantiated within the handler | |
$iteratorClass | string | Name of the class to use for iterating over all currently loaded plugins | |
$iteratorCollection | |||
$paths | array | Paths in which to search for plugin class files | |
$plugins | array | Current list of plugin instances |
Method | Description | |
---|---|---|
__call ( string $name, array $args ) : void | Proxies method calls to all plugins containing the called method. | |
__construct ( Phergie_Config $config, Phergie_Event_Handler $events ) : void | Constructor to initialize class properties and add the path for core plugins. | |
__get ( string $name ) : Phergie_Plugin_Abstract | Allows plugin instances to be accessed as properties of the handler. | |
__isset ( string $name ) : boolean | Allows plugin instances to be detected as properties of the handler. | |
__unset ( string $name ) : void | Allows plugin instances to be removed as properties of handler. | |
addPath ( string $path, string $prefix = '' ) : Phergie_Plugin_Handler | Adds a path to search for plugin class files. Paths are searched in the reverse order in which they are added. | |
addPlugin ( string | Phergie_Plugin_Abstract $plugin, array $args = null ) : Phergie_Plugin_Abstract | Adds a plugin instance to the handler. | |
addPlugins ( array $plugins ) : Phergie_Plugin_Handler | Adds multiple plugin instances to the handler. | |
count ( ) : integer | Returns the number of plugins contained within the handler. | |
getAutoload ( ) : boolean | Returns the value of a flag used to determine whether plugins should be loaded automatically if they have not been explicitly loaded. | |
getIterator ( $new = true ) : ArrayIterator | Returns an iterator for all currently loaded plugin instances. | |
getPlugin ( string $name ) : Phergie_Plugin_Abstract | Returns the corresponding instance for a specified plugin, loading it if it is not already loaded and autoloading is enabled. | |
getPluginInfo ( string $plugin ) : array | boolean | Returns metadata corresponding to a specified plugin. | |
getPlugins ( array $names = [] ) : array | Returns the corresponding instances for multiple specified plugins, loading them if they are not already loaded and autoloading is enabled. | |
hasPlugin ( string $name ) : boolean | Returns whether or not at least one instance of a specified plugin class is loaded. | |
removePlugin ( string | Phergie_Plugin_Abstract $plugin ) : Phergie_Plugin_Handler | Removes a plugin instance from the handler. | |
setAutoload ( boolean $flag = true ) : Phergie_Plugin_Handler | Sets a flag used to determine whether plugins should be loaded automatically if they have not been explicitly loaded. | |
setIteratorClass ( string $class ) : Phergie_Plugin_Handler | Sets the iterator class used for all currently loaded plugin instances. |
public __construct ( Phergie_Config $config, Phergie_Event_Handler $events ) : void | ||
$config | Phergie_Config | configuration to pass to any instantiated plugin |
$events | Phergie_Event_Handler | event handler to pass to any instantiated plugin |
return | void |
public addPlugin ( string | Phergie_Plugin_Abstract $plugin, array $args = null ) : Phergie_Plugin_Abstract | ||
$plugin | string | Phergie_Plugin_Abstract | Short name of the plugin class or a plugin object |
$args | array | Optional array of arguments to pass to the plugin constructor if a short name is passed for $plugin |
return | Phergie_Plugin_Abstract | New plugin instance |
public addPlugins ( array $plugins ) : Phergie_Plugin_Handler | ||
$plugins | array | List of elements where each is of the form 'ShortPluginName' or array('ShortPluginName', array($arg1, ..., $argN)) |
return | Phergie_Plugin_Handler | Provides a fluent interface |
public getAutoload ( ) : boolean | ||
return | boolean | TRUE if autoloading is enabled, FALSE otherwise |
public getIterator ( $new = true ) : ArrayIterator | ||
return | ArrayIterator |
public getPlugins ( array $names = [] ) : array | ||
$names | array | Optional list of short names of the plugin classes to which the returned plugin list will be limited, defaults to all presently loaded plugins |
return | array | Associative array mapping lowercased plugin class short names to corresponding plugin instances |
public removePlugin ( string | Phergie_Plugin_Abstract $plugin ) : Phergie_Plugin_Handler | ||
$plugin | string | Phergie_Plugin_Abstract | Short name of the plugin class or a plugin object |
return | Phergie_Plugin_Handler | Provides a fluent interface |
public setAutoload ( boolean $flag = true ) : Phergie_Plugin_Handler | ||
$flag | boolean | TRUE to have plugins autoload (default), FALSE otherwise |
return | Phergie_Plugin_Handler | Provides a fluent interface. |
public setIteratorClass ( string $class ) : Phergie_Plugin_Handler | ||
$class | string | Name of a class that extends FilterIterator |
return | Phergie_Plugin_Handler | Provides a fluent API |
protected bool $autoload | ||
return | boolean |
protected Phergie_Config $config | ||
return | Phergie_Config |
protected Phergie_Event_Handler $events | ||
return | Phergie_Event_Handler |
protected string $iteratorClass | ||
return | string |
protected array $paths | ||
return | array |
protected array $plugins | ||
return | array |