PluginRegistryInterface
The plugin activation/installation store, decoupled from any persistence technology. The host implements it over its database; the package ships in-memory and file-backed implementations. Semantics every implementation MUST honor: - enabledNames() MUST NOT throw when the backing store is unavailable — it returns [] (the boot path treats "store down" as "nothing enabled"). - register() throws \RuntimeException when the name is already registered. - save() and setEnabled() throw \RuntimeException when the name is unknown. - unregister() on an unknown name is a no-op (idempotent).
PluginRegistryInterface::enabledNames()
abstract public function enabledNames(): arrayNames of all enabled plugins — the ONLY registry read the boot path performs.
PluginRegistryInterface::find()
abstract public function find(string $name): ?Milpa\Plugin\Contracts\PluginRecordFind one plugin's record by name, or null when not registered.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string |
PluginRegistryInterface::installed()
abstract public function installed(): arrayAll installed plugins.
PluginRegistryInterface::installedAndEnabled()
abstract public function installedAndEnabled(): arrayAll plugins that are both installed and enabled.
PluginRegistryInterface::register()
abstract public function register(Milpa\Plugin\Contracts\PluginRecord $record): voidRegister a new plugin.
Parameters
| Name | Type | Description |
|---|---|---|
| $record | Milpa\Plugin\Contracts\PluginRecord |
Throws
\RuntimeException When a plugin with the same name is already registered.
PluginRegistryInterface::save()
abstract public function save(Milpa\Plugin\Contracts\PluginRecord $record): voidOverwrite an existing plugin's record (keyed by $record->name).
Parameters
| Name | Type | Description |
|---|---|---|
| $record | Milpa\Plugin\Contracts\PluginRecord |
Throws
\RuntimeException When the plugin is not registered.
PluginRegistryInterface::setEnabled()
abstract public function setEnabled(string $name, bool $enabled): voidFlip a plugin's enabled flag.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $enabled | bool |
Throws
\RuntimeException When the plugin is not registered.
PluginRegistryInterface::unregister()
abstract public function unregister(string $name): voidRemove a plugin from the registry. Unknown name: no-op.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string |
PluginRegistryInterface::invalidateActivationCache()
abstract public function invalidateActivationCache(): voidInvalidate every materialized activation cache so the next boot rebuilds from the store. For the host this means BOTH cache files (enabled_plugins.php AND plugins.php); pure implementations no-op.