File tree 1 file changed +5
-7
lines changed
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
69
69
$ this ->collection ->addResource (new ContainerParametersResource ($ this ->collectedParameters ));
70
70
71
71
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 ' ;
73
73
if (file_exists ($ containerFile )) {
74
74
$ this ->collection ->addResource (new FileResource ($ containerFile ));
75
75
} else {
@@ -84,14 +84,12 @@ public function getRouteCollection(): RouteCollection
84
84
85
85
public function warmUp (string $ cacheDir , ?string $ buildDir = null ): array
86
86
{
87
- if (! $ buildDir ) {
88
- return [];
87
+ if (null === $ currentDir = $ this -> getOption ( ' cache_dir ' ) ) {
88
+ return []; // skip warmUp when router doesn't use cache
89
89
}
90
90
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 );
95
93
$ this ->getMatcher ();
96
94
$ this ->getGenerator ();
97
95
You can’t perform that action at this time.
0 commit comments