File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ public function __construct(array $options = [])
93
93
$ envKey = $ options ['env_var_name ' ] ??= 'APP_ENV ' ;
94
94
$ debugKey = $ options ['debug_var_name ' ] ??= 'APP_DEBUG ' ;
95
95
96
+ if (isset ($ _SERVER ['argv ' ]) && !empty ($ _GET )) {
97
+ // register_argc_argv=On is too risky in web servers
98
+ $ _SERVER ['argv ' ] = [];
99
+ $ _SERVER ['argc ' ] = 0 ;
100
+ }
101
+
96
102
if (isset ($ options ['env ' ])) {
97
103
$ _SERVER [$ envKey ] = $ options ['env ' ];
98
104
} elseif (empty ($ _GET ) && isset ($ _SERVER ['argv ' ]) && class_exists (ArgvInput::class)) {
@@ -203,10 +209,6 @@ protected static function register(GenericRuntime $runtime): GenericRuntime
203
209
204
210
private function getInput (): ArgvInput
205
211
{
206
- if (!empty ($ _GET ) && filter_var (ini_get ('register_argc_argv ' ), \FILTER_VALIDATE_BOOL )) {
207
- throw new \Exception ('CLI applications cannot be run safely on non-CLI SAPIs with register_argc_argv=On. ' );
208
- }
209
-
210
212
if (isset ($ this ->input )) {
211
213
return $ this ->input ;
212
214
}
You can’t perform that action at this time.
0 commit comments