【问题标题】:Loading a package from a VCS repository not working从 VCS 存储库加载包不起作用
【发布时间】:2015-03-03 16:02:49
【问题描述】:

我正在尝试将个人存储库与 GitHub 上其他人存储库的修改代码一起使用。

我完全按照getcomposer.org 所说的做了,在composer.json 中添加了repositories

不过,每当我 composer update 时,我都会检查代码,它始终是原始代码,而不是我的。

这是我的composer.json

{
    [...]
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/GiampaoloFalqui/php-phantomjs"
        },
        {
            "type": "vcs",
            "url": "https://github.com/GiampaoloFalqui/tesseract-ocr-for-php"
        }
    ],
    "require": {
        "laravel/framework": "4.2.*",
        "codesleeve/asset-pipeline": "dev-master",
        "jonnyw/php-phantomjs": "3.*",
        "thiagoalessio/tesseract_ocr": ">= 0.2.0"
    },
    [...]
}

【问题讨论】:

    标签: json git composer-php


    【解决方案1】:

    通过在不是master 的分支中分支代码并在composer.json(在我的情况下为bugfix)中添加dev- 后跟分支名称来解决,如下所示:

    "require": {
        "laravel/framework": "4.2.*",
        "codesleeve/asset-pipeline": "dev-master",
        "jonnyw/php-phantomjs": "dev-bugfix",
        "thiagoalessio/tesseract_ocr": "dev-bugfix"
    },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-19
      • 1970-01-01
      • 2019-01-24
      相关资源
      最近更新 更多