|
17 | 17 | use Symfony\Component\Console\Input\InputOption;
|
18 | 18 | use Symfony\Component\Console\Output\OutputInterface;
|
19 | 19 | use Symfony\Component\Console\Style\SymfonyStyle;
|
| 20 | +use Symfony\Component\DependencyInjection\Dumper\Preloader; |
20 | 21 | use Symfony\Component\EventDispatcher\EventDispatcher;
|
21 | 22 | use Symfony\Component\Filesystem\Exception\IOException;
|
22 | 23 | use Symfony\Component\Filesystem\Filesystem;
|
@@ -117,7 +118,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|
117 | 118 | $warmer = $kernel->getContainer()->get('cache_warmer');
|
118 | 119 | // non optional warmers already ran during container compilation
|
119 | 120 | $warmer->enableOnlyOptionalWarmers();
|
120 |
| - $warmer->warmUp($realCacheDir); |
| 121 | + $preload = (array) $warmer->warmUp($warmupDir); |
| 122 | + |
| 123 | + if (file_exists($preloadFile = $warmupDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) { |
| 124 | + Preloader::append($preloadFile, $preload); |
| 125 | + } |
121 | 126 | }
|
122 | 127 | } else {
|
123 | 128 | $fs->mkdir($warmupDir);
|
@@ -193,7 +198,11 @@ private function warmup(string $warmupDir, string $realCacheDir, bool $enableOpt
|
193 | 198 | $warmer = $kernel->getContainer()->get('cache_warmer');
|
194 | 199 | // non optional warmers already ran during container compilation
|
195 | 200 | $warmer->enableOnlyOptionalWarmers();
|
196 |
| - $warmer->warmUp($warmupDir); |
| 201 | + $preload = (array) $warmer->warmUp($warmupDir); |
| 202 | + |
| 203 | + if (file_exists($preloadFile = $warmupDir.'/'.$kernel->getContainer()->getParameter('kernel.container_class').'.preload.php')) { |
| 204 | + Preloader::append($preloadFile, $preload); |
| 205 | + } |
197 | 206 | }
|
198 | 207 |
|
199 | 208 | // fix references to cached files with the real cache directory name
|
|
0 commit comments