@@ -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