5

我想使用 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"
    }
}

我得到的错误是:

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.

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

4

1 回答 1

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"
    }
}
于 2013-03-19T09:38:02.503 回答