Share your experience using composer install and update!

藏色散人
Release: 2020-07-22 13:21:06
forward
2856 people have browsed it

The following is the tutorial column ofcomposerto introduce the experience of using composer install and update. I hope it will be helpful to friends in need!

Share your experience using composer install and update!

#Install

install

composer installreads third-party components and their versions fromcomposer.lockand installs them into thevendordirectory.If the
composer.lockfile does not exist, read thecomposer.jsonthird-party component and its version, and then install it in thevendordirectory.

Update

update

updateis to obtain third-party components and their versions directly fromcomposer.json, and then updatecomposer.lockfile.If the dependent third-party component has a version update,
updatewill install the latest version into thevendordirectory and updatecomposer.lock.

Usage experience

In a production environment, it is risky to directly use the

composer updatecommand because there may be versions of third-party component libraries used in the testing phase. , thecomposer updatecommand was executed during online packaging, causing the problem of third-party component updates being released directly without testing.The recommended approach is to add both
composer.jsonandcomposer.lockto the version management process, and pay attention tocomposer during the development process. For changes in dependent versions in .lock, usecomposer installfor each online package to obtain dependent third-party components and versions fromcomposer.lock.If you need to update third-party components, when executing the
composer updatecommand,should be appended with the component librarythat needs to be updated.

Reference documentation: https://docs.phpcomposer.com/03-cli.html#install

The above is the detailed content of Share your experience using composer install and update!. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!