php composer 与 NPM 配置

composer

参见官网:https://getcomposer.org/download/

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '55d6ead61b29c7bdee5cccfb50076874187bd9f21f65d8991d46ec5cc90518f447387fb9f76ebae1fbbacf329e583e30') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

配置

composer config -l -g

vi /root/.config/composer/config.json

"config": {
    "secure-http":false
}

自更新

composer selfupdate

中国全量镜像

https://pkg.phpcomposer.com/

composer config -g repo.packagist composer https://packagist.phpcomposer.com

NPM

npm config set registry https://registry.npm.taobao.org