composer更新及常用命令

  • 查看版本号
composer -V
  • 升级更新
composer self-update
  • 全局配置(推荐)
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
  • 取消配置
composer config -g --unset repos.packagist
  • 当前项目配置
composer config repo.packagist composer https://mirrors.aliyun.com/composer/
  • 取消配置
composer config --unset repos.packagist
  • 其他命令
composer list:获取帮助信息;
composer init:以交互方式填写composer.json文件信息;
composer search:在当前项目中搜索依赖包;
composer show:列举所有可用的资源包;
composer validate:检测composer.json文件是否有效;
composer create-project:基于composer创建一个新的项目;
composer dump-autoload:在添加新的类和目录映射是更新autoloader
composer remove laravel/ui :删除依赖后还需要去vender文件夹里,手动删除

 

© 版权声明
THE END
喜欢就支持一下吧
分享