From 940819167f58bad7efb87b9dacd91ba44029ab4d Mon Sep 17 00:00:00 2001 From: Michael Long Date: Wed, 14 Aug 2019 18:36:38 +0800 Subject: Define constant PHPREDIS_VERSION --- system/libraries/Session/drivers/Session_redis_driver.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'system') diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 66a28ffdc..1215b3afd 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -37,6 +37,8 @@ */ defined('BASEPATH') OR exit('No direct script access allowed'); +define('PHPREDIS_VERSION', phpversion('redis')); + /** * CodeIgniter Session Redis Driver * @@ -453,7 +455,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle */ protected function _expire_key($key, $ttl) { - if (version_compare(phpversion('redis'), '5', '>=')) + if (version_compare(PHPREDIS_VERSION, '5', '>=')) return $this->_redis->expire($key, $ttl); return $this->_redis->setTimeout($key, $ttl); } @@ -470,7 +472,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle */ protected function _delete_key($key) { - if (version_compare(phpversion('redis'), '5', '>=')) + if (version_compare(PHPREDIS_VERSION, '5', '>=')) return $this->_redis->del($key); return $this->_redis->delete($key); } -- cgit v1.2.3-24-g4f1b