W3cubDocs

/Drupal 8

protected function DrupalKernel::cacheDrupalContainer

protected DrupalKernel::cacheDrupalContainer(array $container_definition)

Stores the container definition in a cache.

Parameters

array $container_definition: The container definition to cache.

Return value

bool TRUE if the container was successfully cached.

File

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

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function cacheDrupalContainer(array $container_definition) {
  $saved = TRUE;
  try {
    $this->bootstrapContainer->get('cache.container')->set($this->getContainerCacheKey(), $container_definition);
  }
  catch (\Exception $e) {
    // There is no way to get from the Cache API if the cache set was
    // successful or not, hence an Exception is caught and the caller informed
    // about the error condition.
    $saved = FALSE;
  }

  return $saved;
}

© 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::cacheDrupalContainer/8.1.x