I'm writing a web-app that will give every client his own database (or schema, since I'm using PostgreSQL) and sub-domain. So what I want is basically:
- http://alice.domain.com => uses database/schema alice
- http://bob.domain.com => uses database/schema bob
- etc...
Of course I don't plan to blindly throw URL parameters around, so after some checking for validity - and given that all my code, schema, etc. etc. are identical for all clients, and the database to connect to is the only difference - is there a way to do this without updating any of the main config files all the time?
I've looked around for some time and found some solutions that don't apply to my scenario because they either assume that different bundles use different databases (I have one bundle using different databases, depending on the client) or that you can simply configure a few different entity managers (I have many clients, not just 5 or 10).