[HttpKernel] Allow override of ContainerBuilder instance used to build container

This commit is contained in:
Drak 2012-04-13 09:56:28 +05:45
parent b2af6b4f24
commit 82bbf3b8b1

View File

@ -640,7 +640,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface
}
}
$container = new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
$container = $this->getContainerBuilder();
$extensions = array();
foreach ($this->bundles as $bundle) {
if ($extension = $bundle->getContainerExtension()) {
@ -671,6 +671,16 @@ abstract class Kernel implements KernelInterface, TerminableInterface
return $container;
}
/**
* Gets a new ContainerBuilder instance used to build the service container.
*
* @return ContainerBuilder
*/
protected function getContainerBuilder()
{
return new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
}
/**
* Dumps the service container to PHP code in the cache.
*