matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.92k stars 2.66k forks source link

[PHP 8.4] Use SessionHandlerInterface instead of Zend_Session_SaveHandler_Interface #22690

Closed sgiehl closed 1 month ago

sgiehl commented 1 month ago

Description:

PHP 8.4 will deprecate the legacy signature of session_set_save_handler. Passing more than 2 parameters to the method will then trigger a deprecation notice.

To fix this the PR will replace the usage of Zend_Session_SaveHandler_Interface with the PHP built in interface SessionHandlerInterface, which can be directly passed to session_set_save_handler. This already exists since PHP 5.4, so should be compatible with all PHP versions we support.

For this the original Zend Session classes have been adjusted.

See https://php.watch/versions/8.4/session_set_save_handler-alt-signature-deprecated

refs #22471

Review

michalkleiner commented 1 month ago

I'm wondering whether we could direct all PHP 8.4 related PRs into a separate PHP 8.4 compatibility branch and then merge it all at once when all the adjustment work is done? Mainly to avoid merging in stuff that will pass on 5.x against 8.3 but we won't have immediate tests feedback on 8.4

sgiehl commented 1 month ago

@michalkleiner The changes of this PR are currently also in https://github.com/matomo-org/matomo/pull/22667, where the tests are only running with 8.4 and are passing. But I had to disable deprecations there, as the tests didn't pass with deprecations enabled.