[HttpKernel] Allow override of ContainerBuilder instance used to build container
This commit is contained in:
parent
b2af6b4f24
commit
82bbf3b8b1
@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user