我理解为什么我应该在parameters.yml文件中保留我的数据库连接,但我还想设置其他数据库连接以及dev,stage和prod环境的不同主机.我以为我可以这样做config_dev.yml,config_test.yml并且config_prod.yml与之config.yml相伴,我错了吗?
在parameters.yml我持有主数据库连接,但我可以将其移动到配置吗?
例: config.yml
# Doctrine Configuration - notice there is no host defined here
doctrine:
dbal:
default_connection: blah
connections:
blah:
driver: pdo_pgsql
port: 5432
dbname: blah
user: blah_user
password: blah_pass
charset: UTF8
foo:
driver: pdo_pgsql
port: 5432
dbname: foo
user: foo_user
password: foo_pass
charset: UTF8
Run Code Online (Sandbox Code Playgroud)
例: config_dev.yml
# Doctrine Configuration - Here I define the dev hosts
doctrine:
dbal:
connections:
blah:
host: blah_dev
foo:
host: foo_dev
Run Code Online (Sandbox Code Playgroud)
例: …