CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
PluginManager Class Reference

Manager to load and invoke plugins. More...

## Public Member Functions
| __construct ($AppFramework, $PluginDirectories)
| PluginManager class constructor.
| LoadPlugins ()
| Load and initialize plugins.
| GetErrorMessages ()
| Retrieve any error messages generated during plugin loading.
| GetPlugin ($PluginName)
| Retrieve specified plugin.
| GetPluginForCurrentPage ()
| Retrieve plugin for current page (if any).
| GetPluginAttributes ()
| Retrieve info about currently loaded plugins.
| GetDependents ($PluginName)
| Returns a list of plugins dependent on the specified plugin.
| GetActivePluginList ()
| Get list of active (i.e.
| PluginEnabled ($PluginName, $NewValue=NULL)
| Get/set whether specified plugin is enabled.
| UninstallPlugin ($PluginName)
| Uninstall plugin and (optionally) delete any associated data.

## Detailed Description

Manager to load and invoke plugins.

Definition at line 6 of file PluginManager.php.

## Constructor & Destructor Documentation

PluginManager::__construct | ( |  | $AppFramework,
|  |  | $PluginDirectories
| ) |  |

PluginManager class constructor.

Parameters

  AppFramework | ApplicationFramework within which plugins should run.
  PluginDirectories | Array of names of directories containing plugins.

Definition at line 15 of file PluginManager.php.

References ApplicationFramework\ORDER_LAST.

## Member Function Documentation

PluginManager::GetActivePluginList | ( |  | ) |

Get list of active (i.e.

enabled) plugins.

Returns
  Array of base names of active plugins.

Definition at line 280 of file PluginManager.php.

References PluginEnabled().

PluginManager::GetDependents | ( |  | $PluginName | ) |

Returns a list of plugins dependent on the specified plugin.

Parameters

  PluginName | Base name of plugin.

Returns
  Array of base names of dependent plugins.

Definition at line 260 of file PluginManager.php.

References GetPluginAttributes().

PluginManager::GetErrorMessages | ( |  | ) |

Retrieve any error messages generated during plugin loading.

Returns
  Array of arrays of error messages, indexed by plugin base (class) name.

Definition at line 207 of file PluginManager.php.

PluginManager::GetPlugin | ( |  | $PluginName | ) |

Retrieve specified plugin.

Parameters

  PluginName | Base name of plugin.

Returns
  Plugin object or NULL if no plugin found with specified name.

Definition at line 217 of file PluginManager.php.

Referenced by GetPluginForCurrentPage().

Here is the caller graph for this function:

PluginManager::GetPluginAttributes | ( |  | ) |

Retrieve info about currently loaded plugins.

Returns
  Array of arrays of plugin info, indexed by plugin base (class) name.

Definition at line 239 of file PluginManager.php.

Referenced by GetDependents().

Here is the caller graph for this function:

PluginManager::GetPluginForCurrentPage | ( |  | ) |

Retrieve plugin for current page (if any).

This method relies on the current page having been found within the plugin directory (usually via a "P_" prefix on the page name) via a call to the hooked FindPluginPhpFile() or FindPluginHtmlFile() methods..

Returns
  Plugin object or NULL if no plugin associated with current page.

Definition at line 230 of file PluginManager.php.

References GetPlugin().

PluginManager::LoadPlugins | ( |  | ) |

Load and initialize plugins.

Returns
  TRUE if load was successful (no problems encountered), otherwise FALSE.

Definition at line 38 of file PluginManager.php.

References ApplicationFramework\AddObjectDirectory(), and PluginEnabled().

PluginManager::PluginEnabled | ( |  | $PluginName,
|  |  | $NewValue = `NULL`
| ) |  |

Get/set whether specified plugin is enabled.

Parameters

  PluginName | Base name of plugin.
  NewValue | TRUE to enable, FALSE to disable. (OPTIONAL)

Returns
  TRUE if plugin is enabled, otherwise FALSE.

Definition at line 291 of file PluginManager.php.

Referenced by GetActivePluginList(), LoadPlugins(), and UninstallPlugin().

Here is the caller graph for this function:

PluginManager::UninstallPlugin | ( |  | $PluginName | ) |

Uninstall plugin and (optionally) delete any associated data.

Parameters

  PluginName | Base name of plugin.

Returns
  Error message or NULL if uninstall succeeded.

Definition at line 309 of file PluginManager.php.

References PluginEnabled().

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

- lib/ScoutLib/PluginManager.php