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.4 and Taking Over The Library #541

Closed
freescout-help opened this issue Jan 14, 2025 · 8 comments
Closed

PHP 8.4 and Taking Over The Library #541

freescout-help opened this issue Jan 14, 2025 · 8 comments

Comments

@freescout-help
Copy link

freescout-help commented Jan 14, 2025

It looks like the library is not maintained anymore. Maybe someone is willing to take it over?

The first task would be to make it compatible with PHP 8.4.

There is already this pull request but also all the imap_ functions will need to be removed from the library and the POP3 protocol will need to be implemented without using imap_ functions: https://github.com/Webklex/php-imap/blob/master/src/Connection/Protocols/LegacyProtocol.php

@Forin
Copy link

Forin commented Jan 14, 2025

https://github.com/stevebauman/php-imap

@freescout-help
Copy link
Author

@Forin @stevebauman Thanks

@stevebauman
Copy link

Happy to help. If you have any PR's, send them my way and we can get this library patched up. I'll be taking a look at open ones on this repo to see what I can carry over as well 👍

@freescout-help
Copy link
Author

Regarding implementing POP3 protocol without PHP IMAP extension functions: stevebauman#9

@salvor-hardin
Copy link

I have PHP 8.4.2 and Steve's library is working. Just install the imap library.

wget http://curl.haxx.se/ca/cacert.pem -O /usr/ssl/cert.pem
pecl channel-update pecl.php.net
pecl install --configureoptions 'with-kerberos="yes" with-imap-ssl="yes"' imap

Then add
extension=imap.so

at the end of your php.ini file.

@freescout-help
Copy link
Author

We are providing the helpdesk which is being installed on shared hosting services - most of them don't provide PHP IMAP extensions with PHP 8.4 anymore.

@salvor-hardin
Copy link

Without the extensions, and writing adhoc code to simulate something that is already there, you will make this PHP-IMAP library incompatible with PHP 8.4.2 with the extension installed and multiple forever support.

The problem is with the infrastructure where you want to use this library, not with this PHP-IMAP library that Steve has indeed made compatible with PHP 8.4 already.

@freescout-help
Copy link
Author

Here is the POP3 protocol implementation without using PHP IMAP extension functions:
https://github.com/freescout-help-desk/freescout/blob/master/overrides/webklex/php-imap/src/Connection/Protocols/PopProtocol.php

It works similar to LegacyProtocol.php, just not all the searching options are implemented yet in the search() function (only SINCE is supported for now).

In order to utilize it (when PHP IMAP extension is not enabled) add the following code to /src/Client.php:

            if (extension_loaded('imap') === false) {
                $this->connection = new PopProtocol($this->validate_cert, $this->encryption);
            } else {
                $this->connection = new \Webklex\PHPIMAP\Connection\Protocols\LegacyProtocol($this->validate_cert, $this->encryption);
                if (strpos($protocol, "legacy-") === 0) {
                    $protocol = substr($protocol, 7);
                }
                $this->connection->setProtocol($protocol);
            }

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

No branches or pull requests

4 participants