你如何让作曲家安装非作曲家包?

时间:2013-05-31 00:24:01

标签: php composer-php packagist

我正在尝试让作曲家从这个项目中下载以下库,但是,它没有composer.json文件,所以我不确定这是否可行。

{
    "require" : {
        "fguillot/picoFeed" : "*"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/fguillot/picoFeed"
        }
    ]
}

错误:

  

[作曲\库\ InvalidRepositoryException]
  在任何分支或标记中都找不到有效的composer.json   https://github.com/fguillot/picoFeed,无法加载包   从它。

1 个答案:

答案 0 :(得分:68)

要包含非作曲家存储库,您需要设置package repository。这会给你类似的东西:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "fguillot/picoFeed",
                "version": "dev-master",
                "source": {
                    "url": "https://github.com/fguillot/picoFeed",
                    "type": "git",
                    "reference": "origin/master"
                }
            }
        }
    ],
    "require": {
        "fguillot/picoFeed": "dev-master"
    }
}