Skip to content

Commit f10c2cc

Browse files
[FrameworkBundle] Fix calling Kernel::warmUp() when running cache:warmup
1 parent e86d26a commit f10c2cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Console\Style\SymfonyStyle;
1919
use Symfony\Component\DependencyInjection\Dumper\Preloader;
2020
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate;
21+
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface;
2122

2223
/**
2324
* Warmup the cache.
@@ -73,8 +74,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7374
if (!$input->getOption('no-optional-warmers')) {
7475
$this->cacheWarmer->enableOptionalWarmers();
7576
}
77+
$cacheDir = $kernel->getContainer()->getParameter('kernel.cache_dir');
7678

77-
$preload = $this->cacheWarmer->warmUp($cacheDir = $kernel->getContainer()->getParameter('kernel.cache_dir'));
79+
if ($kernel instanceof WarmableInterface) {
80+
$kernel->warmUp($cacheDir);
81+
}
82+
83+
$preload = $this->cacheWarmer->warmUp($cacheDir);
7884

7985
if ($preload && file_exists($preloadFile = $cacheDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) {
8086
Preloader::append($preloadFile, $preload);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy