spinupwp-composer-site
spinupwp-composer-site copied to clipboard
Maybe simplify environment variables/files?
Coming to this for the first time, I found config/app.php a bit confusing.
Is there a reason to have both environment files that get stored in Git (in /config/environments) AND .env files?
It feels like this could cause all sorts of problems with constants being defined in the wrong order? Or with people accidentally committing secrets to Git.
I feel like JUST using .env files would be much simpler, safer and less error prone?
If not then do we need some better docs on using the environments?
Happy to make a PR if that helps.
My understanding is that this is modeled after the way Laravel does things.
- you have default configuration variables on your config/app.php file, which should be set to whatever defaults exist for a local/development environment
- You then create specific .env files for your staging or production environments, ideally set up and automatically generated from your CI pipeline, not stored in the GitHub repo.
It looks like what this repo is doing is allowing you to specify certain configuration variables per environment (like debugging) that you would not want to have to store in your .env, which has its uses.
If not then do we need some better docs on using the environments?
That's probably a good idea.
Thanks. That's cool. And I understand it. But in my opinion it's overly complex and hard to reason about.
I'll see if I can PR some improvements sometime without changing how it works.
It looks like what this repo is doing is allowing you to specify certain configuration variables per environment (like debugging) that you would not want to have to store in your .env, which has its uses.
💯