Skip to content
官方QQ交流群
技术交流1:87208295   点此加入
技术交流2:787747122   点此加入
官网
云控制台
开放平台
关注微信公众号
代码仓库: 码云

composer

Composer管理

安装

sh
# 安装
brew install composer
# 查看版本
composer -V

常用指令

基础

sh

# 查看版本
composer -V
composer --version

安装全部、更新全部

sh
# 安装(读取 composer.json )
composer install
# 更新(读取 composer.json )
composer update

安装一个包、更新一个包

sh
# 安装依赖
composer require group/xxx-name --ignore-platform-reqs
# 或者
composer require xxx-name 

# 更新依赖
composer update group/xxx-name
# 或者
composer update xxx-name

镜像源

镜像地址

名称地址
官方https://repo.packagist.org/
腾讯https://mirrors.cloud.tencent.com/composer/
阿里https://mirrors.aliyun.com/composer/
(卡住)华为https://mirrors.huaweicloud.com/repository/php/
(不行)华中科技大学https://mirrors.hust.edu.cn/composer/
(不行)中国全量镜像https://packagist.phpcomposer.com
(不行)中国科技大学https://mirrors.ustc.edu.cn/composer/
(不行)清华大学https://mirrors.tuna.tsinghua.edu.cn/composer/
(不行)laravelhttps://packagist.laravel-china.org

替换镜像源

sh

# 局部配置(在当前项目中使用)
composer config repo.packagist            composer https://mirrors.aliyun.com/composer/

 # 全局配置(在全局中使用)推荐
composer config -g repo.packagist         composer https://repo.packagist.org/
composer config -g repo.packagist         composer https://mirrors.aliyun.com/composer/
composer config -g repo.packagist         composer https://mirrors.cloud.tencent.com/composer/

composer config -g repo.packagist         composer https://packagist.composer-proxy.org
composer config -g repo.packagist         composer https://p.staticq.com 

# 查看镜像库
composer config -gl

# 取消设置
composer config -g --unset repos.packagist

Copyright © 2017 10yun.com | 十云提供计算服务-IPV6 | ctocode组开发