这是我的composer.json文件:
{
"name": "lorem-ipsum",
"description": "Lorem Ipsum",
"minimum-stability": "dev",
"require": {
"php": ">=5.4",
"symfony/console": ">=2.0.0,<2.2.0-dev",
"symfony/config": ">=2.0.0,<2.2.0-dev",
"symfony/dependency-injection": ">=2.0.0,<2.2.0-dev",
"symfony/event-dispatcher": ">=2.0.0,<2.2.0-dev",
"symfony/translation": ">=2.0.0,<2.2.0-dev",
"symfony/yaml": ">=2.0.0,<2.2.0-dev",
"symfony/finder": ">=2.0.0,<2.2.0-dev",
"zendframework/zendframework": "2.*",
"doctrine/doctrine-module": "dev-master",
"doctrine/doctrine-orm-module": "0.*",
"gedmo/doctrine-extensions": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"behat/behat": "2.4.*@stable",
"behat/mink": "1.4@stable",
"behat/mink-goutte-driver": "*",
"symfony/browser-kit": "2.1.*",
"symfony/css-selector": "2.1.*",
"symfony/dom-crawler": "2.1.*",
"symfony/process": "2.1.*",
"guzzle/http": "2.8.*",
"behat/mink-sahi-driver": "*"
},
"autoload": {
"psr-0": {
"Behat\Behat": "src/"
}
}
}
当我这样做时:
php composer.phar update --dev
我得到:
加载包含包信息的作曲家存储库更新依赖项您的要求无法解析为一组可安装的软件包。
Problem 1
- Conclusion: remove guzzle/parser v2.8.8
- Conclusion: don't install guzzle/parser v2.8.8
- fabpot/goutte 1.0.x-dev requires guzzle/guzzle 3.0.* -> satisfiable by guzzle/guzzle v3.0.0, guzzle/guzzle v3.0.1, guzzle/guzzle v3.0.2, guzzle/guzzle v3.0.3, guzzle/guzzle v3.0.4, guzzle/guzzle v3.0.5.
- fabpot/goutte 1.0.x-dev requires guzzle/guzzle 3.0.* -> satisfiable by guzzle/guzzle v3.0.0, guzzle/guzzle v3.0.1, guzzle/guzzle v3.0.2, guzzle/guzzle v3.0.3, guzzle/guzzle v3.0.4, guzzle/guzzle v3.0.5.
- Can only install one of: guzzle/guzzle v3.0.0, guzzle/guzzle v2.8.8.
- Can only install one of: guzzle/guzzle v3.0.1, guzzle/guzzle v2.8.8.
- Can only install one of: guzzle/guzzle v3.0.2, guzzle/guzzle v2.8.8.
- Can only install one of: guzzle/guzzle v3.0.3, guzzle/guzzle v2.8.8.
- Can only install one of: guzzle/guzzle v3.0.4, guzzle/guzzle v2.8.8.
- Can only install one of: guzzle/guzzle v3.0.5, guzzle/guzzle v2.8.8.
- Installation request for guzzle/parser v2.8.8 -> satisfiable by guzzle/guzzle v2.8.8, guzzle/parser v2.8.8.
- Installation request for fabpot/goutte 1.0.x-dev -> satisfiable by fabpot/goutte 1.0.x-dev.
这几天前没有发生,我已经使用这个 composer.json 文件几个星期了,它总是安装正常。
问题似乎是你需要在 require-dev 中 guzzle/http 2.8.*
。由于2.8.8
安装在开发依赖项中,因此当您尝试更新时,它将首先更新正常要求,同时完全阻止开发要求更改。
在这一点上,由于 fabpot/goutte 显然现在需要 guzzle 3.0.*
,它向南走,因为它想保持2.8.8
并需要安装3.0.*
。
解决方案是 rm -rf 供应商/guzzle,以确保当前的依赖项从您当前的状态中消失。然后运行更新应该会很好,直到它更新开发依赖项,此时它仍然会抱怨2.8.8
与3.0.*
不兼容,所以你也应该更新你的 require-dev 行以指定3.0.*
。如果这对您来说是一个问题,请尝试使用较旧的标记版本的痛风(如果有)。
我已经通过明确指定所有软件包的版本解决了这个问题:
{
"name": "lorem-ipsum",
"description": "Lorem ipsum",
"minimum-stability": "dev",
"require": {
"php": ">=5.4",
"zendframework/zendframework": "2.0.4",
"doctrine/doctrine-module": "0.5.2",
"doctrine/doctrine-orm-module": "0.5.3",
"gedmo/doctrine-extensions": "2.3.1"
},
"require-dev": {
"phpunit/phpunit": "3.7.9",
"guzzle/guzzle": "3.0.5",
"behat/behat": "2.4.4",
"behat/mink": "1.4",
"behat/mink-goutte-driver": "1.0.3",
"behat/mink-sahi-driver": "1.0.0",
"squizlabs/php_codesniffer": "1.4.2",
"phpmd/phpmd": "1.4.0"
},
"autoload": {
"psr-0": {
"Behat\Behat": "src/"
}
}
}