zoukankan      html  css  js  c++  java
  • 常用的 composer 命令

    一、列表内容

    composer
    composer list
    二、查看当前镜像源

    composer config -l -g
    [repositories.packagist.org.type] composer
    [repositories.packagist.org.url] https://packagist.org
    或者
    composer config -g repo
    {“packagist.org”:{“type”:”composer”,”url”:”https://packagist.org”}}
    三、配置镜像源

    全局配置国内镜像

    composer config -g repo.packagist composer
    https://packagist.phpcomposer.com
    全局恢复默认镜像

    composer config -g repo.packagist composer https://packagist.org
    单项目配置镜像
    编辑composer.json文件,配置

    “repositories”: {
    “packagist”: {
    “type”:”composer”,
    “url”: “https://packagist.phpcomposer.com” //”url”: “https://packagist.org”
    } }
    单项目命令行配置

    composer config repo.packagist composer https://packagist.phpcomposer.com
    四、安装依赖

    composer install xxxxx/xxxx
    更新单个依赖

    composer update xxxxx/xxxx
    或者
    composer require xxx:version
    根据包的名称,列出包的相关信息

    composer show -all xxxx
    搜索相关包的信息

    composer search monolog
    五、创建 composer.json 文件

    composer init
    例如下面生成的composer.json文件
    {
    “name”: “xxxxxx”,
    “require-dev”: {
    “maatwebsite/excel”: “1.0” },
    “authors”: [ {
    “name”:”xxx”,
    “email”: “xxxx@xxx.com” } ],
    “require”: {}
    }
    检查

    composer diagnose
    更新composer

    composer self-update
    清空缓存

    composer clear-cache
    配置相关项

    composer config …
    配置所有的配置项,例如:

    composer config secure-http true(false)
    优化自动加载

    composer dump-autoload -optimize

    ---------------------
    作者:r_martian
    来源:CSDN
    原文:https://blog.csdn.net/cjqh_hao/article/details/76039497
    版权声明:本文为博主原创文章,转载请附上博文链接!

  • 相关阅读:
    Python pip离线部署
    Windows API 纳秒级别延迟
    基于Cython和内置distutils库,实现python源码加密(非混淆模式)
    boost.property_tree读取中文乱码问题
    Direct初始化三步曲
    分享一个电子发票信息提取工具(Python)
    关于&0x80
    给QT不规则窗口添加阴影
    waveout系列API实现pcm音频播放
    An application has made an attempt to load the C runtime library incorrectly.Please contact the application's support te
  • 原文地址:https://www.cnblogs.com/mouseleo/p/10652411.html
Copyright © 2011-2022 走看看