-
-
Notifications
You must be signed in to change notification settings - Fork 495
[FWBundle] $_ENV fallback (needed for Panther) #464
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 statemen 8000 t. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great changes 👍
But we still need a way to be able to load websites in prod
/test
env when loading Symfony webserver in dev
mode because, by default, the server is registered for dev
mode only that makes sense, we should not register it for test
/prod
. See related #461 that may fix the issue I mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point 👍
Why not using |
@albertboada because it's not thread safe. |
Does DotEnv checks both |
@stof seems it's a handled case: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Dotenv/Dotenv.php#L81 |
Thanks @dunglas, I see. However, we are experimenting a situation where EDIT:
One wonders, though. If the performance penalty is considerable, and it is not recommended in production environments, is it really sufficient to just check Cheers! |
When the builtin PHP web server is used, env vars are only available in
$_ENV
, not in$_SERVER
(see https://bugs.php.net/bug.php?id=67808).This is especially annoying when testing an app with Panther because, by default, it automatically boots the app using the integrated PHP web server, consequently env vars defined in
phpunit.xml
aren't inherited, and the app executed using thedev
env instead of thetest
one.This PR fixes this problem.