Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.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
  [Validator] Review Romanian (ro) translations
  [Console] Fix display of Table on Windows OS
  [FrameworkBundle] Fix config builder with extensions extended in `build()`
  [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
  • Loading branch information
nicolas-grekas committed Feb 22, 2024
2 parents e8bb1d3 + 224f690 commit 91450b8
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions CacheWarmer/ConfigBuilderCacheWarmer.php
Expand Up @@ -22,6 +22,7 @@
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBag;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;

/**
Expand Down Expand Up @@ -53,12 +54,27 @@ public function warmUp(string $cacheDir /* , string $buildDir = null */): array

$generator = new ConfigBuilderGenerator($buildDir);

foreach ($this->kernel->getBundles() as $bundle) {
$extension = $bundle->getContainerExtension();
if (null === $extension) {
continue;
if ($this->kernel instanceof Kernel) {
/** @var ContainerBuilder $container */
$container = \Closure::bind(function (Kernel $kernel) {
$containerBuilder = $kernel->getContainerBuilder();
$kernel->prepareContainer($containerBuilder);

return $containerBuilder;
}, null, $this->kernel)($this->kernel);

$extensions = $container->getExtensions();
} else {
$extensions = [];
foreach ($this->kernel->getBundles() as $bundle) {
$extension = $bundle->getContainerExtension();
if (null !== $extension) {
$extensions[] = $extension;
}
}
}

foreach ($extensions as $extension) {
try {
$this->dumpExtension($extension, $generator);
} catch (\Exception $e) {
Expand Down

0 comments on commit 91450b8

Please sign in to comment.