Home>Article>Development Tools> Composer experience sharing: summary of the use of install and update
This article is provided by the tutorial column ofcomposerto introduce you to the experience of using composer install and update. I hope it will be helpful to friends in need!
#Installinstall
composer installreads third-party components and their versions from
composer.lockand installs them into the
vendordirectory.
If the
composer.lockfile does not exist, read the
composer.jsonthird-party component and its version, and then install it in the
vendordirectory.
Updateupdate
updateobtains third-party components and components directly from
composer.jsonits version and then update the
composer.lockfile.
If the dependent third-party component has a version update,
updatewill install the latest version into the
vendordirectory and update
composer.lock.
Usage experience
In a production environment, it is risky to directly use thecomposer updatecommand because it may be used during the testing phase. version of the third-party component library, the
composer updatecommand was executed during online packaging, resulting in the problem of third-party component updates being released directly without testing.
composer.jsonand
composer.lockto the version management process, and pay attention during the development process# For changes in dependent versions in ##composer.lock
, usecomposer install
for each online package to obtain dependent third-party components and versions fromcomposer.lock
.If you need to update third-party components, when executing the
command,should be appended with the component library
that needs to be updated.
The above is the detailed content of Composer experience sharing: summary of the use of install and update. For more information, please follow other related articles on the PHP Chinese website!