Свойство | Type | Description | |
---|---|---|---|
$trace | Whether or not to trace some event information. |
Свойство | Type | Description | |
---|---|---|---|
$alternatePluginSearchPaths | |||
$enabledPlugins | A simple list of enabled plugins. | ||
$instances | An array of the instances of plugins. | ||
$pluginCache | Available plugins. Never access this directly, instead use $this->AvailablePlugins(); | ||
$pluginFoldersByPath | array | ||
$pluginSearchPaths | Search paths for plugins and their files. | ||
$pluginsByClass | array |
Méthode | Description | |
---|---|---|
__construct ( |
Initialize a new instance of the {@link Gdn_PluginManager} class. | |
addSearchPath ( ) : boolean | TODO: Remove this. | |
availablePluginFolders ( null $SearchPath = null ) : array | mixed | ||
availablePlugins ( ) | Get a list of available plugins. | |
calcOldInfoArray ( |
Calculate an old info array from a new {@link Addon}. | |
callEventHandler ( object $Sender, string $EventClassName, string $EventName, string $EventHandlerType = 'Handler', array $Options = [] ) : mixed | Call a single event handler. | |
callEventHandlers ( object $Sender, string $EventClassName, string $EventName, string $EventHandlerType = 'Handler' ) : boolean | Transfer control to the plugins. | |
callMethodOverride ( object $Sender, string $ClassName, string $MethodName ) : mixed | Looks through $this->_MethodOverrideCollection for a matching method signature to override. | |
callNewMethod ( object $Sender, string $ClassName, string $MethodName ) : mixed | Looks through the registered new methods for a matching method signature to call. | |
checkPlugin ( string $pluginName ) : boolean | Check whether a plugin is enabled. | |
clearPluginCache ( ) | The {@link AddonManager} does all this now. | |
disablePlugin ( string $pluginName ) : boolean | Disable a plugin. | |
enablePlugin ( $pluginName, Gdn_Validation $validation, boolean $setup = true ) : boolean | ||
enabledPluginFolders ( null $SearchPath = null ) : array | ||
enabledPlugins ( ) : array | Get a list of all of the enabled plugins. | |
findPluginFile ( string $path ) : string | false | Deprecated. | |
forceAutoloaderIndex ( ) | The {@link AddonManager} does all this now. | |
getCallback ( string $ClassName, string $MethodName, string $Type = 'Create' ) : callback | Get the callback for an event handler. | |
getEventHandlers ( $Sender, $EventName, string $HandlerType = 'Handler', array $Options = [] ) : array | ||
getPluginInfo ( string $name, string $accessType = self::ACCESS_PLUGINNAME ) : boolean | array | Get the information array for a plugin. | |
getPluginInstance ( string $name, string $accessType = self::ACCESS_CLASSNAME, mixed $sender = null ) : Gdn_IPlugin | Gets an instance of a given plugin. | |
hasMethodOverride ( string $ClassName, string $MethodName ) : boolean | Checks to see if there are any plugins that override the method being executed. | |
hasNewMethod ( string $ClassName, string $MethodName ) : boolean | Checks to see if there are any plugins that create the method being executed. | |
includePlugins ( ) | Includes all of the plugin files for enabled plugins. | |
indexSearchPath ( string $SearchPath, &$PluginInfo, &$ClassInfo, array | null $PathListing = null ) : boolean | string | TODO: Remove this method. | |
isEnabled ( string $Name ) : boolean | Returns whether or not a plugin is enabled. | |
registerCallback ( string $eventName, callable $callback ) | Register a a callback to handle an event. | |
registerHandler ( string $HandlerClassName, string $HandlerMethodName, string $EventClassName = '', string $EventName = '', string $EventHandlerType = '' ) | Registers a plugin method name as a handler. | |
registerNewMethod ( string $NewMethodClassName, string $NewMethodName, string $EventClassName = '', string $EventName = '' ) | Registers a plugin new method. | |
registerOverride ( string $OverrideClassName, string $OverrideMethodName, string $EventClassName = '', string $EventName = '' ) | Registers a plugin override method. | |
registerPlugin ( $ClassName ) | ||
registerPlugins ( ) | Register all enabled plugins' event handlers and overrides. | |
registeredPlugins ( ) : array | ||
removeMobileUnfriendlyPlugins ( ) | Removes all plugins that are marked as mobile unfriendly. | |
removeSearchPath ( ) : boolean | TODO: Remove this. | |
scanPluginFile ( $PluginFile, null $VariableName = null ) : null | void | ||
searchPaths ( boolean $OnlyCustom = false ) : array | Get the current search paths | |
splitAuthors ( string $authorsString, string $format = 'html' ) : array | string | Split a string containing several authors. | |
start ( ) | Set up the plugin framework. | |
started ( ) : boolean | Is the plugin manager started? | |
testPlugin ( string $PluginName ) | Test to see if a plugin throws fatal errors. | |
unregisterPlugin ( $PluginClassName ) : boolean |
Méthode | Description | |
---|---|---|
enableAddon ( |
Enable an addon and do all the stuff that's entailed there. | |
findPluginFileOld ( string $path ) : string | false | Find a plugin file using the old plugin manager method. | |
pluginHook ( string $pluginName, string $forAction, boolean $callback = false ) : void | Hooks to the various actions, i.e. enable, disable and load. | |
removeFromCollectionByPrefix ( $Prefix, &$Collection ) | ||
trace ( string $Message, string $Type = TRACE_INFO ) | Trace a message when tracing is turned on. |
public __construct ( |
||
$addonManager | The addon manager that manages all of the addons. |
public addSearchPath ( ) : boolean | ||
Résultat | boolean | Deprecated. |
public static calcOldInfoArray ( |
||
$addon | The addon to calculate. | |
Résultat | array | Returns an info array. |
public callEventHandler ( object $Sender, string $EventClassName, string $EventName, string $EventHandlerType = 'Handler', array $Options = [] ) : mixed | ||
$Sender | object | The object firing the event. |
$EventClassName | string | The name of the class firing the event. |
$EventName | string | The name of the event being fired. |
$EventHandlerType | string | The type of event handler being looked for. |
$Options | array | An array of options to modify the call. |
Résultat | mixed | Returns whatever the event handler returns or **false** of there is not event handler. |
public callEventHandlers ( object $Sender, string $EventClassName, string $EventName, string $EventHandlerType = 'Handler' ) : boolean | ||
$Sender | object | The object that fired the event being handled. |
$EventClassName | string | The name of the class that fired the event being handled. |
$EventName | string | The name of the event being fired. |
$EventHandlerType | string | The type of handler being fired (Handler, Before, After). |
Résultat | boolean | Returns **true** if an event was executed. |
public callMethodOverride ( object $Sender, string $ClassName, string $MethodName ) : mixed | ||
$Sender | object | The object being worked on. |
$ClassName | string | The name of the class that called the method being overridden. |
$MethodName | string | The name of the method that is being overridden. |
Résultat | mixed | Returns the value of overridden method. |
public callNewMethod ( object $Sender, string $ClassName, string $MethodName ) : mixed | ||
$Sender | object | The object being worked on. |
$ClassName | string | The name of the class that called the method being created. |
$MethodName | string | The name of the method that is being created. |
Résultat | mixed | Return value of new method. |
public checkPlugin ( string $pluginName ) : boolean | ||
$pluginName | string | The name of the plugin. |
Résultat | boolean | Returns **true** if the plugin is enabled or **false** otherwise. |
public clearPluginCache ( ) |
public disablePlugin ( string $pluginName ) : boolean | ||
$pluginName | string | The name of the plugin. |
Résultat | boolean |
public enablePlugin ( $pluginName, Gdn_Validation $validation, boolean $setup = true ) : boolean | ||
$pluginName | ||
$validation | Gdn_Validation | |
$setup | boolean | |
Résultat | boolean |
public enabledPluginFolders ( null $SearchPath = null ) : array | ||
$SearchPath | null | |
Résultat | array |
public enabledPlugins ( ) : array | ||
Résultat | array |
public findPluginFile ( string $path ) : string | false | ||
$path | string | Deprecated. |
Résultat | string | false | Deprecated. |
public forceAutoloaderIndex ( ) |
public getCallback ( string $ClassName, string $MethodName, string $Type = 'Create' ) : callback | ||
$ClassName | string | The name of the class throwing the event. |
$MethodName | string | The name of the event. |
$Type | string | The type of event handler. - Create: A new method creation. - Override: A method override. |
Résultat | callback |
public getPluginInfo ( string $name, string $accessType = self::ACCESS_PLUGINNAME ) : boolean | array | ||
$name | string | The name of the plugin to access. |
$accessType | string | Either **Gdn_PluginManager::ACCESS_CLASSNAME** or Gdn_PluginManager::ACCESS_PLUGINNAME** (default). |
Résultat | boolean | array | Returns an info array or **false** if the plugin isn't found. |
public getPluginInstance ( string $name, string $accessType = self::ACCESS_CLASSNAME, mixed $sender = null ) : Gdn_IPlugin | ||
$name | string | The key of the plugin. |
$accessType | string | The type of key for the plugin which must be one of the following: - Gdn_PluginManager::ACCESS_PLUGINNAME - Gdn_PluginManager::ACCESS_CLASSNAME |
$sender | mixed | An object to pass to a new plugin instantiation. |
Résultat | Gdn_IPlugin | The plugin instance. |
public hasMethodOverride ( string $ClassName, string $MethodName ) : boolean | ||
$ClassName | string | The name of the class that called the method being overridden. |
$MethodName | string | The name of the method that is being overridden. |
Résultat | boolean | Returns **true** if an override exists or **false** otherwise. |
public includePlugins ( ) |
public registerCallback ( string $eventName, callable $callback ) | ||
$eventName | string | The name of the event to register. |
$callback | callable | The callback to call when the event is fired. |
public registerHandler ( string $HandlerClassName, string $HandlerMethodName, string $EventClassName = '', string $EventName = '', string $EventHandlerType = '' ) | ||
$HandlerClassName | string | The name of the plugin class that will handle the event. |
$HandlerMethodName | string | The name of the plugin method being registered to handle the event. |
$EventClassName | string | The name of the class that will fire the event. |
$EventName | string | The name of the event that will fire. |
$EventHandlerType | string | The type of event handler. |
public registerNewMethod ( string $NewMethodClassName, string $NewMethodName, string $EventClassName = '', string $EventName = '' ) | ||
$NewMethodClassName | string | The name of the plugin class that will add a new method. |
$NewMethodName | string | The name of the plugin method being added. |
$EventClassName | string | The name of the class that will fire the event. |
$EventName | string | The name of the event that will fire. |
public registerOverride ( string $OverrideClassName, string $OverrideMethodName, string $EventClassName = '', string $EventName = '' ) | ||
$OverrideClassName | string | The name of the plugin class that will override the existing method. |
$OverrideMethodName | string | The name of the plugin method being registered to override the existing method. |
$EventClassName | string | The name of the class that will fire the event. |
$EventName | string | The name of the event that will fire. |
public registerPlugins ( ) |
public removeMobileUnfriendlyPlugins ( ) |
public removeSearchPath ( ) : boolean | ||
Résultat | boolean | Deprecated. |
public searchPaths ( boolean $OnlyCustom = false ) : array | ||
$OnlyCustom | boolean | whether or not to exclude the two default paths and return only config paths |
Résultat | array | Search paths |
public testPlugin ( string $PluginName ) | ||
$PluginName | string | The name of the plugin to test. |
public unregisterPlugin ( $PluginClassName ) : boolean | ||
$PluginClassName | ||
Résultat | boolean |
protected $pluginCache |
protected $pluginSearchPaths |