This repository was archived by the owner on Dec 12, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ class Application implements RequestHandlerInterface
42
42
private $ requestedMethod ;
43
43
private $ requestedPath ;
44
44
private $ route ;
45
- private $ environment ;
46
45
47
46
public function __construct (
48
47
string $ id ,
@@ -54,7 +53,6 @@ public function __construct(
54
53
$ this ->config = $ config ;
55
54
$ this ->router = $ router ;
56
55
$ this ->container = $ container ;
57
- $ this ->environment = $ this ->config ->get ('app ' )->get ('environment ' , 'dev ' );
58
56
}
59
57
60
58
public static function createWithContainer (ContainerInterface $ container , ?string $ id = 'selami-app ' ) : self
@@ -122,14 +120,12 @@ private function getRoute() : Route
122
120
$ appConfig = $ this ->config ->get ('app ' );
123
121
$ this ->router = $ this ->router
124
122
->withSubFolder ($ appConfig ->get ('app_sub_folder ' , '' ));
125
- if ($ this ->environment === 'prod '
126
- || $ appConfig ->get ('router_cache_enabled ' , false ) === true
127
- ) {
123
+ if ($ appConfig ->get ('router_cache_enabled ' , false ) === true ) {
128
124
$ cacheFile = $ appConfig ->get ('cache_dir ' ).'/ ' .$ this ->id .'.fastroute.cache ' ;
129
125
$ this ->router = $ this ->router
130
126
->withCacheFile ($ cacheFile );
131
127
}
132
- $ this ->addRoutes ($ this ->config ->get ('routes ' ));
128
+ $ this ->addRoutes ($ this ->config ->get ('routes ' )-> get ( $ this -> id ) );
133
129
return $ this ->route ?? $ this ->router ->getRoute ();
134
130
}
135
131
You can’t perform that action at this time.
0 commit comments