this post was submitted on 15 Jul 2024
22 points (100.0% liked)
Programming
17501 readers
23 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I like how Symfony does it in PHP:
Config files have well known locations (e.g.,
<project root>/config
for main project, and<plugin root>/Resources/config
for plugins) for config files. The main config is loaded into memory, and then each plugin config is loaded and merged into the main config.This has several advantages:
.ini
,.yaml
,. php
, etc)$ENV
variable (e.g.,dev
ortest
), or by ignoring files in your VCSFor Symfony, it is more complicated than that in that they also have mechanisms to define valid configuration values and their expected types, but that’s beyond the scope of your question.
Database configuration is an interesting choice. It certainly would help with scaling across multiple servers. Of course there is still a need for local configuration to access the database, but how often does that really change? But if you don’t need to scale more than two or three servers, it might be a bit of overkill IMO.