Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f10c2cc

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

File tree

1 file changed

+7
-1
lines changed
Filter options

1 file changed

+7
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php
+7-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.