The plugin system for MantisBT is designed as a lightweight extension to the standard MantisBT API, allowing for simple and flexible addition of new features and customization of core operations. It takes advantage ofthe new Event System to offer developers rapid creation and testing of extensions, without the need to modify core files.
Plugins are defined as implementations, or subclasses, of the
MantisPlugin
class as defined in
core/classes/MantisPlugin.php. Each plugin may define
information about itself, as well as a list of conflicts and dependencies
upon other plugins. There are many methods defined in the
MantisPlugin
class that may be used as convenient
places to define extra behaviors, such as configuration options, event
declarations, event hooks, errors, and database schemas. Outside a plugin's
core class, there is a standard method of handling language strings, content
pages, and files.
At page load, the core MantisBT API will find and process any conforming plugins. Plugins will be checked for minimal information, such as its name, version, and dependencies. Plugins that meet requirements will then be initialized. At this point, MantisBT will interact with the plugins when appropriate.
The plugin system includes a special set of API functions that provide convenience wrappers around the more useful MantisBT API calls, including configuration, language strings, and link generation. This API allows plugins to use core API's in "sandboxed" fashions to aid interoperation with other plugins, and simplification of common functionality.