结论:删除guzzlehttp / guzzle 6.2.0

时间:2016-03-22 22:18:22

标签: php composer-php guzzle

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.

我能做什么?

1 个答案:

答案 0 :(得分:1)

简而言之

在编辑器中,你不能拥有同一个包的两个版本,因为由于PHP中命名空间的性质,它会导致自动加载冲突。

错误

telegram-bot-sdk包需要版本~6.0,您可以在其中看到composer.json

"require": {
  ...
  "guzzlehttp/guzzle": "~6.0",
  ...
},

erlangb/betfair 0.2.0需要~5.0guzzlehttp/command 0.7.0也需要~5.0,而guzzlehttp/guzzle-services 0.5.0则需要dev-master。不幸的是,erlangb/betfair的{​​{1}}分支仍在使用旧的Guzzle版本,所以这不好。我建议你找一个替代的betfair包或者fork并自己更新。