Skip to content

Commit 83fcb4f

Browse files
alexandre-dauboisnicolas-grekas
authored andcommitted
[FrameworkBundle][HttpKernel] Display warmers duration on debug verbosity for cache:clear command
1 parent a7ab833 commit 83fcb4f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CHANGELOG
1616
* Configure the `ErrorHandler` on `FrameworkBundle::boot()`
1717
* Allow setting `debug.container.dump` to `false` to disable dumping the container to XML
1818
* Add `framework.http_cache.skip_response_headers` option
19+
* Display warmers duration on debug verbosity for `cache:clear` command
1920

2021
6.2
2122
---

Command/CacheClearCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
132132
$warmer = $kernel->getContainer()->get('cache_warmer');
133133
// non optional warmers already ran during container compilation
134134
$warmer->enableOnlyOptionalWarmers();
135-
$preload = (array) $warmer->warmUp($realCacheDir);
135+
$preload = (array) $warmer->warmUp($realCacheDir, $io);
136136

137137
if ($preload && file_exists($preloadFile = $realCacheDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) {
138138
Preloader::append($preloadFile, $preload);
@@ -145,7 +145,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
145145
if ($output->isVerbose()) {
146146
$io->comment('Warming up cache...');
147147
}
148-
$this->warmup($warmupDir, $realCacheDir, !$input->getOption('no-optional-warmers'));
148+
$this->warmup($io, $warmupDir, $realCacheDir, !$input->getOption('no-optional-warmers'));
149149
}
150150

151151
if (!$fs->exists($warmupDir.'/'.$containerDir)) {
@@ -219,7 +219,7 @@ private function isNfs(string $dir): bool
219219
return false;
220220
}
221221

222-
private function warmup(string $warmupDir, string $realBuildDir, bool $enableOptionalWarmers = true): void
222+
private function warmup(SymfonyStyle $io, string $warmupDir, string $realBuildDir, bool $enableOptionalWarmers = true): void
223223
{
224224
// create a temporary kernel
225225
$kernel = $this->getApplication()->getKernel();
@@ -233,7 +233,7 @@ private function warmup(string $warmupDir, string $realBuildDir, bool $enableOpt
233233
$warmer = $kernel->getContainer()->get('cache_warmer');
234234
// non optional warmers already ran during container compilation
235235
$warmer->enableOnlyOptionalWarmers();
236-
$preload = (array) $warmer->warmUp($warmupDir);
236+
$preload = (array) $warmer->warmUp($warmupDir, $io);
237237

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

0 commit comments

Comments
 (0)