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)) {
1616 throw new \RuntimeException ('You need to add "symfony/framework-bundle" as a Composer dependency. ' );
1717}
1818
19- if (!getenv ( 'APP_ENV ' )) {
19+ if (!isset ( $ _SERVER [ 'APP_ENV ' ] )) {
2020 (new Dotenv ())->load (__DIR__ .'/../.env ' );
2121}
2222
2323$ 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 ' , '' ]);
2626
2727if ($ debug && class_exists (Debug::class)) {
2828 Debug::enable ();
Original file line number Diff line number Diff line change 1717require __DIR__ .'/../vendor/autoload.php ' ;
1818
1919// The check is to ensure we don't use .env in production
20- if (!getenv ( 'APP_ENV ' )) {
20+ if (!isset ( $ _SERVER [ 'APP_ENV ' ] )) {
2121 (new Dotenv ())->load (__DIR__ .'/../.env ' );
2222}
2323
24- if (getenv ( 'APP_DEBUG ' ) ) {
24+ if ($ _SERVER [ 'APP_DEBUG ' ] ?? true ) {
2525 // WARNING: You should setup permissions the proper way!
2626 // REMOVE the following PHP line and read
2727 // https://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup
3232
3333// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED);
3434
35- $ kernel = new Kernel (getenv ( 'APP_ENV ' ), getenv ( 'APP_DEBUG ' ) );
35+ $ kernel = new Kernel ($ _SERVER [ 'APP_ENV ' ] ?? ' dev ' , $ _SERVER [ 'APP_DEBUG ' ] ?? true );
3636$ request = Request::createFromGlobals ();
3737$ response = $ kernel ->handle ($ request );
3838$ response ->send ();
You can’t perform that action at this time.
0 commit comments