W3cubDocs

/Drupal 8

protected function DrupalKernel::getContainerCacheKey

protected DrupalKernel::getContainerCacheKey()

Returns the container cache key based on the environment.

The 'environment' consists of:

  • The kernel environment string.
  • The Drupal version constant.
  • The deployment identifier from settings.php. This allows custom deployments to force a container rebuild.
  • The operating system running PHP. This allows compiler passes to optimize services for different operating systems.
  • The paths to any additional container YAMLs from settings.php.

Return value

string The cache key used for the service container.

File

core/lib/Drupal/Core/DrupalKernel.php, line 767

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function getContainerCacheKey() {
  $parts = array('service_container', $this->environment, \Drupal::VERSION, Settings::get('deployment_identifier'), PHP_OS, serialize(Settings::get('container_yamls')));
  return implode(':', $parts);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!DrupalKernel.php/function/DrupalKernel::getContainerCacheKey/8.1.x