class service_loader implements service_loader_interface

internal  
 

Service Loader.

Responsible for the "Auto-Discovery" of services. It scans specific directories and registers found classes into the Dependency Injection Container. Automatically scans folders and registers VALID services into the DI Container.

It uses a "Convention over Configuration" approach:

  • It scans the framework and extensions directories.
  • It ignores specific infrastructure/contract folders.
  • It verifies if dependencies can be resolved before registering.

Constants

private CACHE_AREA

private CACHE_KEY

private DISCOVERABLE_DOMAIN_PATHS

Aggregate subdirectories inside framework/domain that are allowed to expose services, repositories, mappers and contracts to the container.

private DISCOVERABLE_DOMAIN_PATTERN

private DISCOVERABLE_SHARED_PATHS

Shared subdirectories that can expose container-managed builders.

private DISCOVERABLE_SHARED_PATTERN

private IGNORED_DOMAINS

List of directories that MUST NEVER be registered as services.

These contain abstract code, contracts, or static logic.

Methods

__construct(ContainerBuilder $container, string $project_root)

Constructor.

void
load(ContainerInterface $container)

Run the discovery and registration process.

Details

at line 122
__construct(ContainerBuilder $container, string $project_root)

Constructor.

Parameters

ContainerBuilder $container
string $project_root

at line 132
void load(ContainerInterface $container)

Run the discovery and registration process.

Parameters

ContainerInterface $container

Target container instance

Return Value

void