issue #2296 for install.php, we always need class PwgSession defined

This commit is contained in:
plegall 2024-12-20 11:05:46 +01:00
parent 627aa045ed
commit 547c8a9b94

View file

@ -10,24 +10,25 @@
* @package functions\session
*/
// In PHP 8.4+ calling session_set_save_handler with
// two parameters is deprecated. To correct this,
// we pass a SessionHandlerInterface instance.
// https://github.com/Piwigo/Piwigo/issues/2296
// Depending on the PHP version, we include the appropriate
// session handler class file.
if (version_compare(PHP_VERSION, '8.0.0') < 0)
{
include_once(PHPWG_ROOT_PATH.'/include/pwgsession_php7.class.php');
}
else
{
include_once(PHPWG_ROOT_PATH.'/include/pwgsession.class.php');
}
if (isset($conf['session_save_handler'])
and ($conf['session_save_handler'] == 'db')
and defined('PHPWG_INSTALLED'))
{
// In PHP 8.4+ calling session_set_save_handler with
// two parameters is deprecated. To correct this,
// we pass a SessionHandlerInterface instance.
// https://github.com/Piwigo/Piwigo/issues/2296
// Depending on the PHP version, we include the appropriate
// session handler class file.
if (version_compare(PHP_VERSION, '8.0.0') < 0)
{
include_once(PHPWG_ROOT_PATH.'/include/pwgsession_php7.class.php');
}
else
{
include_once(PHPWG_ROOT_PATH.'/include/pwgsession.class.php');
}
session_set_save_handler(new PwgSession());
if (function_exists('ini_set'))