Skip to content

Commit ca92f45

Browse files
committed
[FrameworkBundle] Prevent to lose files on subsequent runs
1 parent 380e709 commit ca92f45

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
@@ -129,7 +129,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
129129
if ($output->isVerbose()) {
130130
$io->comment('Warming up optional cache...');
131131
}
132-
$this->warmupOptionals($realCacheDir);
132+
$this->warmupOptionals($realCacheDir, $realBuildDir);
133133
}
134134
} else {
135135
$fs->mkdir($warmupDir);
@@ -144,7 +144,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
144144
if ($output->isVerbose()) {
145145
$io->comment('Warming up optional cache...');
146146
}
147-
$this->warmupOptionals($realCacheDir);
147+
$this->warmupOptionals($useBuildDir ? $realCacheDir : $warmupDir, $warmupDir);
148148
}
149149
}
150150

@@ -239,15 +239,15 @@ private function warmup(string $warmupDir, string $realBuildDir): void
239239
}
240240
}
241241

242-
private function warmupOptionals(string $realCacheDir): void
242+
private function warmupOptionals(string $cacheDir, string $warmupDir): void
243243
{
244244
$kernel = $this->getApplication()->getKernel();
245245
$warmer = $kernel->getContainer()->get('cache_warmer');
246246
// non optional warmers already ran during container compilation
247247
$warmer->enableOnlyOptionalWarmers();
248-
$preload = (array) $warmer->warmUp($realCacheDir);
248+
$preload = (array) $warmer->warmUp($cacheDir);
249249

250-
if ($preload && file_exists($preloadFile = $realCacheDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) {
250+
if ($preload && file_exists($preloadFile = $warmupDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) {
251251
Preloader::append($preloadFile, $preload);
252252
}
253253
}

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