Composer
php的包管理器,相关网址:
https://www.phpcomposer.com/
https://pkg.phpcomposer.com
https://getcomposer.org
https://packagist.org
中国镜像:
https://mirrors.aliyun.com/composer/index.html
https://mirrors.huaweicloud.com/
https://mirrors.cloud.tencent.com/help/composer.html
安装:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
测试:
composer --version
使用中国镜像:
composer config -g repos.packagist composer https://php.cnpkg.org
常用命令:
安装
composer require 包
更新
composer update
移除
composer remove 包
慎用composer update 这个命令,会更新所有的包,一般建议安装新的包,建议使用composer require 安装。
并将composer.lock上传到git项目里,同事可以直接拉取到composer.lock ,然后直接composer install 即可。