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 56
__construct(extension_loader_interface $loader)
Constructor.
at line 67
extension_interface|null
get(string $slug)
Get a registered extension by its slug.
at line 79
array
get_all()
Get all registered extension instances.
at line 91
array
get_active_extensions()
Get only the enabled extension instances.
at line 111
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 143
bool
is_enabled(string $slug)
Check if an extension is enabled via Moodle config.
at line 175
void
enable(string $slug)
Enable an extension in the configuration.
at line 185
void
disable(string $slug)
Disable an extension in the configuration.
at line 199
array
list_for_ui()
Prepare data structure for the Frontend/UI listing.
at line 253
static moodle_url
get_icon_url(string $slug)
Get the URL for the extension icon.
at line 275
protected array
resolve_boot_order()
Resolve the order in which extensions should be booted based on dependencies.
at line 312
protected bool
validate_dependencies(extension_interface $extension)
Validate if all dependencies for an extension are enabled and available.