protected function DrupalKernel::dumpDrupalContainer

Dumps the service container to PHP code in the config directory.

This method is based on the dumpContainer method in the parent class, but that method is reliant on the Config component which we do not use here.

Parameters

ContainerBuilder $container: The service container.

string $baseClass: The name of the container's base class

Return value

bool TRUE if the container was successfully dumped to disk.

1 call to DrupalKernel::dumpDrupalContainer()
DrupalKernel::boot in drupal/core/lib/Drupal/Core/DrupalKernel.php
Overrides Kernel::boot().

File

drupal/core/lib/Drupal/Core/DrupalKernel.php, line 489
Definition of Drupal\Core\DrupalKernel.

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function dumpDrupalContainer(ContainerBuilder $container, $baseClass) {
  if (!$this
    ->storage()
    ->writeable()) {
    return FALSE;
  }

  // Cache the container.
  $dumper = new PhpDumper($container);
  $class = $this
    ->getClassName();
  $content = $dumper
    ->dump(array(
    'class' => $class,
    'base_class' => $baseClass,
  ));
  return $this
    ->storage()
    ->save($class . '.php', $content);
}