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

What is the use of lock files in Composer?

藏色散人
Release: 2020-06-23 13:12:13
forward
3062 people have browsed it

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template