You are here

protected function ConfigReadonlyStorage::checkLock in Configuration Read-only mode 7

Same name and namespace in other branches
  1. 8 src/Config/ConfigReadonlyStorage.php \Drupal\config_readonly\Config\ConfigReadonlyStorage::checkLock()
4 calls to ConfigReadonlyStorage::checkLock()
ConfigReadonlyStorage::delete in lib/Drupal/config_readonly/Config/ConfigReadonlyStorage.php
ConfigReadonlyStorage::deleteAll in lib/Drupal/config_readonly/Config/ConfigReadonlyStorage.php
ConfigReadonlyStorage::rename in lib/Drupal/config_readonly/Config/ConfigReadonlyStorage.php
ConfigReadonlyStorage::write in lib/Drupal/config_readonly/Config/ConfigReadonlyStorage.php

File

lib/Drupal/config_readonly/Config/ConfigReadonlyStorage.php, line 54

Class

ConfigReadonlyStorage
Defines the ConfigReadonly storage controller which will fails on write operations.

Namespace

Drupal\config_readonly\Config

Code

protected function checkLock() {

  // If settings.php says to lock config changes and if the config importer
  // isn't running (we do not want to lock config imports), then throw an
  // exception.
  if (settings()
    ->get('config_readonly') && \Drupal::lock()
    ->lockMayBeAvailable('config.importer')) {
    throw new \Exception('Your site configuration active store is currently locked.');
  }
}