Check for .env file before including phpdotenv #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi. (this is the same as #23 but I changed the source branch)
For anyone who is using Docker for either local development, deployment or infrastructure in general, or for anyone who is setting environments by hand as a choice (for example in production environments), there should be no necessity to load PHP dotenv.
It should load only if .env file is provided.
In docker-compose I'm always providing environment variables so there is no need to phpdotenv to load at all.
PHP dotenv should be used only as a tool for simulating environment variables in many environments where we do not want to bother with setting them each time you need an environment.
It shouldn't be used in production as well. See: vlucas/phpdotenv#207
Also, another downside is that it is a problem for people using bedrock as an installation structure. Bedrock is using phpdotenv as well and in such case, one may want to omit using phpdotenv in the theme. Especially due to version difference (Bedrock is using v3, and Base camp is using v2), so there is a clear conflict as these two as not compatible.
I started working for a company that uses Base camp and I cannot stand, that every project I'm getting into, I have constant troubles with it :(