What's the difference between composer.lock and installed.json?

陌路散爱 提交于 2020-07-28 14:11:52

问题


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?

Both contain JSON and both are generated automatically.


回答1:


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 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.



来源:https://stackoverflow.com/questions/19434827/whats-the-difference-between-composer-lock-and-installed-json

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!