diff --git a/core/core.services.yml b/core/core.services.yml index d8bac8f4be9..6ff5dd54fa3 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -38,10 +38,6 @@ services: class: Drupal\Core\Cache\ApcuBackendFactory cache.backend.php: class: Drupal\Core\Cache\PhpBackendFactory - cache.backend.memory: - class: Drupal\Core\Cache\MemoryBackendFactory - cache.backend.null: - class: Drupal\Core\Cache\NullBackendFactory cache.bootstrap: class: Drupal\Core\Cache\CacheBackendInterface tags: diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index e54cf895163..2551a4d0204 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -526,8 +526,8 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface { } } } - if (!empty($GLOBALS['conf']['container_yamls'])) { - $this->serviceYamls['site'] = $GLOBALS['conf']['container_yamls']; + if ($container_yamls = Settings::get('container_yamls')) { + $this->serviceYamls['site'] = $container_yamls; } if (file_exists($site_services_yml = $this->getSitePath() . '/services.yml')) { $this->serviceYamls['site'][] = $site_services_yml; diff --git a/sites/development.services.yml b/sites/development.services.yml new file mode 100644 index 00000000000..cc212117dc8 --- /dev/null +++ b/sites/development.services.yml @@ -0,0 +1,9 @@ +# Local development services. +# +# To activate this feature, follow the instructions at the top of the +# 'example.settings.local.php' file, which sits next to this file. +services: + cache.backend.memory: + class: Drupal\Core\Cache\MemoryBackendFactory + cache.backend.null: + class: Drupal\Core\Cache\NullBackendFactory diff --git a/sites/example.settings.local.php b/sites/example.settings.local.php index 1847f865fe5..19f398ce4c4 100644 --- a/sites/example.settings.local.php +++ b/sites/example.settings.local.php @@ -10,6 +10,9 @@ * mention 'settings.local.php'. */ +// Enable local development services. +$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml'; + // Show all error messages, with backtrace information. $config['system.logging']['error_level'] = 'verbose'; @@ -17,7 +20,8 @@ $config['system.logging']['error_level'] = 'verbose'; $config['system.performance']['css']['preprocess'] = FALSE; $config['system.performance']['js']['preprocess'] = FALSE; -// Disable the render cache, by using the Null cache back-end. +// Disable the render cache, by using the Null cache back-end defined by the +// development.services.yml file above. $settings['cache']['bins']['render'] = 'cache.backend.null'; /**