PluginState final readonly class
Minn\Content\PluginState · public/minn/src/Minn/Content/PluginState.php · 72 lines
Switching plugins on and off: a WordPress plugin file goes through the reference's activation and deactivation (PluginActivation: requirements, the plugin loaded, its hooks, the sorted active_plugins list); a Minn extension joins or leaves minn_active_extensions, and deactivating one also releases, silently, the plugin files it stood in for. The REST toggle and the CLI verbs share this so they cannot drift; both run with the runtime booted.
Constants and properties
| private | readonly Minn\Content\Site $site | Promoted from the constructor. |
| private | readonly Minn\Content\Inventory $inventory | Promoted from the constructor. |
| private | readonly Minn\Extension\Loader $extensions | Promoted from the constructor. |
Public
| new | __construct(Minn\Content\Site $site, Minn\Content\Inventory $inventory, Minn\Extension\Loader $extensions)# | |
| method | find(string $slug): Minn\Extension\Manifest|string|null# | The relative "dir/file.php" of a WordPress plugin, else the extension for a slug, else null. A folder carrying both records in active_plugins like the reference does (the loader counts its own folder there as active); only a pure extension uses the engine's list. |
| method | isActive(Minn\Extension\Manifest|string $plugin): bool# | Whether a plugin, by file, or a Minn extension is active. |
| method | activate(Minn\Extension\Manifest|string $plugin): ?Minn\Runtime\Refusal# | Records a plugin or an extension as active, in the option each kind uses; null, or why a plugin was refused (unexpected_output leaves it active, as the reference does). |
| method | deactivate(Minn\Extension\Manifest|string $plugin): void# | Records a plugin, by file, or a Minn extension as inactive; an extension also deactivates the plugins it replaced. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | ownWithout(Minn\Extension\Manifest $plugin): array# | The active extensions minus one. @return list<string> @return list<string> |
Nothing matches.