yana

phpDocumentor v 1.4.0

Class PluginManager

Description

«Singleton» PluginManager
This class implements communication between plugins and provides access to virtual drives and local registries which may be defined on a per plugin basis.
  • access: public
  • name: PluginManager
Object
   |
   --Singleton
      |
      --PluginManager
Method Summary
  • string get (string $pluginName, string $key)
  • string getPluginDir ()
  • bool handle (string $event, array $args, [string $criteria = ""])
  • bool isInstalled (string $pluginName)

Methods

get a file from a virtual drive
string get (
string $pluginName, string $key
)
List of parameters:
Name Type Description
$pluginName string identifier for the plugin
$key string identifier for the file to get
Description:
Each plugin defines it's own virtual drive with files that are required for it to function as intended.
You may access the virtual drive of any plugin if you know the plugin's name $pluginName and the name $key of the file you want. This is usefull from plugins that extend the functionality of another.
  • access: public
get the name of the directory where plugins are installed
string getPluginDir ()
Description:
This returns a string value. By default the plugin install path is "plugins/". Still you should note, that you are strongly encouraged to use this function rather than using hard-wired pathnames in your source-code.
  • access: public
broadcast an event to all plugins
bool handle (
string $event, array $args, [string $criteria = ""]
)
List of parameters:
Name Type Description
$event string identifier of the occured event
$args array list of arguments
$criteria string (optional)
Description:
This function looks up an event that you provide with the argument $event, and sends it to all plugins that are in the event's group of recipients.
Note: that "handle an event" actually means "calling a function that serves as an event handler". You may pass arguments to this function by using the argument $ARGUMENTS, which is supposed to be an associative array.
You may manually choose a group of recipients by providing the optional $criteria argument, which may be one of the following: "default", "primary", "security", "read", "write", "config". If this argument is not provided, the recipients are determined automatically. This is also the default behaviour.
  • access: public
check if a specific plugin is installed
bool isInstalled (
string $pluginName
)
List of parameters:
Name Type Description
$pluginName string identifier for the plugin
Description:
This returns bool(true) if a plugin with the name $pluginName exists and has currently been installed. Otherwise it returns bool(false).
  • access: public
inherited from base classes

Inherited From Singleton

Inherited From Object

Documentation generated on Sat, 03 Jan 2009 22:22:30 +0100 by phpDocumentor 1.4.0

yana author: Thomas MeyerHomepage: www.yanaframework.net