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 61bdd80

Browse filesBrowse files
committed
[FrameworkBundle] Prevent cache:clear to lose files on subsequent runs
1 parent 3bc1a40 commit 61bdd80
Copy full SHA for 61bdd80

File tree

1 file changed

+5
-5
lines changed
Filter options

1 file changed

+5
-5
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
137137
if ($output->isVerbose()) {
138138
$io->comment('Warming up optional cache...');
139139
}
140-
$this->warmupOptionals($realCacheDir);
140+
$this->warmupOptionals($realCacheDir, $realBuildDir);
141141
}
142142
} else {
143143
$fs->mkdir($warmupDir);
@@ -152,7 +152,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
152152
if ($output->isVerbose()) {
153153
$io->comment('Warming up optional cache...');
154154
}
155-
$this->warmupOptionals($realCacheDir);
155+
$this->warmupOptionals($useBuildDir ? $realCacheDir : $warmupDir, $warmupDir);
156156
}
157157
}
158158

@@ -247,15 +247,15 @@ private function warmup(string $warmupDir, string $realBuildDir): void
247247
}
248248
}
249249

250-
private function warmupOptionals(string $realCacheDir): void
250+
private function warmupOptionals(string $cacheDir, string $warmupDir): void
251251
{
252252
$kernel = $this->getApplication()->getKernel();
253253
$warmer = $kernel->getContainer()->get('cache_warmer');
254254
// non optional warmers already ran during container compilation
255255
$warmer->enableOnlyOptionalWarmers();
256-
$preload = (array) $warmer->warmUp($realCacheDir);
256+
$preload = (array) $warmer->warmUp($cacheDir);
257257

258-
if ($preload && file_exists($preloadFile = $realCacheDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) {
258+
if ($preload && file_exists($preloadFile = $warmupDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) {
259259
Preloader::append($preloadFile, $preload);
260260
}
261261
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.