Skip to content

Commit a9de0aa

Browse files
minor #36644 [FrameworkBundle][CacheWarmupCommand] Append files to preload (fancyweb)
This PR was merged into the 5.1-dev branch. Discussion ---------- [FrameworkBundle][CacheWarmupCommand] Append files to preload | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Files returned by the warmUp() method must be added to the preload file. I also added checks to avoid empty preload calls in the preload file like this: ``` $classes = []; Preloader::preload($classes); ``` Commits ------- a82c7ab4c0 [FrameworkBundle][CacheWarmupCommand] Append files to preload
2 parents 85ed61f + b5c7ec2 commit a9de0aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ protected function initializeContainer()
569569
if ($this->container->has('cache_warmer')) {
570570
$preload = (array) $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
571571

572-
if (method_exists(Preloader::class, 'append') && file_exists($preloadFile = $cacheDir.'/'.$class.'.preload.php')) {
572+
if ($preload && method_exists(Preloader::class, 'append') && file_exists($preloadFile = $cacheDir.'/'.$class.'.preload.php')) {
573573
Preloader::append($preloadFile, $preload);
574574
}
575575
}

0 commit comments

Comments
 (0)