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!
#Install
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.
updateis to obtain third-party components and their versions directly from
composer.json, and then update
composer.lockfile.
If the dependent third-party component has a version update,
updatewill install the latest version into the
vendordirectory and update
composer.lock.
composer updatecommand because there may be versions of third-party component libraries used in the testing phase. , the
composer 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.jsonand
composer.lockto the version management process, and pay attention to
composer during the development process. For changes in dependent versions in .lock, use
composer installfor each online package to obtain dependent third-party components and versions from
composer.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.
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!