File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ if (!class_exists(Application::class)) {
16
16
throw new \RuntimeException ('You need to add "symfony/framework-bundle" as a Composer dependency. ' );
17
17
}
18
18
19
- if (!getenv ( 'APP_ENV ' )) {
19
+ if (!isset ( $ _SERVER [ 'APP_ENV ' ] )) {
20
20
(new Dotenv ())->load (__DIR__ .'/../.env ' );
21
21
}
22
22
23
23
$ input = new ArgvInput ();
24
- $ env = $ input ->getParameterOption (['--env ' , '-e ' ], getenv ( 'APP_ENV ' ) ?: 'dev ' );
25
- $ debug = getenv ( 'APP_DEBUG ' ) !== '0 ' && !$ input ->hasParameterOption (['--no-debug ' , '' ]);
24
+ $ env = $ input ->getParameterOption (['--env ' , '-e ' ], $ _SERVER [ 'APP_ENV ' ] ?? 'dev ' );
25
+ $ debug = ( $ _SERVER [ 'APP_DEBUG ' ] ?? true ) !== '0 ' && !$ input ->hasParameterOption (['--no-debug ' , '' ]);
26
26
27
27
if ($ debug && class_exists (Debug::class)) {
28
28
Debug::enable ();
Original file line number Diff line number Diff line change 17
17
require __DIR__ .'/../vendor/autoload.php ' ;
18
18
19
19
// The check is to ensure we don't use .env in production
20
- if (!getenv ( 'APP_ENV ' )) {
20
+ if (!isset ( $ _SERVER [ 'APP_ENV ' ] )) {
21
21
(new Dotenv ())->load (__DIR__ .'/../.env ' );
22
22
}
23
23
24
- if (getenv ( 'APP_DEBUG ' ) ) {
24
+ if ($ _SERVER [ 'APP_DEBUG ' ] ?? true ) {
25
25
// WARNING: You should setup permissions the proper way!
26
26
// REMOVE the following PHP line and read
27
27
// https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup
32
32
33
33
// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);
34
34
35
- $ kernel = new Kernel (getenv ( 'APP_ENV ' ), getenv ( 'APP_DEBUG ' ) );
35
+ $ kernel = new Kernel ($ _SERVER [ 'APP_ENV ' ] ?? ' dev ' , $ _SERVER [ 'APP_DEBUG ' ] ?? true );
36
36
$ request = Request::createFromGlobals ();
37
37
$ response = $ kernel ->handle ($ request );
38
38
$ response ->send ();
You can’t perform that action at this time.
0 commit comments