mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #12906 from akeiper/2.x
resolving ini_set error in php 7.2 Fixes #12678
This commit is contained in:
commit
73de35c119
1 changed files with 2 additions and 2 deletions
|
@ -575,7 +575,7 @@ class CakeSession {
|
||||||
$sessionConfig['cacheLimiter'] = 'must-revalidate';
|
$sessionConfig['cacheLimiter'] = 'must-revalidate';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($_SESSION)) {
|
if (empty($_SESSION) && !headers_sent() && (!function_exists('session_status') || session_status() !== PHP_SESSION_ACTIVE)) {
|
||||||
if (!empty($sessionConfig['ini']) && is_array($sessionConfig['ini'])) {
|
if (!empty($sessionConfig['ini']) && is_array($sessionConfig['ini'])) {
|
||||||
foreach ($sessionConfig['ini'] as $setting => $value) {
|
foreach ($sessionConfig['ini'] as $setting => $value) {
|
||||||
if (ini_set($setting, $value) === false) {
|
if (ini_set($setting, $value) === false) {
|
||||||
|
@ -587,7 +587,7 @@ class CakeSession {
|
||||||
if (!empty($sessionConfig['handler']) && !isset($sessionConfig['handler']['engine'])) {
|
if (!empty($sessionConfig['handler']) && !isset($sessionConfig['handler']['engine'])) {
|
||||||
call_user_func_array('session_set_save_handler', $sessionConfig['handler']);
|
call_user_func_array('session_set_save_handler', $sessionConfig['handler']);
|
||||||
}
|
}
|
||||||
if (!empty($sessionConfig['handler']['engine'])) {
|
if (!empty($sessionConfig['handler']['engine']) && !headers_sent() && (!function_exists('session_status') || session_status() !== PHP_SESSION_ACTIVE)) {
|
||||||
$handler = static::_getHandler($sessionConfig['handler']['engine']);
|
$handler = static::_getHandler($sessionConfig['handler']['engine']);
|
||||||
session_set_save_handler(
|
session_set_save_handler(
|
||||||
array($handler, 'open'),
|
array($handler, 'open'),
|
||||||
|
|
Loading…
Reference in a new issue