Skip to content

Commit 4ecd32a

Browse files
Merge branch '7.0' into 7.1
* 7.0: [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 Fix a minor design issue in the Welcome Page [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 0081390 + 1c61627 commit 4ecd32a

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
/**
@@ -50,12 +51,27 @@ public function warmUp(string $cacheDir, ?string $buildDir = null): array
5051

5152
$generator = new ConfigBuilderGenerator($buildDir);
5253

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

74+
foreach ($extensions as $extension) {
5975
try {
6076
$this->dumpExtension($extension, $generator);
6177
} catch (\Exception $e) {

0 commit comments

Comments
 (0)