File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 4
4
use Symfony \Component \HttpFoundation \Request ;
5
5
6
6
require dirname (__DIR__ ) . '/config/bootstrap.php ' ;
7
- if ($ _SERVER ['APP_DEBUG ' ]) {
7
+
8
+ $ appEnv = $ _SERVER ['APP_ENV ' ] ?? $ _ENV ['APP_ENV ' ] ?? 'dev ' ;
9
+ $ appDebug = (bool )($ _SERVER ['APP_DEBUG ' ] ?? $ _ENV ['APP_DEBUG ' ] ?? true );
10
+ $ trustedProxies = $ _SERVER ['TRUSTED_PROXIES ' ] ?? $ _ENV ['TRUSTED_PROXIES ' ] ?? false ;
11
+ $ trustedHosts = $ _SERVER ['TRUSTED_HOSTS ' ] ?? $ _ENV ['TRUSTED_HOSTS ' ] ?? false ;
12
+
13
+ if ($ appDebug ) {
8
14
umask (0000 );
9
15
Debug::enable ();
10
16
}
11
- if ($ trustedProxies = $ _SERVER [ ' TRUSTED_PROXIES ' ] ?? $ _ENV [ ' TRUSTED_PROXIES ' ] ?? false ) {
17
+ if ($ trustedProxies ) {
12
18
Request::setTrustedProxies (
13
19
explode (', ' , $ trustedProxies ),
14
20
Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST
15
21
);
16
22
}
17
- if ($ trustedHosts = $ _SERVER [ ' TRUSTED_HOSTS ' ] ?? $ _ENV [ ' TRUSTED_HOSTS ' ] ?? false ) {
23
+ if ($ trustedHosts ) {
18
24
Request::setTrustedHosts ([$ trustedHosts ]);
19
25
}
20
- $ kernel = new Kernel ($ _SERVER ['APP_ENV ' ] ?? 'dev ' , (bool )($ _SERVER ['APP_DEBUG ' ] ?? true ));
26
+
27
+ $ kernel = new Kernel ($ appEnv , $ appDebug );
21
28
$ request = Request::createFromGlobals ();
22
29
$ response = $ kernel ->handle ($ request );
23
30
$ response ->send ();
You can’t perform that action at this time.
0 commit comments