InMemoryPluginRegistry
Array-backed registry: the reference implementation of the contract, used by tests and by hosts with no persistence at all.
InMemoryPluginRegistry::enabledNames()
public function enabledNames(): arrayNames of all enabled plugins; never throws — a broken store reads as [].
InMemoryPluginRegistry::find()
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 |
InMemoryPluginRegistry::installed()
public function installed(): arrayAll installed plugins.
InMemoryPluginRegistry::installedAndEnabled()
public function installedAndEnabled(): arrayAll plugins that are both installed and enabled.
InMemoryPluginRegistry::register()
public function register(Milpa\Plugin\Contracts\PluginRecord $record): voidRegister a new plugin; throws if the name is already registered.
Parameters
| Name | Type | Description |
|---|---|---|
| $record | Milpa\Plugin\Contracts\PluginRecord |
InMemoryPluginRegistry::save()
public function save(Milpa\Plugin\Contracts\PluginRecord $record): voidOverwrite an existing plugin's record; throws if the plugin is not registered.
Parameters
| Name | Type | Description |
|---|---|---|
| $record | Milpa\Plugin\Contracts\PluginRecord |
InMemoryPluginRegistry::setEnabled()
public function setEnabled(string $name, bool $enabled): voidFlip a plugin's enabled flag; throws if the plugin is not registered.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $enabled | bool |
InMemoryPluginRegistry::unregister()
public function unregister(string $name): voidRemove a plugin from the registry; unknown name is a no-op.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string |
InMemoryPluginRegistry::invalidateActivationCache()
public function invalidateActivationCache(): voidInvalidate materialized activation caches; nothing to invalidate in-memory.