You are here

public function ConfigSelectorServiceProvider::register in Configuration selector 8.2

Same name and namespace in other branches
  1. 8 src/ConfigSelectorServiceProvider.php \Drupal\config_selector\ConfigSelectorServiceProvider::register()

Registers the config_selector.decorating_config.installer service.

This service decorates the config.installer so the optional profile configuration can be selected during installation.

Parameters

\Drupal\Core\DependencyInjection\ContainerBuilder $container: The container builder.

Overrides ServiceProviderInterface::register

File

src/ConfigSelectorServiceProvider.php, line 24

Class

ConfigSelectorServiceProvider
ServiceProvider class for the Configuration Selector.

Namespace

Drupal\config_selector

Code

public function register(ContainerBuilder $container) {

  // We only need to do this during an installation.
  if (!InstallerKernel::installationAttempted()) {
    return;
  }
  $container
    ->register('config_selector.decorating_config.installer', DecoratingConfigInstaller::class)
    ->setDecoratedService('config.installer')
    ->addArgument(new Reference('config_selector.decorating_config.installer.inner'))
    ->addArgument(new Reference('config_selector'))
    ->setPublic(FALSE);
}