Procedural File: plugin_api.php
Source Location: /core/plugin_api.php
Page Details:
Plugin API Handles the initialisation, management, and execution of plugins.
Tags:
Includes:
plugin_child [line 318]
void plugin_child(
string $p_child)
|
|
Allows a plugin to declare a 'child plugin' that can be loaded from the same parent directory.
Parameters
string |
$p_child |
Child plugin basename. |
plugin_config_defaults [line 208]
void plugin_config_defaults(
array $p_options)
|
|
Set plugin default values to global values without overriding anything.
Parameters
array |
$p_options |
Array of configuration option name/value pairs. |
plugin_config_delete [line 197]
void plugin_config_delete(
string $p_option, [int $p_user = ALL_USERS], [int $p_project = ALL_PROJECTS])
|
|
Delete a plugin configuration option from the database.
Parameters
string |
$p_option |
Configuration option name |
int |
$p_user |
User ID |
int |
$p_project |
Project ID |
plugin_config_get [line 161]
void plugin_config_get(
string $p_option, [multi $p_default = null], [ $p_global = false])
|
|
Get a plugin configuration option.
Parameters
string |
$p_option |
Configuration option name |
multi |
$p_default |
Default option value |
|
$p_global |
|
plugin_config_set [line 180]
void plugin_config_set(
string $p_option, multi $p_value, [int $p_user = NO_USER], [int $p_project = ALL_PROJECTS], [int $p_access = DEFAULT_ACCESS_LEVEL])
|
|
Set a plugin configuration option in the database.
Parameters
string |
$p_option |
Configuration option name |
multi |
$p_value |
Option value |
int |
$p_user |
User ID |
int |
$p_project |
Project ID |
int |
$p_access |
Access threshold |
plugin_dependency [line 441]
integer plugin_dependency(
string $p_basename, string $p_required, [ $p_initialized = false])
|
|
Check a plugin dependency given a basename and required version. Versions are checked using PHP's library version_compare routine and allows both minimum and maximum version requirements. Returns 1 if plugin dependency is met, 0 if dependency not met, or -1 if dependency is the wrong version.
Tags:
Parameters
string |
$p_basename |
Plugin basename |
string |
$p_required |
Required version |
|
$p_initialized |
|
plugin_error [line 260]
void plugin_error(
string $p_error_name, [int $p_error_type = ERROR], [string $p_basename = null])
|
|
Trigger a plugin-specific error with the given name and type.
Parameters
string |
$p_error_name |
Error name |
int |
$p_error_type |
Error type |
string |
$p_basename |
Plugin basename |
plugin_event_hook [line 285]
void plugin_event_hook(
string $p_name, string $p_callback)
|
|
Hook a plugin's callback function to an event.
Parameters
string |
$p_name |
Event name |
string |
$p_callback |
Callback function |
plugin_event_hook_many [line 294]
void plugin_event_hook_many(
array $p_hooks)
|
|
Hook multiple plugin callbacks at once.
Parameters
array |
$p_hooks |
Array of event name/callback key/value pairs |
plugin_file [line 107]
void plugin_file(
string $p_file, [string $p_redirect = false], [ $p_basename = null])
|
|
Get the URL to the plugin wrapper page.
Parameters
string |
$p_file |
Page name |
string |
$p_redirect |
Plugin basename (defaults to current plugin) |
|
$p_basename |
|
plugin_file_include [line 125]
void plugin_file_include(
string $p_filename, [string $p_basename = null])
|
|
Include the contents of a file as output.
Parameters
string |
$p_filename |
File name |
string |
$p_basename |
Plugin basename |
plugin_file_path [line 94]
mixed plugin_file_path(
string $p_filename, string $p_basename)
|
|
Return a path to a plugin file.
Tags:
Parameters
string |
$p_filename |
File name |
string |
$p_basename |
Plugin basename |
plugin_find_all [line 671]
Search the plugins directory for plugins.
Tags:
plugin_get_current [line 47]
string plugin_get_current(
)
|
|
Get the currently executing plugin's basename.
Tags:
plugin_history_log [line 242]
void plugin_history_log(
$p_bug_id, $p_field_name, $p_old_value, [ $p_new_value = ''], [ $p_user_id = null], [ $p_basename = null])
|
|
Parameters
|
$p_bug_id |
|
|
$p_field_name |
|
|
$p_old_value |
|
|
$p_new_value |
|
|
$p_user_id |
|
|
$p_basename |
|
plugin_include [line 699]
void plugin_include(
string $p_basename, [ $p_child = null])
|
|
Load a plugin's core class file.
Parameters
string |
$p_basename |
Plugin basename |
|
$p_child |
|
plugin_init [line 829]
boolean plugin_init(
string $p_basename)
|
|
Initialize a single plugin.
Tags:
Parameters
string |
$p_basename |
Plugin basename |
plugin_init_installed [line 786]
void plugin_init_installed(
)
|
|
Initialize all installed plugins. Post-signals EVENT_PLUGIN_INIT.
plugin_install [line 537]
void plugin_install(
string $p_plugin)
|
|
Install a plugin to the database.
Parameters
string |
$p_plugin |
Plugin basename |
plugin_is_installed [line 525]
boolean plugin_is_installed(
string $p_basename)
|
|
Determine if a given plugin is installed.
Tags:
Parameters
string |
$p_basename |
Plugin basename |
plugin_is_loaded [line 338]
boolean plugin_is_loaded(
string $p_basename)
|
|
Checks if a given plugin has been registered and initialized, and returns a boolean value representing the "loaded" state.
Tags:
Parameters
string |
$p_basename |
Plugin basename |
plugin_lang_get [line 230]
string plugin_lang_get(
string $p_name, [string $p_basename = null])
|
|
Get a language string for the plugin. Automatically prepends plugin_<basename> to the string requested.
Tags:
Parameters
string |
$p_name |
Language string name |
string |
$p_basename |
Plugin basename |
plugin_needs_upgrade [line 572]
boolean plugin_needs_upgrade(
string $p_plugin)
|
|
Determine if an installed plugin needs to upgrade its schema.
Tags:
Parameters
string |
$p_plugin |
Plugin basename |
plugin_page [line 75]
void plugin_page(
string $p_page, [string $p_redirect = false], [ $p_basename = null])
|
|
Get the URL to the plugin wrapper page.
Parameters
string |
$p_page |
Page name |
string |
$p_redirect |
Plugin basename (defaults to current plugin) |
|
$p_basename |
|
plugin_pop_current [line 65]
string plugin_pop_current(
)
|
|
Remove the current plugin from the stack
Tags:
plugin_priority [line 508]
int plugin_priority(
string $p_basename)
|
|
Gets a plugin's priority.
Tags:
Parameters
string |
$p_basename |
Plugin basename |
plugin_protected [line 492]
boolean plugin_protected(
string $p_basename)
|
|
Checks to see if a plugin is 'protected' from uninstall.
Tags:
Parameters
string |
$p_basename |
Plugin basename |
plugin_push_current [line 56]
void plugin_push_current(
string $p_basename)
|
|
Add the current plugin to the stack
Parameters
string |
$p_basename |
Plugin basename |
plugin_register [line 721]
void plugin_register(
string $p_basename, [ $p_return = false], [ $p_child = null])
|
|
Register a plugin with MantisBT. The plugin class must already be loaded before calling.
Parameters
string |
$p_basename |
Plugin classname without 'Plugin' postfix |
|
$p_return |
|
|
$p_child |
|
plugin_register_installed [line 766]
void plugin_register_installed(
)
|
|
Find and register all installed plugins.
plugin_table [line 147]
string plugin_table(
string $p_name, [string $p_basename = null])
|
|
Given a base table name for a plugin, add appropriate prefix and suffix. Convenience for plugin schema definitions.
Tags:
Parameters
string |
$p_name |
Table name |
string |
$p_basename |
Plugin basename (defaults to current plugin) |
plugin_uninstall [line 647]
void plugin_uninstall(
string $p_plugin)
|
|
Uninstall a plugin from the database.
Parameters
string |
$p_plugin |
Plugin basename |
plugin_upgrade [line 589]
multi plugin_upgrade(
string $p_plugin)
|
|
Upgrade an installed plugin's schema.
Tags:
Parameters
string |
$p_plugin |
Plugin basename |
plugin_version_array [line 350]
array plugin_version_array(
string $p_version)
|
|
Converts a version string to an array, using some punctuation and number/lettor boundaries as splitting points.
Tags:
Parameters
string |
$p_version |
Version string |
plugin_version_check [line 378]
int plugin_version_check(
array $p_version1, array $p_version2, [boolean $p_maximum = false])
|
|
Checks two version arrays sequentially for minimum or maximum version dependencies.
Tags:
Parameters
array |
$p_version1 |
Version array to check |
array |
$p_version2 |
Version array required |
boolean |
$p_maximum |
Minimum (false) or maximum (true) version check |
|