I was thinking it would be great to have different .env files in CI4.
Loading order:
- .env
- .env.dev (optional file) (overrides keys from previous one if exist in this one).
- .env.prod (optional file) (overrides keys from previous ones if exist in this one).
- .env.test (optional file) (overrides keys from previous one if exist in this one).
When developing, CI use .env file to manipulate config files. But many developers use it in and extended manner.
For example, different mail api credentials for development and production.
- Different slack webhook credentials for dev, test, and prod environments.
- Different JWT secrets and/or ttl for dev, test, and prod environments.
- For commands, different path to php definition for shared hosting accounts.
Can multiply scenarios.
What I suggest is also being used somehow by Symfony and Laravel.
I wanted to override with a Config\DotEnv extend Codeigniter\Config\DotEnv but not recognized my file. Yet, also thinking should be a out-of-box feature.
Thanks for your time.