Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Filter environment variables in ServeCommand #51692

Draft
wants to merge 1 commit into
base: 11.x
Choose a base branch
from

Conversation

mpociot
Copy link
Contributor

@mpociot mpociot commented Jun 3, 2024

This PR fixes an old outstanding issue that previously required a php.ini adjustment. (#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.

@crynobone
Copy link
Member

crynobone commented Jun 3, 2024

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

@taylorotwell
Copy link
Member

Drafting pending feedback from @mpociot

@taylorotwell taylorotwell marked this pull request as draft June 4, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants