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.1. Compatibility #212

Closed
freescout-helpdesk opened this issue Mar 9, 2022 · 6 comments
Closed

PHP 8.1. Compatibility #212

freescout-helpdesk opened this issue Mar 9, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@freescout-helpdesk
Copy link
Contributor

The package is not compatible with PHP 8.1 yet. There were a lot of serious changes in PHP 8.1: https://php.watch/versions/8.1 (see Deprecations in the bottom).

We've started to make php-imap compatible with PHP 8.1 but stuck on the following error when fetching emails via oAuth:

ErrorException: Undefined array key 2 in /vendor/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php:593

The patch with changes already made is attached. In order to see full error message we added echo $e; in Query.php on line 319.

php81.zip

@HelloSebastian
Copy link
Contributor

Hi @freescout-helpdesk,

it would be great if the library becomes compatible with PHP 8.1. I'm currently using the library with 8.0 and haven't had any problems yet. Could you open a WIP PR for this, where you upload your changes?

Thanks for your work!

@Webklex
Copy link
Owner

Webklex commented Mar 9, 2022

Hi @freescout-helpdesk ,
this library is designed to support as many php versions as possible. Starting with v5.5.9. I hope we haven't reached a point were its no longer possible to support all of them. If that's the case, we should discuss which php versions this lib should support :)

Please feel free to push a pr - we could also designate a special branch?

Best regards and many thanks for your feedback.

@Webklex Webklex added the enhancement New feature or request label Mar 9, 2022
@freescout-helpdesk
Copy link
Contributor Author

For our helpdesk PHP 8.1 support is required as most new installations are made now on PHP 8.1 So without PHP 8.1 we can't use php-imap package.

@freescout-helpdesk
Copy link
Contributor Author

PR created: #214

@Webklex
Copy link
Owner

Webklex commented Mar 10, 2022

Hi @freescout-helpdesk ,
many thanks for your pull request. I've added some additional return and argument types and changed the php requirement to >=7.0.0. I've done some quick tests on php v7.0, 7.4 and 8.1. Seems to work fine :)

Best regards,

Update: I should add that I haven't tested everything. I'll continue to write some testst to hopefully cover the majority of them.

@freescout-helpdesk
Copy link
Contributor Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants