Skip to content
docsv0.13.1

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(): array

Names of all enabled plugins; never throws — a broken store reads as [].

InMemoryPluginRegistry::find()

public function find(string $name): ?Milpa\Plugin\Contracts\PluginRecord

Find one plugin's record by name, or null when not registered.

Parameters

Parameters of find()
NameTypeDescription
$namestring

InMemoryPluginRegistry::installed()

public function installed(): array

All installed plugins.

InMemoryPluginRegistry::installedAndEnabled()

public function installedAndEnabled(): array

All plugins that are both installed and enabled.

InMemoryPluginRegistry::register()

public function register(Milpa\Plugin\Contracts\PluginRecord $record): void

Register a new plugin; throws if the name is already registered.

Parameters

Parameters of register()
NameTypeDescription
$recordMilpa\Plugin\Contracts\PluginRecord

InMemoryPluginRegistry::save()

public function save(Milpa\Plugin\Contracts\PluginRecord $record): void

Overwrite an existing plugin's record; throws if the plugin is not registered.

Parameters

Parameters of save()
NameTypeDescription
$recordMilpa\Plugin\Contracts\PluginRecord

InMemoryPluginRegistry::setEnabled()

public function setEnabled(string $name, bool $enabled): void

Flip a plugin's enabled flag; throws if the plugin is not registered.

Parameters

Parameters of setEnabled()
NameTypeDescription
$namestring
$enabledbool

InMemoryPluginRegistry::unregister()

public function unregister(string $name): void

Remove a plugin from the registry; unknown name is a no-op.

Parameters

Parameters of unregister()
NameTypeDescription
$namestring

InMemoryPluginRegistry::invalidateActivationCache()

public function invalidateActivationCache(): void

Invalidate materialized activation caches; nothing to invalidate in-memory.