php composer
composer
composer dump-autoload
在部署代码到生产环境的时候,优化自动加载
composer dump-autoload --optimize
将composer版本升级到最新
composer self-update
执行诊断命令:
composer diagnose
清除缓存:
composer clear
若项目之前已通过其他源安装,则需要更新 composer.lock 文件,执行命令
composer update --lock
更新所有依赖
composer update
更新指定的包
composer update monolog/monolog
更新指定的多个包
composer update monolog/monolog symfony/dependency-injection
还可以通过通配符匹配包
composer update monolog/monolog symfony/*
移除指定的包
composer remove monolog/monolog
搜索包
composer search monolog
列出所有已经安装的包
composer show
可以通过通配符进行筛选
composer show monolog/*
显示具体某个包的信息
composer show monolog/monolog
查看全局配置
composer config -l -g
设置超时时间
composer config --global process-timeout 2000
仓库设置
全局模式
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
单项目
composer config repo.packagist composer https://mirrors.aliyun.com/composer/
将本地扩展加载进其他laravel项目中进行测试
添加配置
composer config repositories.nanjishidu ‘{“type”: “path”, “url”: “/home/www-root/github.com/nanjishidu/yidun-php-sdk”, “options”:{“symlink”:true}}’ –file composer.json
取消配置
composer config –unset repositories.nanjishidu
引入项目
composer require nanjishidu/yidun-php-sdk:dev-master