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 ($hookname, $param=null)
static act_id ($hookname, $param=null)
static filter ($hookname, $param)
static filter_id ($hookname, $id, $param)
static xmlrpc ($hookname, $param)
static theme ($hookname, $param)
static theme_implemented ($hookname)
static implemented ($hookname, $searchtype=null)
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)
static provided ($exclude=null, $include_inactive=false, $use_file=false)

Detailed Description

Habari Plugins Class

Provides an interface for the code to access plugins

Definition at line 14 of file plugins.php.


Member Function Documentation

static Plugins::_autoload ( class  )  [static]

Autoload function to load plugin file from classname

Definition at line 32 of file plugins.php.

static Plugins::act ( hookname,
param = null 
) [static]

Call to execute a plugin action

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

Definition at line 87 of file plugins.php.

Referenced by Theme::__call(), QueryRecord::__set(), MemcacheCache::_expire(), FileCache::_expire(), APCCache::_expire(), MemcacheCache::_extend(), FileCache::_extend(), APCCache::_extend(), MemcacheCache::_purge(), FileCache::_purge(), APCCache::_purge(), MemcacheCache::_set(), FileCache::_set(), APCCache::_set(), activate_plugin(), Themes::activate_theme(), Theme::add_template_vars(), AdminCommentsHandler::ajax_update_comment(), AdminPostsHandler::ajax_update_posts(), User::anonymous(), Term::associate(), User::authenticate(), Theme::check_scope_criteria(), Post::comment_form(), Themes::create(), ACL::create_token(), deactivate_plugin(), Vocabulary::delete(), UserGroup::delete(), Term::delete(), Post::delete(), LogEntry::delete(), Block::delete(), User::delete(), Comment::delete(), ACL::destroy_token(), Controller::dispatch_request(), Term::dissociate(), Block::fetch(), User::forget(), FormUI::get(), Posts::get(), Block::get_form(), Vocabulary::insert(), UserGroup::insert(), Term::insert(), Post::insert(), Block::insert(), User::insert(), Comment::insert(), Stack::load_stackitems(), plugin_ui(), Post::publish(), Posts::reassign(), Post::set_revision(), Theme::theme_area(), Theme::theme_footer(), Theme::theme_header(), Vocabulary::update(), UserGroup::update(), Term::update(), Post::update(), Block::update(), User::update(), and Comment::update().

static Plugins::act_id ( hookname,
param = null 
) [static]

Call to execute a plugin action, by id

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

Definition at line 107 of file plugins.php.

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

static Plugins::activate_plugin ( file  )  [static]

Activates a plugin file

Definition at line 560 of file plugins.php.

Referenced by _autoload(), and 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 685 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 765 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 402 of file plugins.php.

Referenced by activate_plugin(), and load_from_file().

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

Deactivates a plugin file

Parameters:
string $file the Filename of the plugin to deactivate
boolean $force If true, deactivate this plugin regardless of what filters may say about it.
Returns:
bool If true, the plugin was deactivated

Definition at line 638 of file plugins.php.

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

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 388 of file plugins.php.

static Plugins::filter ( hookname,
param 
) [static]

Call to execute a plugin filter

Parameters:
string $hookname The name of the filter to execute
mixed $param The value to filter.
Returns:
mixed The result of filtering the first $param value

Definition at line 130 of file plugins.php.

Referenced by QueryRecord::__get(), PostInfo::__get(), Post::__get(), MediaAsset::__get(), LogEntry::__get(), Block::__get(), User::__get(), Options::__get(), Comment::__get(), Options::__set(), ACL::_filter_token_description_display(), ACL::access_names(), UserThemeHandler::act(), AdminHandler::act(), Theme::act_display(), AtomHandler::act_rsd(), Pingback::action_add_template_vars(), Monolith::action_block_content(), 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(), AdminDashboardHandler::ajax_dashboard(), AdminPostsHandler::ajax_media_panel(), AdminPostsHandler::ajax_media_upload(), AdminThemesHandler::ajax_save_areas(), AdminCommentsHandler::ajax_update_comment(), RewriteRule::arg_match(), User::authenticate(), RewriteRule::build(), Theme::check_scope_criteria(), Session::clear_userid(), Post::content_type(), 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(), AdminUsersHandler::edit_user_apply(), DatabaseConnection::exec(), CronJob::execute(), Post::field_load(), Post::field_save(), CoreDashModules::filter_dash_module_post_types_and_statuses(), Post::filter_post_get_7(), AdminCommentsHandler::form_comment(), Session::gc(), URL::get(), Posts::get(), RewriteRules::get_active(), AdminHandler::get_blank(), Theme::get_blocks(), SpamChecker::get_code(), AtomHandler::get_collection(), Site::get_dir(), AtomHandler::get_entry(), AdminGroupsHandler::get_group(), AdminGroupsHandler::get_groups(), AdminImportHandler::get_import(), AdminHandler::get_main_menu(), Menus::get_menu_type_data(), Site::get_path(), AdminPluginsHandler::get_plugins(), AdminPostsHandler::get_publish(), Post::get_schema_map(), Theme::get_scopes(), Themes::get_theme_dir(), AdminThemesHandler::get_themes(), Site::get_url(), Theme::get_url(), Post::get_url_args(), ACL::get_user_token_access(), Pluggable::get_xml_text(), User::identify(), Session::init(), Vocabulary::insert(), UserGroup::insert(), Term::insert(), Post::insert(), LogEntry::insert(), Block::insert(), User::insert(), Comment::insert(), QueryRecord::jsonSerialize(), Comment::list_comment_statuses(), Comment::list_comment_types(), load_active(), AjaxHandler::locale_js(), Utils::mail(), Posts::merge_presets(), Utils::mimetype(), Controller::parse_request(), AdminCommentsHandler::post_comments(), AdminPostsHandler::post_posts(), FormControl::prep_theme(), AdminThemesHandler::prepare_block_list(), provided(), Post::publish(), DatabaseConnection::query(), RawPHPEngine::queue_dirs(), Posts::reassign(), Utils::replace_shortcodes(), Posts::search_to_get(), Session::set_userid(), Term::setslug(), AdminHandler::setup_admin_theme(), HabariSilo::silo_get(), Utils::slugify(), Comment::status_action(), XMLRPCServer::system_listMethods(), Theme::theme_body_class(), Theme::theme_page_title(), Vocabulary::update(), UserGroup::update(), Term::update(), Post::update(), Block::update(), User::update(), Comment::update(), and Session::write().

static Plugins::filter_id ( hookname,
id,
param 
) [static]

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

Parameters:
string $hookname The name of the filter to execute
string $id The id of the only plugin on which to execute
mixed $param The value to filter.
Returns:
mixed The result of filtering the first $param value

Definition at line 154 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 320 of file plugins.php.

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

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 330 of file plugins.php.

Referenced by HabariSilo::action_plugin_deactivation(), 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 551 of file plugins.php.

Referenced by deactivate_plugin(), AdminPluginsHandler::get_plugin_toggle(), InstallHandler::get_plugins(), AdminPluginsHandler::get_plugins(), Pluggable::plugin_id(), and provided().

static Plugins::implemented ( hookname,
searchtype = null 
) [static]

Determine if a hook of any type is implemented

Parameters:
string $hookname The name of the hook to check for
string $searchtype Optional. The type of hook to check for
Returns:
array|bool An array with the types of hook implemented, or false if not implemented

Definition at line 263 of file plugins.php.

Referenced by Post::__get(), QueryRecord::__set(), and CronJob::execute().

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 736 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 $refresh Whether to refresh the cached array. Default false
Returns:
array An array of filenames

Definition at line 281 of file plugins.php.

Referenced by _autoload().

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 341 of file plugins.php.

Referenced by changed_since_last_activation(), check_every_plugin_syntax(), AdminPluginsHandler::get_plugin_toggle(), InstallHandler::get_plugins(), AdminPluginsHandler::get_plugins(), AdminHandler::get_sysinfo(), provided(), 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 502 of file plugins.php.

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

static Plugins::load_active (  )  [static]

Instantiate and load all active plugins

Definition at line 532 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:
The instantiated plugin class

Definition at line 436 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:
The info structure for the plugin, or null if no info could be loaded

Definition at line 449 of file plugins.php.

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

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
$configaction 

For internal use only.

param string $configuration The selected configuration option

Definition at line 791 of file plugins.php.

static Plugins::provided ( exclude = null,
include_inactive = false,
use_file = false 
) [static]

Get a list of features and the active plugins that provide that feature

Parameters:
null|string $exclude A plugin id to exclude from the results
bool $include_inactive Default false. If true, include inactive plugins in the list.
bool $use_file If true, return a filename as the depenedency. If false (default), return the name of the plugin.
Returns:
array An array with keys of the feature name, values are an array of plugin names providing that feature

Definition at line 806 of file plugins.php.

Referenced by activate_plugin(), AdminImportHandler::get_import(), and Themes::validate_theme().

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

function register Registers a plugin action for possible execution

Parameters:
Callable $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
integer $priority An optional execution priority, from 1-16. The lower the priority, the earlier the function will execute in the chain. Default value = 8.

Definition at line 64 of file plugins.php.

Referenced by ACL::__static(), InstallHandler::act_begin_install(), XMLRPCServer::act_xmlrpc_call(), Pluggable::add_rule(), Pluggable::add_template(), Format::apply(), Format::apply_with_hook_params(), Plugin::info(), Pluggable::load(), Pluggable::load_hooks(), AjaxHandler::register_ajax(), and AjaxHandler::register_auth_ajax().

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 716 of file plugins.php.

Referenced by check_every_plugin_syntax().

static Plugins::theme ( hookname,
param 
) [static]

Call to execute a theme function

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

Definition at line 199 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 251 of file plugins.php.

static Plugins::upgrade (  )  [static]

Upgrade all loaded plugins

Definition at line 522 of file plugins.php.

static Plugins::xmlrpc ( hookname,
param 
) [static]

Call to execute an XMLRPC function

Parameters:
string $hookname The name of the filter to execute
mixed $param The value to filter.
Returns:
bool|mixed The result of the XMLRPC call

Definition at line 178 of file plugins.php.

Referenced by XMLRPCServer::act_xmlrpc_call().


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