class PluginManager (View source)

Properties

protected Plugin[] $plugins

The list of available plugins.

protected string[] $selectedPlugins

The handles of the selected plugins.

Methods

register(Plugin|string $plugin, string|null $name = null)

Register a new plugin, adding it to the list of available plugins.

Plugin[]
getAvailablePlugins()

Get the list of available plugins.

bool
isSelected(Plugin|string $key)

Check if a plugin is selected (enabled).

bool
isAvailable(Plugin|string $key)

Check if a plugin is registered (available).

select(Plugin|Plugin[]|string|string[] $keyOrKeys)

Mark a plugin as selected (enabled).

deselect(Plugin|Plugin[]|string|string[] $keyOrKeys)

Mark a plugin as not selected (disabled).

string[]
getSelectedPlugins()

Get the list of selected (enabled) plugin handles.

Plugin[]
getSelectedPluginObjects()

Get the list of selected (enabled) plugin instances.

selectMultiple(mixed $plugins) deprecated

No description

Details

register(Plugin|string $plugin, string|null $name = null)

Register a new plugin, adding it to the list of available plugins.

Parameters

Plugin|string $plugin

the plugin to register (or its handle)

string|null $name

the name of the plugin (if $plugin is the plugin handle

Exceptions

Exception

throws an Exception if $plugin is the plugin handle, but $name is empty

Plugin[] getAvailablePlugins()

Get the list of available plugins.

Return Value

Plugin[]

bool isSelected(Plugin|string $key)

Check if a plugin is selected (enabled).

Parameters

Plugin|string $key

the plugin to be checked (or its handle)

Return Value

bool

bool isAvailable(Plugin|string $key)

Check if a plugin is registered (available).

Parameters

Plugin|string $key

the plugin to be checked (or its handle)

Return Value

bool

select(Plugin|Plugin[]|string|string[] $keyOrKeys)

Mark a plugin as selected (enabled).

Parameters

Plugin|Plugin[]|string|string[] $keyOrKeys

the plugin(s) to be marked as selected (or their handles)

deselect(Plugin|Plugin[]|string|string[] $keyOrKeys)

Mark a plugin as not selected (disabled).

Parameters

Plugin|Plugin[]|string|string[] $keyOrKeys

the plugin(s) to be marked as unselected (or their handles)

string[] getSelectedPlugins()

Get the list of selected (enabled) plugin handles.

Return Value

string[]

Plugin[] getSelectedPluginObjects()

Get the list of selected (enabled) plugin instances.

Return Value

Plugin[]

selectMultiple(mixed $plugins) deprecated

deprecated Use the select() method

No description

Parameters

mixed $plugins