3

Symfony更喜欢使用.env 文件(用于在其中保存环境变量的值)而不是使用更灵活的 .yaml 文件的主要原因是什么/是什么?

我问这个,因为我读了这个评论,其中指出:

当我们使用 .yaml 文件时,它要简单得多。
我完全理解为什么我们需要切换到 .env 文件,但恕我直言,我们应该重新考虑一切。

感谢您的时间。

4

1 回答 1

1

根据 Symfony 博客文章:

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.

yaml 文件也不能这样说。

https://symfony.com/blog/new-in-symfony-3-2-runtime-environment-variables

于 2019-04-23T16:52:35.550 回答