Skip to content

Commit

Permalink
adding support for PHP 5.3 by adding function_exists for session_status
Browse files Browse the repository at this point in the history
  • Loading branch information
akeiper committed Jan 16, 2019
1 parent 06269b3 commit 38074f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/CakeSession.php
Expand Up @@ -575,7 +575,7 @@ protected static function _configureSession() {
$sessionConfig['cacheLimiter'] = 'must-revalidate';
}

if (!headers_sent() && session_status() !== \PHP_SESSION_ACTIVE && empty($_SESSION)) {
if (empty($_SESSION) && !headers_sent() && (!function_exists('session_status') || session_status() !== PHP_SESSION_ACTIVE)) {
if (!empty($sessionConfig['ini']) && is_array($sessionConfig['ini'])) {
foreach ($sessionConfig['ini'] as $setting => $value) {
if (ini_set($setting, $value) === false) {
Expand All @@ -587,7 +587,7 @@ protected static function _configureSession() {
if (!empty($sessionConfig['handler']) && !isset($sessionConfig['handler']['engine'])) {
call_user_func_array('session_set_save_handler', $sessionConfig['handler']);
}
if (!headers_sent() && session_status() !== \PHP_SESSION_ACTIVE && !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']);
session_set_save_handler(
array($handler, 'open'),
Expand Down

0 comments on commit 38074f7

Please sign in to comment.