Skip to content

Commit 3c2b569

Browse files
Merge branch '6.4' into 7.0
* 6.4: Revert "bug #57520 [SecurityBundle] Remove unused memory users’ `name` attribute from the XSD (MatTheCat)" [HttpKernel] Enable optional cache-warmers when cache-dir != build-dir [Filesystem] Fix Filesystem::remove() on Windows [DoctrineBridge] Fix compat with DI >= 6.4 [String] Fix *String::snake methods
2 parents 6e1b446 + 6cc95b3 commit 3c2b569

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Kernel.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,17 @@ protected function initializeContainer(): void
521521
touch($oldContainerDir.'.legacy');
522522
}
523523

524-
$preload = $this instanceof WarmableInterface ? (array) $this->warmUp($this->container->getParameter('kernel.cache_dir'), $buildDir) : [];
524+
$cacheDir = $this->container->getParameter('kernel.cache_dir');
525+
$preload = $this instanceof WarmableInterface ? (array) $this->warmUp($cacheDir, $buildDir) : [];
525526

526527
if ($this->container->has('cache_warmer')) {
527-
$preload = array_merge($preload, (array) $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'), $buildDir));
528+
$cacheWarmer = $this->container->get('cache_warmer');
529+
530+
if ($cacheDir !== $buildDir) {
531+
$cacheWarmer->enableOptionalWarmers();
532+
}
533+
534+
$preload = array_merge($preload, (array) $cacheWarmer->warmUp($cacheDir, $buildDir));
528535
}
529536

530537
if ($preload && file_exists($preloadFile = $buildDir.'/'.$class.'.preload.php')) {

0 commit comments

Comments
 (0)