8000 [FrameworkBundle] Fix eager-loading of env vars in ConfigBuilderCache… · symfony/symfony@0b014d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b014d1

Browse files
[FrameworkBundle] Fix eager-loading of env vars in ConfigBuilderCacheWarmer
1 parent 9a4b832 commit 0b014d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ConfigBuilderCacheWarmer.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
use Symfony\Component\Config\Builder\ConfigBuilderGenerator;
1616
use Symfony\Component\Config\Builder\ConfigBuilderGeneratorInterface;
1717
use Symfony\Component\Config\Definition\ConfigurationInterface;
18-
use Symfony\Component\DependencyInjection\ContainerBuilder;
18+
use Symfony\Component\DependencyInjection\Container;
1919
use Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface;
2020
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
21+
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBag;
22+
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
2123
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
2224
use Symfony\Component\HttpKernel\KernelInterface;
2325

@@ -71,7 +73,8 @@ private function dumpExtension(ExtensionInterface $extension, ConfigBuilderGener
7173
if ($extension instanceof ConfigurationInterface) {
7274
$configuration = $extension;
7375
} elseif ($extension instanceof ConfigurationExtensionInterface) {
74-
$configuration = $extension->getConfiguration([], new ContainerBuilder($this->kernel->getContainer()->getParameterBag()));
76+
$container = $this->kernel->getContainer();
77+
$configuration = $extension->getConfiguration([], $container instanceof Container ? new ContainerBag($container) : new ParameterBag());
7578
}
7679

7780
if (!$configuration) {

0 commit comments

Comments
 (0)
0