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

[5.8] Allow retrieving env variables with getenv #27958

Merged
merged 2 commits into from
Mar 21, 2019
Merged

[5.8] Allow retrieving env variables with getenv #27958

merged 2 commits into from
Mar 21, 2019

Conversation

matt-allan
Copy link
Contributor

This PR makes it possible to retrieve .env values with getenv, which is necessary for some third party libraries to work as expected.

This restores the 5.7 behavior. See https://github.com/vlucas/phpdotenv#upgrading-from-v2 for more info.

Resolves #27949 and #27913 .

@matt-allan
Copy link
Contributor Author

I just saw #27828 (comment), which makes it sound like this change was intentional? I didn't think it was intentional as it wasn't documented in the upgrade guide.

@driesvints could you expand on that comment, I don't really understand what you mean. Won't the env helper still be read only as long as it isn't calling putenv or setting a key in the superglobals?

@ludo237
Copy link

ludo237 commented Mar 21, 2019

I think the change was intentional but it also forces the whole PHP Packages ecosystem to adapt to Laravel which is crazy.

@driesvints driesvints changed the title Allow retrieving env variables with getenv [5.8] Allow retrieving env variables with getenv Mar 21, 2019
@driesvints
Copy link
Member

@matt-allan please read #27949 (comment) and other remarks in the issue

@matt-allan
Copy link
Contributor Author

matt-allan commented Mar 21, 2019

Got it, thanks @driesvints. Looks like Taylor just committed a fix for LoadEnvironmentVariables but it's missing from helpers.php.

I just rebased this and fixed the conflict so it can be merged if we want to update helpers.php as well.

@staudenmeir
Copy link
Contributor

@taylorotwell The current release breaks php artisan serve. We also have to adjust the env() helper.

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.

5 participants