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) ?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With