Dumps the service container to PHP code in the cache.
ConfigCache $cache The config cache:
ContainerBuilder $container The service container:
string $class The name of the class to generate:
string $baseClass The name of the container's base class:
protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass) {
// cache the container
$dumper = new PhpDumper($container);
$content = $dumper
->dump(array(
'class' => $class,
'base_class' => $baseClass,
));
if (!$this->debug) {
$content = self::stripComments($content);
}
$cache
->write($content, $container
->getResources());
}