Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between parameters.yml and config.yml in Symfony2

Tags:

symfony

I don't understand the difference between these two ways of setting global constants in Symfony2. Is it only about being able to set default values and types in config.yml (+configuration.php) ?

like image 310
TrtG Avatar asked Apr 18 '14 08:04

TrtG


2 Answers

parameters.yml file is the place for all constants that are environment dependent. If you use composer to deploy your app it will ask you about their values. You can also define paramteters.yml.dist to provide some defaults values. If you use parameters.yml you have all parameters needed to setup an application (for example on production server) in one place.

like image 193
4 revs, 2 users 93% Avatar answered Oct 29 '22 15:10

4 revs, 2 users 93%


Nope, nope, nope.

parameters.yml is for passwords and server specific parameters such as database connection information.

The main difference between config.yml (and all the other config files) and parameters.yml is that parameters.yml should never be checked in to your source control system. Doing so will expose your passwords and other private information to whomever has access to your source code.

like image 37
Cerad Avatar answered Oct 29 '22 17:10

Cerad