Skip to content

[9.x] Use <env> element #5765

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

Merged
merged 1 commit into from
Jan 15, 2022
Merged

Conversation

jasonmccreary
Copy link
Contributor

This changes the default configuration to avoiding a developer experience where you spend hours trying to determine why your CI configuration is not working.

The <server> element has a higher than system environment variables (e.g. export APP_ENV=ci). As such, anything currently set in phpunit.xml can only be overridden by setting the configuration within your application (e.g. app()->config('app.env', 'ci')).

The <env> element is lower than system environment variables. For more detail, I wrote about configuration precedence during testing.

Considering this repo is static, this could likely be retargeted at 8.x. However, I felt the upcoming 9.x release provided a clean transition point.

@michaeldyrynda
Copy link
Contributor

michaeldyrynda commented Jan 13, 2022

I had an inkling that this used to use <env> and it was changed to <server> at some point.

#27462 is the change in question, perhaps @GrahamCampbell can weigh in here, things may have changed in three years.

@jasonmccreary
Copy link
Contributor Author

@michaeldyrynda, yeah, maybe someone more familiar with the inner workings of Laravel might know why it needs to be <server>. However, in practice, I've been using <env> since 5.8 without any issue, and, to the point of this PR, easier overwriting.

@driesvints driesvints changed the title Use <env> element [9.x] Use <env> element Jan 14, 2022
@taylorotwell taylorotwell merged commit 9b93e0d into laravel:master Jan 15, 2022
@jasonmccreary jasonmccreary deleted the use-env-directive branch January 15, 2022 15:07
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