Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use install and update in composer

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Composer install and update in the use of methods, I believe that many inexperienced people are helpless about this, this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

install

Composer install reads third-party components and their versions from composer.lock and installs them into the vendor directory.

If the composer.lock file does not exist, read the composer.json third-party component and its version, and install it in the vendor directory.

Update update

Update is to get third-party components and their versions directly from composer.json, and then update the composer.lock file.

If there is a version update for a dependent third-party component, update installs the latest version into the vendor directory and updates composer.lock.

use experience

In a production environment, it is risky to use the composer update command directly, because there may be a third-party component library that uses the version during the testing phase, and the composer update command is executed during the online packaging, resulting in the problem of third-party component updates being released directly without testing.

It is recommended to add both composer.json and composer.lock to version management during version management, pay attention to changes in dependent versions in composer.lock during development, use composer install every time you go live, and obtain dependent third-party components and versions from composer.lock.

If third-party components need to be updated, the composer update command should be followed by the necessary component library updates.

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

After reading the above, do you know how to use install and update in composer? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report