当前位置:网站首页>php安装composer
php安装composer
2022-07-03 06:51:00 【AquilaEAG】
composer是 PHP 用来管理依赖(dependency)关系的工具。你可以在自己的项目中声明所依赖的外部工具库(libraries),Composer 会帮你安装这些依赖的库文件。
如何在 CentOS 8 上安装和使用 Composer:
https://www.itcoder.tech/posts/how-to-install-and-use-composer-on-centos-8/
composer如何升级vendor扩展包?
composer.lock文件存在于项目根目录下面,是composer install的产物。由于一般大家的版本号写的都比较宽泛,所以不同的人composer install的最终结果,可能有较大区别。特别是随着时间的推移,很可能composer install初始化的项目,变得不是那么可靠了。
所以,这个时候,composer.lock文件就有其存在的意义。composer install命令会先遵照composer.lock中的版本(也就是说是某个特定的版本号),然后在查找composer.json 安装最新扩展包和依赖(也就是说,版本号可能存在跳跃性了)。那么多成员协作编写php项目的时候,为了保证版本的一致性,比较好的方案是:
把composer.lock文件提交到版本库,其它人执行composer install。
或者把vendor目录也提交到版本库,其它人不用执行任何composer命令。
https://newsn.net/say/composer-update-vendor.html
composer.json和composer.lock到底是什么以及区别?
我们在做项目的时候,总是要安装一些依赖。composer给我们提供了很多方便。直接运行composer install。
当我们运行composer install 将会读取composer.lock文件,进行更新依赖。如果composer.lock不存在或者里面没内容,会执行composer.json,会将最新版本的文件下载到vendor目录里,然后再去更新composer.lock文件。
我们都会把项目部署到github上,可是,当一个项目需要多人合作的时候,为了让所有人都使用与您正在使用的完全相同的依赖项。因此,为了保证这一点,composer官方是建议把composer.lock提交到git上。
每当去更新依赖的时候,都是基于composer.lock,去更新的。
注意:
composer.lock文件阻止您自动获取最新版本的依赖项。要更新到最新版本,请使用composer update命令,但是,一般不要使用update命令,因为update命令将更新所有的依赖到最新,这个动作是危险的,这样很有可能导致,最新类库和你以前写的东西冲突,你以前的代码不可用。
转载于:https://www.cnblogs.com/houss/p/11597396.html
边栏推荐
猜你喜欢

La loi des 10 000 heures ne fait pas de vous un maître de programmation, mais au moins un bon point de départ

IC_ EDA_ All virtual machine (rich Edition): questasim, vivado, VCs, Verdi, DC, Pt, spyglass, icc2, synthesize, innovative, ic617, mmsim, process library

New knowledge! The virtual machine network card causes your DNS resolution to slow down

scroll-view指定滚动元素的起始位置
![[untitled]](/img/72/4ff9354634342580a135debb58b60e.jpg)
[untitled]

Yolov2 learning and summary

These two mosquito repellent ingredients are harmful to babies. Families with babies should pay attention to choosing mosquito repellent products

这两种驱蚊成份对宝宝有害,有宝宝的家庭,选购驱蚊产品要注意

Create your own deep learning environment with CONDA

Local rviz call and display of remote rostopic
随机推荐
MySQL installation
opencv
修改MySQL密码
Troubleshooting of high CPU load but low CPU usage
Summary of remote connection of MySQL
Paper notes vsalm literature review "a comprehensive survey of visual slam algorithms"
Code management tools
Search engine Bing Bing advanced search skills
2022-06-23 vgmp OSPF inter domain security policy NAT policy (under update)
Heap sort and priority queue
Liang Ning: 30 lectures on brain map notes for growth thinking
Create your own deep learning environment with CONDA
Getting started with pytest
How to migrate or replicate VMware virtual machine systems
Dbnet: real time scene text detection with differentiable binarization
Redis command
opencv
论文笔记 VSALM 文献综述《A Comprehensive Survey of Visual SLAM Algorithms》
Sorting out the core ideas of the pyramid principle
Selenium - by changing the window size, the width, height and length of different models will be different