PajuranCodes
PajuranCodes

Reputation: 471

Why are .env files preferred over .yaml files for environment variables?

What is/are the main reason(s), for which Symfony preferres to use .env files - for holding values of environment variables in them - instead of using the more flexible .yaml files?

I am asking this, because I read this comment, which states:

It was much simpler when we were using .yaml file.
I totally understand why we needed to switch to .env file, but IMHO we should rethink everything.

Upvotes: 4

Views: 9932

Answers (1)

Nicodemuz
Nicodemuz

Reputation: 4104

According to New in Symfony 3.2: Runtime Environment Variables:

Their main advantages are that they can be changed between deploys without changing any code and that they don't need to be checked into the code repository.

The same cannot be said about yaml files.

Upvotes: 1

Related Questions