You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After #9309 (landed on 8.1.10) any attempt to close an already closed imap connection results on a ValueError: IMAP\Connection is already closed exception being thrown.
imap_ping() also throws the same exception, so there's no way to check if a connection is still open (it might be closed by another piece of code, or because the server closed the connection while processing a long task).
There should be a safe way to check if a IMAP\Connection is still open.
so there's no way to check if a connection is still open (it might be closed by another piece of code, or because the server closed the connection while processing a long task).
In the latter case, there should be no ValueError: IMAP\Connection is already closed, though. An application can handle the former case, but still it might be reasonable to introduce an imap_is_open() function.
Description
After #9309 (landed on 8.1.10) any attempt to close an already closed imap connection results on a
ValueError: IMAP\Connection is already closed
exception being thrown.imap_ping()
also throws the same exception, so there's no way to check if a connection is still open (it might be closed by another piece of code, or because the server closed the connection while processing a long task).There should be a safe way to check if a IMAP\Connection is still open.
Related: barbushin/php-imap#680
PHP Version
PHP >= 8.1.10
Operating System
Ubuntu 22.04 / Windows 10&11
The text was updated successfully, but these errors were encountered: