Skip to content

ComponentInstaller

Carries out a FactoryDefinitions operation list.

This is the behaviour that used to be generated as PHP statements and included into the context: construct, initialize, start up, in a specific interleaved order. Written once here, it is ordinary code that can be read and tested, rather than a string assembled by a config handler and executed against the context’s private scope.

The order in the operation list is honoured exactly, including the interleaving of construction and startup: the database manager’s startup() has to run before the user is built, because the user may read through it.

final class ComponentInstaller

Since4.0.0
SourceConfig/Factory/ComponentInstaller.php

public function __construct(Context $context): mixed

ParameterTypeDescription
$contextContext

Returns mixed

MethodDescription
install(FactoryDefinitions $definitions): InstalledComponentsBuild and start up every component the definitions declare.

public function install(FactoryDefinitions $definitions): InstalledComponents

Build and start up every component the definitions declare.

ParameterTypeDescription
$definitionsFactoryDefinitions

Returns InstalledComponents

ThrowsWhen
ConfigurationExceptionWhen a declared class is missing, is not a context component, or a startup names a role that was never built.