File tree 1 file changed +5
-3
lines changed
Filter options
src/Symfony/Component/Runtime
1 file changed +5
-3
lines changed
Original file line number Diff line number Diff line change @@ -88,20 +88,22 @@ class SymfonyRuntime extends GenericRuntime
88
88
*/
89
89
public function __construct (array $ options = [])
90
90
{
91
- if (isset ($ _SERVER ['argv ' ]) && !isset ($ options ['env ' ]) && class_exists (ArgvInput::class)) {
91
+ if (isset ($ options ['env ' ])) {
92
+ $ _SERVER ['APP_ENV ' ] = $ options ['env ' ];
93
+ } elseif (isset ($ _SERVER ['argv ' ]) && class_exists (ArgvInput::class)) {
92
94
$ this ->options = $ options ;
93
95
$ this ->getInput ();
94
96
}
95
97
96
- $ _SERVER ['APP_ENV ' ] = $ options ['env ' ] ?? $ _SERVER ['APP_ENV ' ] ?? $ _ENV ['APP_ENV ' ] ?? 'dev ' ;
97
-
98
98
if (!($ options ['disable_dotenv ' ] ?? false ) && isset ($ options ['project_dir ' ]) && !class_exists (MissingDotenv::class, false )) {
99
99
(new Dotenv ())
100
100
->setProdEnvs ((array ) ($ options ['prod_envs ' ] ?? ['prod ' ]))
101
101
->usePutenv ($ options ['use_putenv ' ] ?? false )
102
102
->bootEnv ($ options ['project_dir ' ].'/ ' .($ options ['dotenv_path ' ] ?? '.env ' ), 'dev ' , (array ) ($ options ['test_envs ' ] ?? ['test ' ]));
103
103
$ options ['debug ' ] ?? $ options ['debug ' ] = '1 ' === $ _SERVER ['APP_DEBUG ' ];
104
104
$ options ['disable_dotenv ' ] = true ;
105
+ } else {
106
+ $ _SERVER ['APP_ENV ' ] ?? $ _SERVER ['APP_ENV ' ] = 'dev ' ;
105
107
}
106
108
107
109
$ options ['error_handler ' ] ?? $ options ['error_handler ' ] = SymfonyErrorHandler::class;
You can’t perform that action at this time.
0 commit comments