<chapter id="dev.plugins">
	<title>Plugin System</title>

	<sect1 id="dev.plugins.concepts">
		<title>General Concepts</title>

		<para>
			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
			<link linkend="dev.events">Event System</link> to offer developers rapid
			creation and testing of extensions, without the need to modify core files.
		</para>

		<para>
			Plugins are defined as implementations, or subclasses, of the
			<classname>MantisPlugin</classname> class as defined in
			<filename>core/classes/MantisPlugin.php</filename>.  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
			<classname>MantisPlugin</classname> 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.
		</para>

		<para>
			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.
		</para>

		<para>
			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.
		</para>
	</sect1>

	&plugins-building;
	&plugins-building-source;

	<sect1 id="dev.plugins.api">
		<title>API Usage</title>

		<para>
			This is a general overview of the plugin API.  For more detailed analysis,
			you may reference the file <filename>core/plugin_api.php</filename> in the
			codebase.
		</para>
	</sect1>
</chapter>
