File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public function getRouteCollection(): RouteCollection
6969 $ this ->collection ->addResource (new ContainerParametersResource ($ this ->collectedParameters ));
7070
7171 try {
72- $ containerFile = ($ this ->paramFetcher )('kernel.cache_dir ' ).'/ ' .($ this ->paramFetcher )('kernel.container_class ' ).'.php ' ;
72+ $ containerFile = ($ this ->paramFetcher )('kernel.build_dir ' ).'/ ' .($ this ->paramFetcher )('kernel.container_class ' ).'.php ' ;
7373 if (file_exists ($ containerFile )) {
7474 $ this ->collection ->addResource (new FileResource ($ containerFile ));
7575 } else {
@@ -84,14 +84,12 @@ public function getRouteCollection(): RouteCollection
8484
8585 public function warmUp (string $ cacheDir , ?string $ buildDir = null ): array
8686 {
87- if (! $ buildDir ) {
88- return [];
87+ if (null === $ currentDir = $ this -> getOption ( ' cache_dir ' ) ) {
88+ return []; // skip warmUp when router doesn't use cache
8989 }
9090
91- $ currentDir = $ this ->getOption ('cache_dir ' );
92-
93- // force cache generation in build_dir
94- $ this ->setOption ('cache_dir ' , $ buildDir );
91+ // force cache generation
92+ $ this ->setOption ('cache_dir ' , $ buildDir ?? $ cacheDir );
9593 $ this ->getMatcher ();
9694 $ this ->getGenerator ();
9795
You can’t perform that action at this time.
0 commit comments