From 61bdd80e2edea218e3714c95c0c22cbd8294861a Mon Sep 17 00:00:00 2001 From: Quentin Devos <4972091+Okhoshi@users.noreply.github.com> Date: Tue, 30 May 2023 15:55:00 +0200 Subject: [PATCH] [FrameworkBundle] Prevent `cache:clear` to lose files on subsequent runs --- .../FrameworkBundle/Command/CacheClearCommand.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index 053810757a0d8..4d2d8422335bf 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -137,7 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($output->isVerbose()) { $io->comment('Warming up optional cache...'); } - $this->warmupOptionals($realCacheDir); + $this->warmupOptionals($realCacheDir, $realBuildDir); } } else { $fs->mkdir($warmupDir); @@ -152,7 +152,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($output->isVerbose()) { $io->comment('Warming up optional cache...'); } - $this->warmupOptionals($realCacheDir); + $this->warmupOptionals($useBuildDir ? $realCacheDir : $warmupDir, $warmupDir); } } @@ -247,15 +247,15 @@ private function warmup(string $warmupDir, string $realBuildDir): void } } - private function warmupOptionals(string $realCacheDir): void + private function warmupOptionals(string $cacheDir, string $warmupDir): void { $kernel = $this->getApplication()->getKernel(); $warmer = $kernel->getContainer()->get('cache_warmer'); // non optional warmers already ran during container compilation $warmer->enableOnlyOptionalWarmers(); - $preload = (array) $warmer->warmUp($realCacheDir); + $preload = (array) $warmer->warmUp($cacheDir); - if ($preload && file_exists($preloadFile = $realCacheDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) { + if ($preload && file_exists($preloadFile = $warmupDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) { Preloader::append($preloadFile, $preload); } } 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