You are here

class ConfigReadonlyServiceProvider in Configuration Read-only mode 8

Same name and namespace in other branches
  1. 7 lib/Drupal/config_readonly/ConfigReadonlyServiceProvider.php \Drupal\config_readonly\ConfigReadonlyServiceProvider

Overrides CMI storage.

Hierarchy

Expanded class hierarchy of ConfigReadonlyServiceProvider

File

src/ConfigReadonlyServiceProvider.php, line 14

Namespace

Drupal\config_readonly
View source
class ConfigReadonlyServiceProvider implements ServiceProviderInterface, ServiceModifierInterface {

  /**
   * {@inheritdoc}
   */
  public function register(ContainerBuilder $container) {
  }

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    if ($container
      ->getParameter('kernel.environment') !== 'install') {
      $definition = $container
        ->getDefinition('config.storage');
      $definition
        ->setClass('Drupal\\config_readonly\\Config\\ConfigReadonlyStorage');
      $definition
        ->setArguments([
        new Reference('config.storage.active'),
        new Reference('cache.config'),
        new Reference('lock'),
        new Reference('request_stack'),
        new Reference('module_handler'),
      ]);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigReadonlyServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceModifierInterface::alter
ConfigReadonlyServiceProvider::register public function Registers services to the container. Overrides ServiceProviderInterface::register