Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 817
scribu Avatar asked Oct 17 '13 18:10

scribu


People also ask

What's the purpose of a composer lock?

composer. lock records the exact versions that are installed. So that you are in the same versions with your co-workers. So in a simple check list.

What is installed 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.

What is the difference between composer json and package json?

package. json is a npm file to keep track of npm packages. composer. json is a composer file to keep track of php packages.

What is vendor composer installed json?

Description. A installed. json file was discovered. Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.


1 Answers

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.

like image 84
Sven Avatar answered Sep 21 '22 21:09

Sven