【发布时间】:2014-10-31 11:00:57
【问题描述】:
我有一个依赖于“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”版本而不是“*”的两个示例。
【问题讨论】:
-
您的第二个示例对我有用 - 我只是复制并粘贴并添加了缺少的
{和}- 它安装到vendor/CryptLib/CryptLib -
我认为问题可能是
minimum-stability设置仅适用于根项目 - 因此在 composer.json 中包含webiny/crypt的用户还必须指定"minimum-stability": "dev"- 您的项目不能覆盖父项目的设置。 -
共有三个级别:项目 > webiny/cache > CryptLib ...前两个将最低稳定性设置为“dev”。问题是我无法从我的项目中安装 webiny/cache 库,因为无法解决对 CryptLib 的依赖。
-
您应该改用稳定性标志 - igor.io/2013/02/07/composer-stability-flags.html
标签: php composer-php packagist