在composer require irazasyed/telegram-bot-sdk ^2.0
正常之后,现在我正在尝试包含另一个带有composer require erlangb/betfair
的包,但这是我从作曲家那里得到的:
Using version ^0.2.0 for erlangb/betfair
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- erlangb/betfair 0.2.0 requires guzzlehttp/guzzle-services 0.5.* -> satisfi
able by guzzlehttp/guzzle-services[0.5.0].
- Conclusion: remove guzzlehttp/guzzle 6.2.0
- guzzlehttp/guzzle-services 0.5.0 requires guzzlehttp/command 0.7.* -> sati
sfiable by guzzlehttp/command[0.7.0, 0.7.1].
- Conclusion: don't install guzzlehttp/command 0.7.1
- Installation request for erlangb/betfair ^0.2.0 -> satisfiable by erlangb/
betfair[0.2.0].
- Conclusion: don't install guzzlehttp/guzzle 6.2.0
- guzzlehttp/command 0.7.0 requires guzzlehttp/guzzle ~5.0 -> satisfiable by
guzzlehttp/guzzle[5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.2.0, 5.3.0].
- Can only install one of: guzzlehttp/guzzle[5.0.0, 6.2.0].
- Can only install one of: guzzlehttp/guzzle[5.0.1, 6.2.0].
- Can only install one of: guzzlehttp/guzzle[5.0.2, 6.2.0].
- Can only install one of: guzzlehttp/guzzle[5.0.3, 6.2.0].
- Can only install one of: guzzlehttp/guzzle[5.1.0, 6.2.0].
- Can only install one of: guzzlehttp/guzzle[5.2.0, 6.2.0].
- Can only install one of: guzzlehttp/guzzle[5.3.0, 6.2.0].
- Installation request for guzzlehttp/guzzle == 6.2.0.0 -> satisfiable by gu
zzlehttp/guzzle[6.2.0].
Installation failed, reverting ./composer.json to its original content.
我能做什么?
简而言之
在 composer 中,您不能拥有同一包的两个版本,因为由于 PHP 中命名空间的性质,它会导致自动加载冲突。
错误
telegram-bot-sdk
包需要版本 ~6.0
,如您在它的composer.json
中看到
"require": {
...
"guzzlehttp/guzzle": "~6.0",
...
},
但是erlangb/betfair
0.2.0
需要~5.0
,guzzlehttp/command
0.7.0
也需要~5.0
而guzzlehttp/guzzle-services
0.5.0
又需要。不幸的是,erlangb/betfair
的dev-master
分支仍在使用旧的Guzzle版本,所以这不好。我建议您找到替代的必发套餐或分叉并自行更新。