Skip to content

Commit 1c61627

Browse files
Merge branch '6.4' into 7.0
* 6.4: [DependencyInjection] Fix computing error messages involving service locators [Serializer] Fix unknown types normalization type when know type [ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3 [AssetMapper] Fix enquoted string pattern [Validator] Review Romanian (ro) translations [Console] Fix display of Table on Windows OS [FrameworkBundle] Fix config builder with extensions extended in `build()` [Translation] Fix extracting qualified t() function calls Fix vertical table on windows Fix the `command -v` exception when the command option with a dash prefix [WebProfilerBundle] disable turbo in web profiler toolbar to avoid link prefetching explicitly cast boolean SSL stream options return the unchanged text if preg_replace_callback() fails the 'use_notify' option is on the factory, not on the postgres connection class review translations
2 parents 6a8838a + 91450b8 commit 1c61627

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

CacheWarmer/ConfigBuilderCacheWarmer.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBag;
2323
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
2424
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
25+
use Symfony\Component\HttpKernel\Kernel;
2526
use Symfony\Component\HttpKernel\KernelInterface;
2627

2728
/**
@@ -48,12 +49,27 @@ public function warmUp(string $cacheDir, ?string $buildDir = null): array
4849

4950
$generator = new ConfigBuilderGenerator($buildDir);
5051

51-
foreach ($this->kernel->getBundles() as $bundle) {
52-
$extension = $bundle->getContainerExtension();
53-
if (null === $extension) {
54-
continue;
52+
if ($this->kernel instanceof Kernel) {
53+
/** @var ContainerBuilder $container */
54+
$container = \Closure::bind(function (Kernel $kernel) {
55+
$containerBuilder = $kernel->getContainerBuilder();
56+
$kernel->prepareContainer($containerBuilder);
57+
58+
return $containerBuilder;
59+
}, null, $this->kernel)($this->kernel);
60+
61+
$extensions = $container->getExtensions();
62+
} else {
63+
$extensions = [];
64+
foreach ($this->kernel->getBundles() as $bundle) {
65+
$extension = $bundle->getContainerExtension();
66+
if (null !== $extension) {
67+
$extensions[] = $extension;
68+
}
5569
}
70+
}
5671

72+
foreach ($extensions as $extension) {
5773
try {
5874
$this->dumpExtension($extension, $generator);
5975
} catch (\Exception $e) {

0 commit comments

Comments
 (0)