Skip to content

Commit 04f4eaf

Browse files
committed
[FrameworkBundle] Prevent to lose files on subsequent runs
1 parent 3bc1a40 commit 04f4eaf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines 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)
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