Environment switching features are not the scope of an MVC (maybe a full framework though).
However, here are some suggestions:
- Never commit credentials to your repo.
Do commit an example config that can be copied and modified for each environment’s needs (dev, production, etc.)
For example, provide a file in
app/config/environment.example.phpthat setups up a
$configarray and include
app/config/application.php(like how routes.php is included)