composer常用命令
###配置中国镜像
composer config -g repositories.packagist composer https://packagist.phpcomposer.com
###composer创建项目
composer create-project laravel/laravel ./shop
###composer初始化依赖包
{
“require”: {
“predis/predis”: “^1.1”
}
}
composer init
###composer查询包
composer search predis
###更新下载依赖包从lock中读取如果有
composer install preids
从json中读取
composer update predis
直接命令行获取 不依赖于 composer.json
composer require predis/predis=^1.1
###移除指定包
composer remove predis
#从composer 安装目录类执行全局移除phpunit
composer global remove phpunit/phpunit
###帮助命令
composer 命令名称 --help
###composer软件自身更新
composer self-update
###composer的其他常用命令#查看所有命令
composer list
包名 #显示包信息
composer show
#生成自动加载文件
composer dumpautoload
转载请注明:SuperIT » composer常用命令