composer.lock 和 installed.json 有什么区别? [英] What's the difference between composer.lock and installed.json?
问题描述
我了解 composer.lock
旨在确定已安装依赖项的确切版本.但是vendor/composer/installed.json
文件有什么作用呢?
I understand that composer.lock
is meant to pin down the exact version of the installed dependencies. But what purpose does the vendor/composer/installed.json
file play?
两者都包含 JSON,并且都是自动生成的.
Both contain JSON and both are generated automatically.
推荐答案
composer.lock
在第一次安装或更新时生成.它包含对所使用的确切版本的引用.应该将其提交到版本跟踪存储库中,以允许恢复这种精确的库组合.
composer.lock
is generated when installing for the first time or updating. It contains references to the exact versions used. It should be committed into the version tracking repository to allow restoring this exact combination of libraries.
installed.json
是 Composer 的内部文件.当您从 composer.json
手动删除包以从供应商目录中删除文件时使用它.否则,旧的供应商包将永远存在.
installed.json
is an internal file of Composer. It's used when you remove a package manually from composer.json
to remove the files from the vendor directory. Otherwise, the old vendor package would be around forever.
这篇关于composer.lock 和 installed.json 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!