Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.0 Support #18

Closed
OwenMelbz opened this issue Feb 4, 2021 · 11 comments
Closed

PHP 8.0 Support #18

OwenMelbz opened this issue Feb 4, 2021 · 11 comments

Comments

@OwenMelbz
Copy link

Description

Upon updating the composer.json with PHP 8 e.g.

"config": {
        "platform": {
            "php": "8.0"
        }
    },

Then running composer update

➜ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires mailgun/mailgun-php ^3.4 -> satisfiable by mailgun/mailgun-php[3.4.0].
    - mailgun/mailgun-php 3.4.0 requires php-http/client-common ^2.2.1 -> found php-http/client-common[dev-master, 2.2.1, 2.3.0, 2.3.x-dev (alias of dev-master)] but the package is fixed to 1.10.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

  Problem 2
    - cspoo/swiftmailer-mailgun-bundle 1.2.0 requires mailgun/mailgun-php ^2.3 -> found mailgun/mailgun-php[v2.3.0, ..., 2.x-dev] but it conflicts with your root composer.json require (^3.4).
    - craftcms/mailgun 1.4.3 requires cspoo/swiftmailer-mailgun-bundle ^1.0.0 -> satisfiable by cspoo/swiftmailer-mailgun-bundle[1.2.0].
    - craftcms/mailgun is locked to version 1.4.3 and an update of this package was not requested.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

I believe because craftcms/mailgun is locked to version 1.4.3 and an update of this package was not requested. This means that the other dependencies cannot be updated as craftcms/mailgun requires specific packages at versions which do not support PHP 8?

Thanks

@angrybrad
Copy link
Member

Unfortunately cspoo/swiftmailer-mailgun-bundle isn’t compatible with php-http/guzzle7-adapter, due to a php-http/httplug conflict. Once that is resolved, we can release a new version of Mailgun that requires Craft 3.6+ and guzzle7-adapter that will be PHP 8 compatible.

@angrybrad
Copy link
Member

Also, see: #19 (comment)

@OwenMelbz
Copy link
Author

@angrybrad is there anything we can do as we're needing to try and upgrade our websites to PHP 8 but held up by this issue, hoping there's some bright ideas to accelerate this issue?

@angrybrad
Copy link
Member

https://github.com/tehplague/swiftmailer-mailgun-bundle hasn't had activity in 2 years, so I wouldn't hold my breath.

We're also going to have to revisit all of our mail components that have dependencies on Swiftmailer anyway due to https://symfony.com/blog/the-end-of-swiftmailer, so the likely fix for this would be that move, whenever it happens.

@karensg
Copy link

karensg commented Sep 15, 2021

Hey @angrybrad,
Can you take a look at #21 we submitted? We managed to get access and update the underlying dependency.

@brandonkelly
Copy link
Member

@karensg That’s awesome! I’ve just pushed up a v2 branch with cspoo/swiftmailer-mailgun-bundle v2.

Unfortunately it’s a bit more complicated: mailgun/mailgun-php v3 requires a PSR-17-compatibile PHP client, which is provided by guzzlehttp/psr7 v2, however we are seeing Composer conflicts when requiring that, as neither aws/aws-sdk-php (required by our S3 plugin), nor league/flysystem-azure-blob-storage (required by our Azure plugin) support guzzlehttp/psr7 v2 yet.

There is an open issue for aws/aws-sdk-php, and I’ve opened a PR for league/flysystem-azure-blob-storage.

Given that this new Mailgun version is going to require PHP 7.3+ but Craft CMS ontly requires PHP 7.2.5+, and also these two first party plugin conflicts, I’m hesitant to actually tag 2.0 yet. For now, if you must use Mailgun with PHP 8 and aren’t affected by those conflicts, you can move to the v2 branch manually by setting your craftcms/mailgun requirement to "v2.x-dev" in composer.json.

@karensg
Copy link

karensg commented Sep 15, 2021

That's a shame, didn't think about that indeed.
On one of the projects it is running well with only the changes from the PR, but the Guzzle updates would be good as well.

Let's wait for the underlying plugins to get updated. We are using S3 for every project, so for now will just stick with Mailgun SMTP. No hurry here, just wanted to push this further.

🤞

@karensg
Copy link

karensg commented Oct 25, 2021

aws/aws-sdk-php has the issue fixed.
Checked it on our website, works well.

@brandonkelly
Copy link
Member

Mailgun 2.0.0 has been released! Requires Craft 3.7.20 (also just released), which now verifies that plugins’ PHP requirements are compatible with the current environment, before allowing them to be installed/updated. So no one will get an unexpected Composer error when installing the plugin if they’re running PHP 7.2.

@rikmorskate
Copy link

@karensg That’s awesome! I’ve just pushed up a v2 branch with cspoo/swiftmailer-mailgun-bundle v2.

Unfortunately it’s a bit more complicated: mailgun/mailgun-php v3 requires a PSR-17-compatibile PHP client, which is provided by guzzlehttp/psr7 v2, however we are seeing Composer conflicts when requiring that, as neither aws/aws-sdk-php (required by our S3 plugin), nor league/flysystem-azure-blob-storage (required by our Azure plugin) support guzzlehttp/psr7 v2 yet.

There is an open issue for aws/aws-sdk-php, and I’ve opened a PR for league/flysystem-azure-blob-storage.

Given that this new Mailgun version is going to require PHP 7.3+ but Craft CMS ontly requires PHP 7.2.5+, and also these two first party plugin conflicts, I’m hesitant to actually tag 2.0 yet. For now, if you must use Mailgun with PHP 8 and aren’t affected by those conflicts, you can move to the v2 branch manually by setting your craftcms/mailgun requirement to "v2.x-dev" in composer.json.

@brandonkelly when can your PR be merged?

@brandonkelly
Copy link
Member

I have no control over that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants