1

我有一个依赖于 'webiny/crypt' 包的项目(我也是 webiny/crypt repo 的所有者https://github.com/Webiny/Crypt)。

{
        "require": {
                "webiny/crypt": "dev-master"
        },
        "minimum-stability": "dev"
}

在 webiny/crypt repo 的 composer.json 中,我需要定义对这个 repo 的依赖:https ://github.com/ircmaxell/php-cryptlib

该 repo 在 packagist 上不可用,但在其 github repo 中有一个 composer.json 文件。

我尝试了几种解决方案,但都没有奏效。以下是我尝试过的一些示例……这是 webiny/crypt 的 composer.json 的内容。

示例 1:

"minimum-stability": "dev",
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/ircmaxell/PHP-CryptLib"
    }
],
"require": {
    "php": ">=5.4.0",
    "webiny/class-loader": "dev-master",
    "webiny/config": "dev-master",
    "webiny/std-lib": "dev-master",
    "ircmaxell/PHP-CryptLib": "*"
}

示例 2:

"minimum-stability": "dev",
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/ircmaxell/PHP-CryptLib"
    }
],
"require": {
    "php": ">=5.4.0",
    "webiny/class-loader": "dev-master",
    "webiny/config": "dev-master",
    "webiny/std-lib": "dev-master",
    "CryptLib/CryptLib": "*"
}

此外,我在 CryptLib 存储库中尝试了使用“dev-master”版本而不是“*”的两个示例。

4

1 回答 1

2

来自作曲家文档@ https://getcomposer.org/doc/05-repositories.md#repository

存储库仅对根包可用,并且不会加载依赖项中定义的存储库。如果您想了解原因,请阅读 常见问题解答条目。

我认为你唯一的选择,除非你想告诉你的用户也添加那个 repo,是 fork https://github.com/ircmaxell/PHP-CryptLib然后将它发布到 packagist。也许先给作者发一封关于这个的电子邮件。

抱歉,可能不是您要找的答案。

于 2014-09-06T19:56:32.590 回答