0
votes

What's the best way to work with configuration params (i.g. databases.yml, app.yml) in symfony 1.x in order to have different configurations for the staging and the prod server? For example, my staging project instance works with database STAGING and my prod project instance works with database PROD. Should I exclude databases.yml and app.yml from the svn repo and configure manually each instance of my project? Should I include in the repo the prod values? or maybe the staging ones?

1

1 Answers

0
votes

It kind of depends on how "secure" you consider your SVN-repository...

If it's very secure, and you're the only developer, I would go for one databases.yml and one app.yml and configure the different environments there. So something like:

prod:
  doctrine:
     ...use database PRODUCTION ...
staging:
  doctrine:
     ...use database STAGING ...
dev:
  doctrine:
     ...use database DEV ...

Works "out of the box", and keeps data versioned as well. (Also updates to the app.yml are versioned, and in your development version you can already prepare a configuration change for production).

In a less "secure" repository, I would go for ignoring the databases.yml and app.yml in the version control, and then writing these for each environment when you set it up. You could also include a versioned databases.yml.dist and app.yml.dist with predefined settings...