composer 常用下令

注意在工程目录下面执行(composer.json 所在的文件夹)

1、查看composer设置

composer config -l

composer config -l
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://mirrors.aliyun.com/composer/
[process-timeout] 300
[use-include-path] false
[preferred-install] auto
[notify-on-install] true
[github-protocols] [https, ssh]
[vendor-dir] ../LieBitComposer (/huayong/app/php/liebite/../LieBitComposer)
[bin-dir] {$vendor-dir}/bin (/huayong/app/php/liebite/../LieBitComposer/bin)
[cache-dir] /home/yw/.cache/composer
[data-dir] /home/yw/.local/share/composer
[cache-files-dir] {$cache-dir}/files (/home/yw/.cache/composer/files)
[cache-repo-dir] {$cache-dir}/repo (/home/yw/.cache/composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/home/yw/.cache/composer/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[bin-compat] auto
[discard-changes] false
[autoloader-suffix]
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile]
[capath]
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] 1
[home] /home/yw/.config/composer

2、修改为阿里云的源

composer config repo.packagist composer https://mirrors.aliyun.com/composer/
composer config repo.packagist composer https://packagist.phpcomposer.com

作废设置:

composer config -g --unset repos.packagist

项目设置
仅修改当前工程设置,仅当前工程可使用该镜像地址:

composer config repo.packagist composer https://mirrors.aliyun.com/composer/

作废设置:

composer config --unset repos.packagist

3、执行安装下令

composer require phpoffice/phpspreadsheet 1.15

composer require phpoffice/phpspreadsheet
指定下令运行的用户
 sudo -u nginx bash -c '/usr/local/bin/composer require phpoffice/phpspreadsheet'  

4、composer安装

下载composer.phar文件

官网下载
https://getcomposer.org/download/1.8.0/composer.phar

,

以太坊开奖

www.326681.com采用以太坊区块链高度哈希值作为统计数据,联博以太坊统计数据开源、公平、无任何作弊可能性。联博统计免费提供API接口,支持多语言接入。

,
sudo mv composer.phar /usr/local/bin/composer
chmod a+x /usr/local/bin/composer
参考

5、保持最新版

更新composer

经常执行 composer selfupdate 以保持 Composer 一直是最新版本

6、调试

composer 下令增添 -vvv 可输出详细的信息,下令如下:

composer -vvv require alibabacloud/sdk

7、安装乐成