Add support for Guzzle 7

Created on 27 October 2022, about 2 years ago
Updated 13 July 2023, over 1 year ago

Problem/Motivation

Guzzle 6 is now getting old, and doesn't support PHP 8.1 (some depreciated issues) but does work.

Proposed resolution

I see 2 possible resolutions.

1. Instead of using php-http/guzzle6-adaptor is to change to using guzzle directly which would allow both the use of version 6 and 7.
2. Create a new version of mailgun which only supports PHP 8 and above and is dependent on php-http/guzzle7-adaptor

The first option that will be a bit more work will be better as you will be able run the php 8.1 with guzzle 6

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia gordon Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    8 fail
  • @krystalcode opened merge request.
  • πŸ‡΅πŸ‡ͺPeru krystalcode

    The mailgun/mailgun-php library uses php-http/discovery to automatically discover and use PSR18 client implementations. Guzzle 7 implements PSR18 while Guzzle 6 does not. This means that applications require no further dependencies if they use Guzzle 7 as discovery should find Guzzle 7 automatically. While applications that need Guzzle 6 require the php-http/guzzle6-adapter so that Guzzle 6 is discovered automatically.

    No code changes or other work should be required.

    The suggestion for which I created an MR is to make the php-http/guzzle6-adapter as a suggestion instead of dependency. This way, it is up to the developer to decide whether they need to require it or not. They will then have 3 options.

    • If they are on Guzzle 7 already, nothing to do.
    • If they are on Guzzle 6, require php-http/guzzle6-adapter at the application's root composer.json file.
    • If they are on Guzzle 6, require some other PSR18 http client implementation.

    This should be documented in the release notes, and the module's documentation.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & sqlite-3.27
    last update over 1 year ago
    run-tests.sh fatal error
  • First commit to issue fork.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 8.1 & sqlite-3.27
    last update over 1 year ago
    3 pass, 2 fail
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 8.1 & sqlite-3.27
    last update over 1 year ago
    3 pass, 2 fail
  • πŸ‡ΊπŸ‡¦Ukraine Matroskeen πŸ‡ΊπŸ‡¦ Ukraine, Lutsk

    I like the suggestion. Since we don't have direct Guzzle usage, it doesn't make sense to keep it in the requirements.
    I created a new version - 2.0.x with DEV release only. It's ready for testing on Drupal 10 installations.

    I'll keep the issue open because I also want to do some testing on real projects.
    Thanks!

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine Matroskeen πŸ‡ΊπŸ‡¦ Ukraine, Lutsk
  • πŸ‡ΊπŸ‡ΈUnited States karlshea Minneapolis πŸ‡ΊπŸ‡Έ

    On Drupal 9.5.10 I'm getting a fatal error on the status page:

    No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter"

    I'm on PHP 8.1, php-http/guzzle7-adapter requires PHP ^7.2.

  • πŸ‡ΊπŸ‡¦Ukraine Matroskeen πŸ‡ΊπŸ‡¦ Ukraine, Lutsk

    Most likely, you have guzzle ^6.x.

    You have to add manually php-http/guzzle6-adapter: composer require php-http/guzzle6-adapter
    Just tested using Drupal 9.5.10 and PHP 8.1.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024