使用Composer获取Kohana的github repo失败:"找不到请求的包"

xyl*_*lar 5 kohana composer-php

我想使用Composer来包含php可读性git项目.这是我的composer.json档案:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "php-readability/php-readability",
                "version": "master",
                "source": {
                    "url": "https://github.com/feelinglucky/php-readability.git",
                    "type": "git",
                    "reference": "branches/master"
                }
            }
        }
    ],
    "require": {
        "php-readability/php-readability": "master"
    }
}
Run Code Online (Sandbox Code Playgroud)

我得到的错误是:

Problem 1
 - The requested package php-readability/php-readability master could not be found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
 problems.
Run Code Online (Sandbox Code Playgroud)

这是我第一次使用Composer,所以很可能我的配置错了!

Jak*_*las 10

php-readability项目没有标签(所以它在作曲家术语中不稳定).默认情况下,仅考虑稳定包.

要指示您要安装软件包的开发版本,请将其版本定义为"dev-master"或"*@ dev".

此外,您在存储库定义中提供了错误的引用.这是一个工作composer.json:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "php-readability/php-readability",
                "version": "master",
                "source": {
                    "url": "https://github.com/feelinglucky/php-readability.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }
    ],
    "require": {
        "php-readability/php-readability": "dev-master"
    }
}
Run Code Online (Sandbox Code Playgroud)