class extension_loader implements extension_loader_interface

internal  
 

Extension Loader.

Scans the extensions/ directory to discover plugin modules. Loads their metadata and executes their bootstrap logic.

Constants

private CACHE_AREA

private CACHE_KEY

Methods

__construct(string $projectRoot)

No description

void
load(ContainerInterface $container)

Load and execute all extension bootstrap files.

array
get_definitions()

Get all available extension definitions sorted by priority/group.

array
filter_forced_disabled_extensions(array $definitions)

Filter out extensions listed in $CFG->forced_disable_extensions.

array
validate_dependencies(array $definitions)

Validate extension dependencies.

array
scan_directories()

Scan the extensions directory and build raw metadata definitions.

static array
extract_metadata(string $fqcn, string $slug)

Extract metadata information from an extension FQCN.

array
apply_external_plugins(array $definitions)

Allow external plugins to extend the list of extension definitions.

array
sort_definitions(array $definitions)

Sort extension definitions by group, then priority, then slug.

Details

at line 45
__construct(string $projectRoot)

No description

Parameters

string $projectRoot

at line 57
void load(ContainerInterface $container)

Load and execute all extension bootstrap files.

This method is responsible for the "Physical Load":

  • Include bootstrap.php to register container definitions.

Parameters

ContainerInterface $container

Target container instance

Return Value

void

at line 93
array get_definitions()

Get all available extension definitions sorted by priority/group.

Retrieve extension metadata, sorted by priority and group using the Enum logic.

Return Value

array

at line 127
protected array filter_forced_disabled_extensions(array $definitions)

Filter out extensions listed in $CFG->forced_disable_extensions.

Parameters

array $definitions

Return Value

array

at line 153
protected array validate_dependencies(array $definitions)

Validate extension dependencies.

If an extension requires another extension that is not available or disabled, it will be removed from the list.

Parameters

array $definitions

Return Value

array

at line 185
protected array scan_directories()

Scan the extensions directory and build raw metadata definitions.

Return Value

array

at line 222
static protected array extract_metadata(string $fqcn, string $slug)

Extract metadata information from an extension FQCN.

Parameters

string $fqcn
string $slug

Return Value

array

at line 248
protected array apply_external_plugins(array $definitions)

Allow external plugins to extend the list of extension definitions.

Hook for other Moodle plugins to inject extensions into MIDDAG.

Parameters

array $definitions

Return Value

array

at line 276
protected array sort_definitions(array $definitions)

Sort extension definitions by group, then priority, then slug.

Parameters

array $definitions

Return Value

array