extension_service
class extension_service implements extension_service_interface
| internal |
Extension Service.
Service responsible for managing the state and settings of extensions. Acts as the bridge between the technical implementation (Classes/Container) and the user experience (UI, Settings, Enabling/Disabling).
Methods
Get a registered extension by its slug.
Get all registered extension instances.
Get only the enabled extension instances.
Boot all enabled extensions.
Check if an extension is enabled via Moodle config.
Enable an extension in the configuration.
Disable an extension in the configuration.
Prepare data structure for the Frontend/UI listing.
Get the URL for the extension icon.
Resolve the order in which extensions should be booted based on dependencies.
Validate if all dependencies for an extension are enabled and available.
Details
at line 57
__construct(extension_loader_interface $loader)
Constructor.
at line 68
extension_interface|null
get(string $slug)
Get a registered extension by its slug.
at line 80
array
get_all()
Get all registered extension instances.
at line 92
array
get_active_extensions()
Get only the enabled extension instances.
at line 112
void
boot_all()
Boot all enabled extensions.
This is the "Runtime Entry Point". It registers controllers, hooks, and executes specific boot logic for each enabled extension.
at line 144
bool
is_enabled(string $slug)
Check if an extension is enabled via Moodle config.
at line 176
void
enable(string $slug)
Enable an extension in the configuration.
at line 186
void
disable(string $slug)
Disable an extension in the configuration.
at line 200
array
list_for_ui()
Prepare data structure for the Frontend/UI listing.
at line 258
static moodle_url
get_icon_url(string $slug)
Get the URL for the extension icon.
at line 280
protected array
resolve_boot_order()
Resolve the order in which extensions should be booted based on dependencies.
at line 317
protected bool
validate_dependencies(extension_interface $extension)
Validate if all dependencies for an extension are enabled and available.