Class Plugins

Description

Habari Plugins Class

Provides an interface for the code to access plugins

Located in /system/classes/plugins.php (line 9)


	
			
Method Summary
static void act (string 0, mixed 1)
static void activate_plugin ( $file)
static boolean changed_since_last_activation ()
static string class_from_filename (string $file, [bool $check_realpath = false])
static void deactivate_plugin ( $file)
static boolean extends_plugin ($class $class)
static void filter (string 0, mixed 1)
static array get_active ()
static array get_by_interface (string $interface)
static void get_plugin_classes ()
static string id_from_file (string $file)
static bool is_loaded (string $name, [string $version = NULL])
static array list_active ([boolean $refresh = false])
static array list_all ()
static Plugin load (string $file, [boolean $activate = true])
static void register (mixed $fn, string $type, string $hook, [hex $priority = 8])
static void set_present ()
static The theme (string 0, mixed 1)
static boolean theme_implemented (string $hookname)
static void xmlrpc (string 0, mixed 1)
Methods
static method act (line 57)

function act

Call to execute a plugin action

  • access: public
static void act (string 0, mixed 1)
  • string 0: The name of the action to execute
  • mixed 1: Optional arguments needed for action
static method activate_plugin (line 336)

Activates a plugin file

  • access: public
static void activate_plugin ( $file)
  • $file
static method changed_since_last_activation (line 393)

Detects whether the plugins that exist have changed since they were last activated.

  • return: true if the plugins have changed, false if not.
  • access: public
static boolean changed_since_last_activation ()
static method class_from_filename (line 271)

function class_from_filename

returns the class name from a plugin's filename

  • return: the class name
  • access: public
static string class_from_filename (string $file, [bool $check_realpath = false])
  • string $file: the full path to a plugin file
  • bool $check_realpath: whether or not to try realpath resolution
static method deactivate_plugin (line 362)

Deactivates a plugin file

  • access: public
static void deactivate_plugin ( $file)
  • $file
static method extends_plugin (line 258)

Get classes that extend Plugin.

  • return: true if the class extends Plugin
  • access: public
static boolean extends_plugin ($class $class)
  • $class $class: string A class name
static method filter (line 79)

function filter

Call to execute a plugin filter

  • access: public
static void filter (string 0, mixed 1)
  • string 0: The name of the filter to execute
  • mixed 1: The value to filter.
static method get_active (line 203)

function get_active

Returns the internally stored references to all loaded plugins

  • return: An array of plugin objects
  • access: public
static array get_active ()
static method get_by_interface (line 213)

Get references to plugin objects that implement a specific interface

  • return: An array of matching plugins
  • access: public
static array get_by_interface (string $interface)
  • string $interface: The interface to check for
static method get_plugin_classes (line 295)
  • access: public
static void get_plugin_classes ()
static method id_from_file (line 327)

Returns a plugin id for the filename specified.

Used to unify the way plugin ids are generated, rather than spreading the calls internal to this function over several files.

  • return: A plugin id.
  • access: public
static string id_from_file (string $file)
  • string $file: The filename to generate an id for
static method is_loaded (line 444)

Verify if a plugin is loaded.

You may supply an optional argument $version as a minimum version requirement.

  • return: Returns true if name is found and version is equal or higher than required.
  • access: public
static bool is_loaded (string $name, [string $version = NULL])
  • string $name: Name or class name of the plugin to find.
  • string $version: Optional minimal version of the plugin.
static method list_active (line 176)

function list_active

Gets a list of active plugin filenames to be included

  • return: An array of filenames
  • access: public
static array list_active ([boolean $refresh = false])
  • boolean $refresh: Whether to refresh the cached array. Default FALSE
static method list_all (line 223)

function list_all

Gets a list of all plugin filenames that are available

  • return: An array of filenames
  • access: public
static array list_all ()
static method load (line 308)

function load

Initialize all loaded plugins by calling their load() method

  • return: The instantiated plugin class
  • access: public
static Plugin load (string $file, [boolean $activate = true])
  • string $file: the class name to load
  • boolean $activate: True if the plugin's load() method should be called
static method register (line 33)

function register

Registers a plugin action for possible execution

  • access: public
static void register (mixed $fn, string $type, string $hook, [hex $priority = 8])
  • mixed $fn: A reference to the function to register by string or array(object, string)
  • string $type: Usually either 'filter' or 'action' depending on the hook type.
  • string $hook: The plugin hook to register
  • hex $priority: An optional execution priority, in hex. The lower the priority, the earlier the function will execute in the chain. Default value = 8.
static method set_present (line 424)

Stores the list of plugins that are present (not necessarily active) in the Options table for future comparison.

  • access: public
static void set_present ()
static method theme (line 125)

Call to execute a theme function

  • return: filtered value
  • access: public
static The theme (string 0, mixed 1)
  • string 0: The name of the filter to execute
  • mixed 1: The value to filter
static method theme_implemented (line 165)

Determine if any plugin implements the indicated theme hook

  • return: True if the hook is implemented
  • access: public
static boolean theme_implemented (string $hookname)
  • string $hookname: The name of the hook to check for
static method xmlrpc (line 103)

Call to execute an XMLRPC function

  • access: public
static void xmlrpc (string 0, mixed 1)
  • string 0: The name of the filter to execute
  • mixed 1: The value to filter.
check_every_plugin_syntax (line 464)

Check the PHP syntax of every plugin available, activated or not.

  • return: Returns true if all plugins were valid, return false if a plugin (or more) failed.
  • see: Utils::check_php_file_syntax()
  • access: public
bool check_every_plugin_syntax ()

Documentation generated on Thu, 30 Oct 2008 20:31:22 +0100 by phpDocumentor 1.3.2