Home  >  Article  >  Development Tools  >  What is the use of lock files in Composer?

What is the use of lock files in Composer?

藏色散人
藏色散人forward
2020-06-23 13:12:132956browse

The following tutorial column of composer will introduce to you the role of the lock file in Composer. I hope it will be helpful to friends in need!

What is the use of lock files in Composer?

##composer.lock records the exact version installed. Therefore, you and your colleagues are on the same version.

Composer installationCheck the composer.lock file
If not, automatically generate the composer.lock file (use composer update)
Install the records in the composer.lock file Specified version

Composer updates Browse composer.json file
Check the availability of new (latest version) based on mentioned version criteria (e.g. 1.12.*)
Install the latest version (as per above)
Update the composer.lock file for the installed version
So in a simple manifest.

If you want all your colleagues to stay on the same version as you... Submit a GIT of your composer.lock (or vcs you have)
Ask others to get that Version's composer.lock file
Always use composer install to get the correct dependencies

If you want to upgrade system dependencies to a new version Check the composer.json file to Get the version specification.
Do a composer update
This will composer.lock the changed file with the latest version
Commit it to GIT (or vcs)
Ask others to get it composer install

For more composer technical articles, please visit the

composer column!

The above is the detailed content of What is the use of lock files in Composer?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete