PluginManager

A class to load and manage plugins.

Summary
PluginManagerA class to load and manage plugins.
Functions
getConfigGets configuration data for plugins from XML files.
getPluginListList all defined classes that are descended from Plugin.
pluginLoadedDetermine if a specific plugin has been loaded.
getFileListList all the plugin files that get loaded.
loadPluginsLoad all plugins.
testFileTest if a particular plugin file exists.

Functions

getConfig

function getConfig()

Gets configuration data for plugins from XML files.  Merges the installation wide and per-blog settings if applicable.

getPluginList

function getPluginList()

List all defined classes that are descended from Plugin.  This has the effect of getting a list of loaded plugins.

Returns

An array of class names.

pluginLoaded

function pluginLoaded($plugin_name)

Determine if a specific plugin has been loaded.

Parameters

plugin_nameThe name of the plugin class to check.

Returns

True if the plugin class is loaded, false otherwise.

getFileList

function getFileList()

List all the plugin files that get loaded.

Returns

An array of strings containing filenames.

loadPlugins

function loadPlugins()

Load all plugins.  In particular, include()s every file in the plugins directory then ends with a .php suffix in alphabetical order.  Plugins are found in the “plugins” directory under BLOG_ROOT or INSTALL_ROOT.  Plugins in BLOG_ROOT take precedence.  Subdirectories are not scanned.

testFile

function testFile($plug)

Test if a particular plugin file exists.

Parameters

plugThe name of the plugin file.

Returns

True if the file exists in the userdata, LnBlog, or blog plugins directory, false otherwise.

function getConfig()
Gets configuration data for plugins from XML files.
function getPluginList()
List all defined classes that are descended from Plugin.
function pluginLoaded($plugin_name)
Determine if a specific plugin has been loaded.
function getFileList()
List all the plugin files that get loaded.
function loadPlugins()
Load all plugins.
function testFile($plug)
Test if a particular plugin file exists.
Close