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

Upgrade to vlucas/phpdotenv:5.2 #563

Merged
merged 6 commits into from
Dec 4, 2020

Conversation

dsturm
Copy link
Contributor

@dsturm dsturm commented Nov 30, 2020

This PR upgrades vlucas/phpdotenv to the current version of 5.2. As in roots/acorn#74 (comment) mentioned, Laravel 8.x and therefor roots/acorn with support for Laravel 8.x will need an upgrade of the package and minor migration changes.

@tangrufus
Copy link
Member

Question: Any reason to support v4?
If not for any important dependency conflicts, we can ditch the Dotenv\Dotenv::createImmutable condition.

@dsturm
Copy link
Contributor Author

dsturm commented Dec 1, 2020

Question: Any reason to support v4?
If not for any important dependency conflicts, we can ditch the Dotenv\Dotenv::createImmutable condition.

To be honest, I don't know if we really need v4. Since v5 only increase the PHP version to 7.1 and above I would say, we could ditch v4.

@tangrufus
Copy link
Member

we could ditch v4.

Please.

Copy link
Member

@retlehs retlehs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@retlehs retlehs merged commit a623416 into roots:master Dec 4, 2020
@trainoasis
Copy link

How do I manually update to phpdotenv v5 from v3 without destroying everything? :D need it sorely for composer package requirements 🗡️

@LucasDemea
Copy link

LucasDemea commented Oct 28, 2021

Is there any particular reason for using

Dotenv\Dotenv::createUnsafeImmutable($root_dir, $env_files, false);

Instead of using

Dotenv\Dotenv::createImmutable($root_dir, $env_files, false);

and changing all the env('CONST') to $_ENV['CONST'] ?

It is discouraged to use createUnsafeImmutable , as stated on phpdotenv page :

Using getenv() and putenv() is strongly discouraged due to the fact that these functions are not thread safe, however it is still possible to instruct PHP dotenv to use these functions. Instead of calling Dotenv::createImmutable, one can call Dotenv::createUnsafeImmutable, which will add the PutenvAdapter behind the scenes.

I also encoutered an issue while trying to setup an automated test environment with wp-browser and the WPLoader module. env('CONST') wasn't returning anything, but $_ENV('CONST') did.

@swalkinshaw
Copy link
Member

@LucasDemea I think this PR is what you're suggesting? #598

Just need to re-verify it and merge

@LucasDemea
Copy link

LucasDemea commented Oct 28, 2021

Kind of, but I just tested you implementation and it doesnt solve my issue where env('CONST') doesn't return anything when wordpress is loaded by WPLoader.

@LucasDemea
Copy link

I'm aware that this is more an issue related to wp-browser. I will pursue my investigation this way.

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.

6 participants