Commit 90a681b1 authored by catch's avatar catch

Issue #2730129 by klausi, jibran, dawehner: DrupalKernel must never persist...

Issue #2730129 by klausi, jibran, dawehner: DrupalKernel must never persist service_container for Symfony 3 update
parent 9f01ba74
......@@ -1227,7 +1227,8 @@ protected function compileContainer() {
// be automatically reinstantiated. Also include services tagged to persist.
$persist_ids = array();
foreach ($container->getDefinitions() as $id => $definition) {
if ($definition->isSynthetic() || $definition->getTag('persist')) {
// It does not make sense to persist the container itself, exclude it.
if ($id !== 'service_container' && ($definition->isSynthetic() || $definition->getTag('persist'))) {
$persist_ids[] = $id;
}
}
......
......@@ -146,6 +146,11 @@ public function testCompileDIC() {
'pathname' => drupal_get_filename('module', 'service_provider_test'),
'filename' => NULL,
));
// Check that the container itself is not among the persist IDs because it
// does not make sense to persist the container itself.
$persist_ids = $container->getParameter('persist_ids');
$this->assertIdentical(FALSE, array_search('service_container', $persist_ids));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment