You are here

public function ConfigReadonlyServiceProvider::alter in Configuration Read-only mode 7

Same name and namespace in other branches
  1. 8 src/ConfigReadonlyServiceProvider.php \Drupal\config_readonly\ConfigReadonlyServiceProvider::alter()

File

lib/Drupal/config_readonly/ConfigReadonlyServiceProvider.php, line 29
Contains \Drupal\config_readonly\ConfigReadonlyServiceProvider.

Class

ConfigReadonlyServiceProvider
Overrides CMI storage.

Namespace

Drupal\config_readonly

Code

public function alter(ContainerBuilder $container) {
  if ($container
    ->getParameter('kernel.environment') !== 'install') {
    $definition = $container
      ->getDefinition('config.storage');
    $definition
      ->setClass('Drupal\\config_readonly\\Config\\ConfigReadonlyStorage');
  }
}