File tree 1 file changed +7
-1
lines changed
Filter options
src/Symfony/Bundle/FrameworkBundle/Command 1 file changed +7
-1
lines changed
Original file line number Diff line number Diff line change 18
18
use Symfony \Component \Console \Style \SymfonyStyle ;
19
19
use Symfony \Component \DependencyInjection \Dumper \Preloader ;
20
20
use Symfony \Component \HttpKernel \CacheWarmer \CacheWarmerAggregate ;
21
+ use Symfony \Component \HttpKernel \CacheWarmer \WarmableInterface ;
21
22
22
23
/**
23
24
* Warmup the cache.
@@ -73,8 +74,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
73
74
if (!$ input ->getOption ('no-optional-warmers ' )) {
74
75
$ this ->cacheWarmer ->enableOptionalWarmers ();
75
76
}
77
+ $ cacheDir = $ kernel ->getContainer ()->getParameter ('kernel.cache_dir ' );
76
78
77
- $ preload = $ this ->cacheWarmer ->warmUp ($ cacheDir = $ kernel ->getContainer ()->getParameter ('kernel.cache_dir ' ));
79
+ if ($ kernel instanceof WarmableInterface) {
80
+ $ kernel ->warmUp ($ cacheDir );
81
+ }
82
+
83
+ $ preload = $ this ->cacheWarmer ->warmUp ($ cacheDir );
78
84
79
85
if ($ preload && file_exists ($ preloadFile = $ cacheDir .'/ ' .$ kernel ->getContainer ()->getParameter ('kernel.container_class ' ).'.preload.php ' )) {
80
86
Preloader::append ($ preloadFile , $ preload );
You can’t perform that action at this time.
0 commit comments