• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implement Guzzle v6

Sim

Well-known member
#1
Note: I'm adding this suggestion here now that the XF2 developer preview discussion forum is about to be archived. Refer to this thread: https://xf2demo.xenforo.com/threads/guzzle-version.2524/ for the original discussion.

XF 2.0 implements Guzzle 5.3.1 which was released in July 2016 (Guzzle 5.3.0 was actually released in May 2015). The current release of Guzzle is 6.x

There have been some fairly fundamental breaking changes between the Guzzle 5 and 6 releases, primarily around the implementation of PSR-7 interfaces for requests, responses, and streams - which means that it is not possible to simply replace the underlying library - the implementation code needs to be significantly altered as well.

As a result, any addons or 3rd party libraries which are built to utilise Guzzle 6, cannot be used with XF2.

Ironically, because XF1 did not ship with Guzzle at all - there were no restrictions in which version addon developers may choose to use (provided that they always used the same version to avoid conflicts), so we now have a situation where addons developed for XF1 cannot be ported to XF2 without downgrading the version of Guzzle they use - which is a rather retrograde step.

Now the underlying issue is that XF2 has been developed to support a minimum of PHP 5.4 - while Guzzle 6 requires PHP 5.5

So the decision by the devs to implement Guzzle 5.3.x is not arbitrary, but rather one of necessity given their decision to support only PHP 5.4

Either way, I would still like to encourage the XF devs to reconsider these version restrictions - perhaps for XF 2.1, to increase the minimum PHP version to PHP 5.5 and then implement Guzzle 6.x in the core.

In the meantime, I've implemented an addon which replaces the Guzzle functionality - https://xenforo.com/community/resources/guzzle6-for-xenforo-2.5578/ ... but this isn't really ideal given how much code depends on Guzzle - it's not a trivial change, especially with the PSR-7 related structural changes required.