mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-28 20:29:58 +03:00
issue #2296 for install.php, we always need class PwgSession defined
This commit is contained in:
parent
627aa045ed
commit
547c8a9b94
1 changed files with 15 additions and 14 deletions
|
@ -10,24 +10,25 @@
|
||||||
* @package functions\session
|
* @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'])
|
if (isset($conf['session_save_handler'])
|
||||||
and ($conf['session_save_handler'] == 'db')
|
and ($conf['session_save_handler'] == 'db')
|
||||||
and defined('PHPWG_INSTALLED'))
|
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());
|
session_set_save_handler(new PwgSession());
|
||||||
|
|
||||||
if (function_exists('ini_set'))
|
if (function_exists('ini_set'))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue