plugin_support
class plugin_support
| internal |
Unified wrapper for Moodle plugin APIs.
Provides stable access to plugin metadata across Moodle versions, encapsulating differences between:
- core_component vs \core\component
- core_plugin_manager vs plugin_manager
Returns DTOs instead of core plugininfo objects to ensure stability and avoid exposing Moodle internals directly.
Methods
Initializes the plugin manager and component class based on Moodle version.
Retrieves all plugin types installed in Moodle.
Retrieves list of plugins of a specific type.
Checks if a plugin exists on disk.
Retrieves the plugin directory path on disk.
Retrieves the display name of a plugin.
Retrieves a DTO containing complete plugin metadata.
Retrieves all plugins as DTOs, grouped by type.
Retrieves all enabled plugins as DTOs.
Checks if a specific plugin is enabled.
Details
at line 51
__construct()
Initializes the plugin manager and component class based on Moodle version.
at line 68
array
get_plugin_types()
Retrieves all plugin types installed in Moodle.
at line 80
array
get_plugins_of_type(string $type)
Retrieves list of plugins of a specific type.
at line 93
bool
plugin_exists(string $type, string $plugin)
Checks if a plugin exists on disk.
at line 108
string
get_plugin_directory(string $type, string $plugin)
Retrieves the plugin directory path on disk.
at line 127
string
plugin_displayname(string $type, string $plugin)
Retrieves the display name of a plugin.
at line 142
plugin_dto
get_plugin_info(string $type, string $plugin)
Retrieves a DTO containing complete plugin metadata.
at line 188
array
get_all_plugins()
Retrieves all plugins as DTOs, grouped by type.
at line 208
array
get_enabled_plugins()
Retrieves all enabled plugins as DTOs.
at line 233
bool
is_enabled(string $type, string $plugin)
Checks if a specific plugin is enabled.