Per #97, the fix in 2.8.1 (provided by #92) for having SessionConfig::setPhpSaveHandler() work with PHP 7.2 was too aggressive, and prevented the ability to set the value to a known extension, such as redis.
This patch fixes that approach by grabbing a list of known save handlers from phpinfo() (after first stripping user from the list), and comparing the incoming value to that list; if it is in that list, it now uses session_module_name() to set the value.
Tests for this are next to impossible to write, unfortunately, as we would need to have multiple extensions installed on developer machines and in Travis. I have instead added tests verifying the various exceptions thrown, including one thrown when a value is in the known PHP save handlers list, but fails to be set properly.
Per #97, the fix in 2.8.1 (provided by #92) for having
SessionConfig::setPhpSaveHandler()
work with PHP 7.2 was too aggressive, and prevented the ability to set the value to a known extension, such as redis.This patch fixes that approach by grabbing a list of known save handlers from
phpinfo()
(after first strippinguser
from the list), and comparing the incoming value to that list; if it is in that list, it now usessession_module_name()
to set the value.Tests for this are next to impossible to write, unfortunately, as we would need to have multiple extensions installed on developer machines and in Travis. I have instead added tests verifying the various exceptions thrown, including one thrown when a value is in the known PHP save handlers list, but fails to be set properly.
Fixes #97.