Symfony Flex:symfony.lock 文件有什么作用?

Symfony Flex: What does symfony.lock file do?

安装 symfony/serializer 后,我发现我的 symfony.lock 文件已更改:

diff --git a/symfony.lock b/symfony.lock
index ba6e23f..bfc391e 100644
--- a/symfony.lock
+++ b/symfony.lock
@@ -301,5 +301,8 @@
     },
     "symfony/asset": {
         "version": "v3.3.10"
+    },
+    "symfony/serializer": {
+        "version": "v3.3.13"
     }
 }

据我了解,它是随 Symfony Flex 引入的,但它与 composer.lock 有何不同,为什么还需要它?

这是 Symfony recipes 的正确锁定文件,而不是试图通过 composer.lock

的状态进行猜测

Flex keeps tracks of the recipes it installed in the symfony.lock file, which must be committed to your code repository (CVS). https://symfony.com/doc/3.4/setup/flex#how-does-flex-work

自 Flex 1.0.34 版本开始引入,最初是为了解决这样的错误:"Configuring recipes executed twice"