I got a legacy code in symphony, but the systems works like this for each client has a system and one database, but the both are same for all of them, so i have "twenty" same systems "folders" for each client and each client has a database.
So, I'm trying to change this to one folder for all clients, but I've been having a problem with the databases, because the file .env we can set only one database for .env file, so, in this case i think to create a folder inside the system "envs" and i created for each client one .env with their names Example: .envtest, .envgoogle, .envfacebook and etc... And i use this function on public/index.php to set the corret .env
(new Dotenv())->load(DIR.'/../envs/.env'.explode(".", $_SERVER['HTTP_HOST'])[0]);
and when client trying to access the system i get from the $_SERVER the URL how i can concat and get the corret .env
but i think that i'm doing too wrong, there is other way to do this?