framework icon indicating copy to clipboard operation
framework copied to clipboard

[11.x] Filter environment variables in ServeCommand

Open mpociot opened this issue 1 year ago • 2 comments

This PR fixes an old outstanding issue that previously required a php.ini adjustment. (https://github.com/laravel/framework/issues/34229)

At the moment, the ServeCommand does not really filter environment variables that are being passed to the PHP process, but instead it sets them to false. This can lead to issues if the variable is being used by the system and is then set to false.

Instead of passing the variables as false, this PR now filters the env variables and only passes those to the process that are passthrough variables - or all in case --no-reload is specified.

mpociot avatar Jun 03 '24 10:06 mpociot

What's would a good example for environment variables with values as false?

Alternatively, would it make sense if we encode $value using something like:

https://github.com/orchestral/testbench-core/blob/37ed7cca1603c57e729388e7df6c13f87ba37bbb/src/Foundation/Env.php#L64-L85

crynobone avatar Jun 03 '24 11:06 crynobone

Drafting pending feedback from @mpociot

taylorotwell avatar Jun 04 '24 13:06 taylorotwell