Skip to content

Commit a5848da

Browse files
Merge branch '7.0' into 7.1
* 7.0: 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 f92f3b8 + 3c2b569 commit a5848da

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
@@ -528,10 +528,17 @@ protected function initializeContainer(): void
528528
touch($oldContainerDir.'.legacy');
529529
}
530530

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

533534
if ($this->container->has('cache_warmer')) {
534-
$preload = array_merge($preload, (array) $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'), $buildDir));
535+
$cacheWarmer = $this->container->get('cache_warmer');
536+
537+
if ($cacheDir !== $buildDir) {
538+
$cacheWarmer->enableOptionalWarmers();
539+
}
540+
541+
$preload = array_merge($preload, (array) $cacheWarmer->warmUp($cacheDir, $buildDir));
535542
}
536543

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

0 commit comments

Comments
 (0)