Composer 查看和配置换源

8 篇文章 0 订阅
该文提供了Composer的全局配置查看方法,介绍了如何切换和管理镜像源,包括阿里云、腾讯云等中国镜像,以及Composer安装步骤。还提到了一个镜像源管理工具`composer-registry-manager`,用于方便地管理仓库。
摘要由CSDN通过智能技术生成

系统全局配置:

可以使用 composer config -l -g 查看所有全局配置

composer config -l -g

在这里插入图片描述

Composer 镜像使用帮助

切换镜像指向:

composer config -g repos.packagist composer https://mirrors.tencent.com/composer/

Composer 安装简明教程:

一、下载:
wget https://mirrors.tencent.com/composer/composer.phar
二、安装:
mv composer.phar  /usr/local/bin/composer

取消全局镜像源配置:

composer config -g --unset repos.packagist

取消当前镜像源配置:

composer config --unset repos.packagist

composer 镜像源管理工具

https://github.com/slince/composer-registry-manager

安装 > Install via composer

composer global require slince/composer-registry-manager ^2.0

镜像源列表 > List all available repositories

$ composer repo:ls

 --- ------------- ------------------------------------------------ ------------------------------
      composer      https://packagist.org                            Europe, Canada and Singapore
      aliyun        https://mirrors.aliyun.com/composer              China
      tencent       https://mirrors.cloud.tencent.com/composer       China
  *   huawei        https://mirrors.huaweicloud.com/repository/php   China
      cnpkg         https://php.cnpkg.org                            China
      sjtug         https://packagist.mirrors.sjtug.sjtu.edu.cn      China
      phpcomposer   https://packagist.phpcomposer.com                China
      kkame         https://packagist.kr                             South Korea
      hiraku        https://packagist.jp                             Japan
      webysther     https://packagist.com.br                         Brazil
      solidworx     https://packagist.co.za                          South Africa
      indra         https://packagist.phpindonesia.id                Indonesia
      varun         https://packagist.in                             India
 --- ------------- ------------------------------------------------ ------------------------------

切换源地址 > Switch repository

$ composer repo:use

Please select your favorite repository (defaults to composer) [composer]:
  [0 ] composer
  [1 ] aliyun
  [2 ] tencent
  [3 ] huawei
  [4 ] cnpkg
  [5 ] sjtug
  [6 ] phpcomposer
  [7 ] kkame
  [8 ] hiraku
  [9 ] webysther
  [10] solidworx
  [11] indra
  [12] varun
>

直接使用名称选择镜像源地址 You can also skip selection by giving repository name.

$ composer repo:use aliyun

其他命令 > Available commands

Use the following command for help.

$ composer repo
 _____   _____        ___  ___
/  ___| |  _  \      /   |/   |
| |     | |_| |     / /|   /| |
| |     |  _  /    / / |__/ | |
| |___  | | \ \   / /       | |
\_____| |_|  \_\ /_/        |_|

Composer Repository Manager version 2.0.0

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands for the "repo" namespace:
  repo:add     Creates a repository
  repo:ls      List all available repositories
  repo:remove  Remove a repository
  repo:use     Change current repository
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值