Composer的初步使用以及Composer切换国内源(阿里云)
Composer安装(Windows系统)
下载:https://getcomposer.org/Composer-Setup.exe
一步步安装即可。
需要注意的是你需要开启 openssl 配置,我们打开 php 目录下的 php.ini,将 extension=php_openssl.dll 前面的分号去掉就可以了。
使用阿里云的源没得说,不像某源,不全还爱跳腾。
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
检查:
composer config -g -l
还原:
composer config -g --unset repos.packagist
调试:
composer -vvv require alibabacloud/sdk
升级:
composer self-update
诊断:
composer diagnose
清缓存:
composer clear
建立项目:
composer create-project topthink/think /wwwroot/tp
添加依赖:
编辑项目目录下composer.json
{ "require": { "monolog/monolog": "1.2.*" } }
或者:
composer require topthink/think-worker
composer require workerman/workerman-for-win
更新项目包:
composer update
移除项目包:
composer remove workerman/workerman-for-win
搜索项目包:
composer search workerman/workerman-for-win
列举项目包:
composer show workerman/workerman-for-win