Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer - Using two different versions of Guzzle

I am using two different packages and they both require different versions of Guzzle.

Package one requires: guzzlehttp/guzzle: 5.0 Package two requires: guzzlehttp/guzzle: 6.1

Now obviously this is causing an issue when I run "composer install" or "composer update"

any way to get around this?

like image 327
Obaid Avatar asked Oct 30 '22 08:10

Obaid


1 Answers

There is no way around this.

You can of course be a friendly open source user, get in touch with the package using the older version of Guzzle and ask if they mind getting an update from you to allow using Guzzle 6. This would benefit everybody coming after you. You can also keep your work to yourself and just fiddle with one of the libraries to accept one of the Guzzle versions you choose.

The core problem is that both Guzzle 5 and 6 contain the same classes like Guzzle\Client, but with different code and different dependencies on other code. They are also implementing a different interface. So it is not enough to just overcome the Composer obstacle and make it install either one Guzzle version and not complain.

like image 107
Sven Avatar answered Nov 11 '22 10:11

Sven