PluginInterface
The lifecycle contract every Milpa plugin's main class must implement. Plugins are constructed with the framework's {@see DIContainerInterface} and are taken through install/enable/disable/uninstall by the plugins manager, with {@see boot()} run on every enabled plugin during bootstrap.
PluginInterface::__construct()
abstract public function __construct(Milpa\app\Interfaces\Di\DIContainerInterface $container):Parameters
| Nombre | Tipo | Descripción |
|---|---|---|
| $container | Milpa\app\Interfaces\Di\DIContainerInterface |
PluginInterface::boot()
abstract public function boot(): voidBoots the plugin: registers services, routes, event listeners, etc. Called on every enabled plugin during application bootstrap.
Throws
\Milpa\app\Exceptions\Plugin\PluginBootException If the plugin fails to boot.
PluginInterface::install()
abstract public function install(): voidRuns one-time setup for the plugin (e.g. migrations, initial config). Called when the plugin is installed.
PluginInterface::uninstall()
abstract public function uninstall(): voidReverses what {@see install()} did, cleaning up plugin-owned state. Called when the plugin is uninstalled.
PluginInterface::enable()
abstract public function enable(): voidActivates the plugin so it participates in {@see boot()} on future runs.
PluginInterface::disable()
abstract public function disable(): voidDeactivates the plugin without uninstalling it.