I would think of different environments that use different parts for the same ini file. You may have a prod1 environment using parameters prefixed with prod1 and prod2 with the same:
parameters.ini:
[parameters] prod1_database_driver = pdo_mysql prod1_database_host = 127.0.0.1 # ... prod2_database_driver = pdo_mysql prod2_database_host = localhost
They both use the prod.yml configuration, but overwrite the material you want to read from the .ini options:
config_prod1.yml:
imports: - { resource: config_prod.yml }
In this way, you will also get around the caching problem, since you already have a cache for the environment.
To separate them, create and use app_prod1.php and app_prod2.php, as in the dev environment, or change the environment depending on the host in your application.
source share