Static Public Member Functions

Plugins Class Reference

List of all members.

Static Public Member Functions

static _autoload ($class)
static register ($fn, $type, $hook, $priority=8)
static act ()
static act_id ()
static filter ()
static filter_id ()
static xmlrpc ()
static theme ()
static theme_implemented ($hookname)
static list_active ($refresh=false)
static get_active ()
static get_by_interface ($interface)
static list_all ()
static extends_plugin ($class)
static class_from_filename ($file, $check_realpath=false)
static get_plugin_classes ()
static load_from_file ($file, $activate=true)
static load_info ($file)
static load ($class, $activate=true)
static upgrade ()
static load_active ()
static id_from_file ($file)
static activate_plugin ($file)
static deactivate_plugin ($file, $force=false)
static changed_since_last_activation ()
static set_present ()
static is_loaded ($name, $version=null)
static check_every_plugin_syntax ()
static plugin_ui ($configure, $configaction)

Detailed Description

Habari Plugins Class

Provides an interface for the code to access plugins

Definition at line 12 of file plugins.php.


Member Function Documentation

static Plugins::_autoload ( class  )  [static]

Autoload function to load plugin file from classname

Definition at line 31 of file plugins.php.

static Plugins::act (  )  [static]
static Plugins::act_id (  )  [static]

Call to execute a plugin action, by id

Parameters:
string The name of the action to execute
mixed Optional arguments needed for action

Definition at line 90 of file plugins.php.

Referenced by Themes::activate_theme(), Themes::create(), plugin_ui(), Themes::preview_theme(), and Pluggable::upgrade().

static Plugins::activate_plugin ( file  )  [static]

Activates a plugin file

Definition at line 491 of file plugins.php.

Referenced by AdminPluginsHandler::get_plugin_toggle().

static Plugins::changed_since_last_activation (  )  [static]

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

Returns:
boolean true if the plugins have changed, false if not.

Definition at line 574 of file plugins.php.

static Plugins::check_every_plugin_syntax (  )  [static]

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

See also:
Utils::php_check_file_syntax()
Returns:
bool Returns true if all plugins were valid, return false if a plugin (or more) failed.

Definition at line 654 of file plugins.php.

static Plugins::class_from_filename ( file,
check_realpath = false 
) [static]

function class_from_filename returns the class name from a plugin's filename

Parameters:
string $file the full path to a plugin file
bool $check_realpath whether or not to try realpath resolution
Returns:
string the class name

Definition at line 352 of file plugins.php.

Referenced by activate_plugin(), and load_from_file().

static Plugins::deactivate_plugin ( file,
force = false 
) [static]

Deactivates a plugin file

Definition at line 527 of file plugins.php.

Referenced by AdminPluginsHandler::get_plugin_toggle(), and list_active().

static Plugins::extends_plugin ( class  )  [static]

Get classes that extend Plugin.

Parameters:
$class string A class name
Returns:
boolean true if the class extends Plugin

Definition at line 339 of file plugins.php.

static Plugins::filter (  )  [static]

Call to execute a plugin filter

Parameters:
string The name of the filter to execute
mixed The value to filter.

Definition at line 113 of file plugins.php.

Referenced by PostInfo::__get(), Post::__get(), MediaAsset::__get(), LogEntry::__get(), Block::__get(), User::__get(), Options::__get(), Comment::__get(), Options::__set(), Modules::__static(), UserThemeHandler::act(), AdminHandler::act_admin(), Theme::act_display(), UserHandler::act_login(), AtomHandler::act_rsd(), CoreBlocks::action_block_form_recent_posts(), activate_plugin(), Themes::activate_theme(), FeedbackHandler::add_comment(), AtomHandler::add_comments(), AtomHandler::add_posts(), RewriteRules::add_system_rules(), AdminThemesHandler::ajax_add_block(), AdminCommentsHandler::ajax_comments(), AdminDashboardHandler::ajax_dashboard(), AdminThemesHandler::ajax_delete_block(), AdminGroupsHandler::ajax_groups(), AdminPostsHandler::ajax_media_panel(), AdminPostsHandler::ajax_posts(), AdminThemesHandler::ajax_save_areas(), AdminTagsHandler::ajax_tags(), AdminCommentsHandler::ajax_update_comment(), RewriteRule::arg_match(), User::authenticate(), RewriteRule::build(), Theme::check_scope_criteria(), Block::content_type(), AtomHandler::create_atom_wrapper(), Post::create_default_tokens(), ACL::create_token(), deactivate_plugin(), Vocabulary::delete(), UserGroup::delete(), Term::delete(), Post::delete(), LogEntry::delete(), Block::delete(), User::delete(), Comment::delete(), Session::destroy(), ACL::destroy_token(), RawPHPEngine::display(), HiEngine::display(), DatabaseConnection::exec(), CronJob::execute(), AdminDashboardHandler::fetch_dashboard_modules(), AdminCommentsHandler::form_comment(), AdminUsersHandler::form_user_success(), Session::gc(), Stack::get(), Posts::get(), RewriteRules::get_active(), AdminHandler::get_blank(), Theme::get_blocks(), SpamChecker::get_code(), AtomHandler::get_collection(), FormControl::get_default(), Site::get_dir(), AtomHandler::get_entry(), Post::get_form(), AdminImportHandler::get_import(), AdminHandler::get_main_menu(), Site::get_path(), AdminPluginsHandler::get_plugins(), AdminPostsHandler::get_publish(), Theme::get_scopes(), FormContainer::get_theme(), Themes::get_theme_dir(), AdminThemesHandler::get_themes(), Site::get_url(), ACL::get_user_token_access(), Session::init(), Vocabulary::insert(), UserGroup::insert(), Term::insert(), Post::insert(), LogEntry::insert(), Block::insert(), User::insert(), Comment::insert(), Comment::list_comment_statuses(), Utils::mail(), Utils::mimetype(), Controller::parse_request(), AdminOptionsHandler::post_options(), AdminPostsHandler::post_posts(), Post::publish(), DatabaseConnection::query(), Session::read(), Posts::reassign(), FormControl::save(), Posts::search_to_get(), Term::setslug(), AdminHandler::setup_admin_theme(), Modules::setup_status_module(), HabariSilo::silo_get(), Utils::slugify(), Comment::status_action(), XMLRPCServer::system_listMethods(), RawPHPEngine::template_exists(), Theme::theme_body_class(), Vocabulary::update(), UserGroup::update(), Term::update(), Post::update(), Block::update(), User::update(), Comment::update(), and Session::write().

static Plugins::filter_id (  )  [static]

Call to execute a plugin filter on a specific plugin, by id

Parameters:
string The name of the filter to execute
string The id of the only plugin on which to execute
mixed The value to filter.

Definition at line 138 of file plugins.php.

Referenced by AdminPluginsHandler::get_plugins().

static Plugins::get_active (  )  [static]

Returns the internally stored references to all loaded plugins

Returns:
array An array of plugin objects

Definition at line 284 of file plugins.php.

Referenced by AdminPluginsHandler::get_plugin_toggle(), AdminPluginsHandler::get_plugins(), and AdminHandler::get_sysinfo().

static Plugins::get_by_interface ( interface  )  [static]

Get references to plugin objects that implement a specific interface

Parameters:
string $interface The interface to check for
Returns:
array An array of matching plugins

Definition at line 294 of file plugins.php.

Referenced by HabariSilo::action_plugin_deactivation(), Post::get_form(), Media::init_silos(), and Format::load_all().

static Plugins::id_from_file ( file  )  [static]

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.

Parameters:
string $file The filename to generate an id for
Returns:
string A plugin id.

Definition at line 482 of file plugins.php.

Referenced by CoreDashModules::action_plugin_activation(), CoreDashModules::action_plugin_deactivation(), deactivate_plugin(), AdminPluginsHandler::get_plugin_toggle(), AdminPluginsHandler::get_plugins(), and Pluggable::plugin_id().

static Plugins::is_loaded ( name,
version = null 
) [static]

Verify if a plugin is loaded. You may supply an optional argument $version as a minimum version requirement.

Parameters:
string $name Name or class name of the plugin to find.
string $version Optional minimal version of the plugin.
Returns:
bool Returns true if name is found and version is equal or higher than required.

Definition at line 625 of file plugins.php.

static Plugins::list_active ( refresh = false  )  [static]

function list_active Gets a list of active plugin filenames to be included

Parameters:
boolean Whether to refresh the cached array. Default false
Returns:
array An array of filenames

Definition at line 247 of file plugins.php.

static Plugins::list_all (  )  [static]

function list_all Gets a list of all plugin filenames that are available

Returns:
array An array of filenames

Definition at line 304 of file plugins.php.

Referenced by changed_since_last_activation(), check_every_plugin_syntax(), AdminPluginsHandler::get_plugin_toggle(), AdminPluginsHandler::get_plugins(), and set_present().

static Plugins::load ( class,
activate = true 
) [static]

Load a pluign into memory by class name

Parameters:
string $class The name of the class of the plugin to load
boolean $activate True to run the load routine of the plugin and add it to the loaded plugins list
Returns:
Plugin The instance of the created plugin

Definition at line 440 of file plugins.php.

Referenced by activate_plugin(), load_active(), and load_from_file().

static Plugins::load_active (  )  [static]

Instatiate and load all active plugins

Definition at line 464 of file plugins.php.

static Plugins::load_from_file ( file,
activate = true 
) [static]

Initialize all loaded plugins by calling their load() method

Parameters:
string $file the class name to load
boolean $activate True if the plugin's load() method should be called
Returns:
Plugin The instantiated plugin class

Definition at line 386 of file plugins.php.

static Plugins::load_info ( file  )  [static]

Return the info XML for a plugin based on a filename

Parameters:
string $file The filename of the plugin file
Returns:
SimpleXMLElement The info structure for the plugin, or null if no info could be loaded

Definition at line 399 of file plugins.php.

Referenced by AdminPluginsHandler::get_plugins(), and Plugin::info().

static Plugins::plugin_ui ( configure,
configaction 
) [static]

Produce the UI for a plugin based on the user's selected config option

Parameters:
string $configure The id of the configured plugin
string $configuration The selected configuration option

Definition at line 679 of file plugins.php.

static Plugins::register ( fn,
type,
hook,
priority = 8 
) [static]

function register Registers a plugin action for possible execution

Parameters:
mixed A reference to the function to register by string or array(object, string)
string Usually either 'filter' or 'action' depending on the hook type.
string The plugin hook to register
hex An optional execution priority, in hex. The lower the priority, the earlier the function will execute in the chain. Default value = 8.

Definition at line 46 of file plugins.php.

Referenced by InstallHandler::act_begin_install(), XMLRPCServer::act_xmlrpc_call(), Pluggable::add_rule(), Pluggable::add_template(), Format::apply(), Format::apply_with_hook_params(), AdminDashboardHandler::fetch_dashboard_modules(), AdminThemesHandler::get_configure_block(), AdminHandler::get_main_menu(), Plugin::info(), Pluggable::load(), and Pluggable::load_hooks().

static Plugins::set_present (  )  [static]

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

Definition at line 605 of file plugins.php.

Referenced by check_every_plugin_syntax().

static Plugins::theme (  )  [static]

Call to execute a theme function

Parameters:
string The name of the filter to execute
mixed The value to filter
Returns:
The filtered value

Definition at line 185 of file plugins.php.

static Plugins::theme_implemented ( hookname  )  [static]

Determine if any plugin implements the indicated theme hook

Parameters:
string $hookname The name of the hook to check for
Returns:
boolean True if the hook is implemented

Definition at line 236 of file plugins.php.

static Plugins::upgrade (  )  [static]

Upgrade all loaded plugins

Definition at line 454 of file plugins.php.

static Plugins::xmlrpc (  )  [static]

Call to execute an XMLRPC function

Parameters:
string The name of the filter to execute
mixed The value to filter.

Definition at line 163 of file plugins.php.

Referenced by XMLRPCServer::act_xmlrpc_call().


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