summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Long <mchobbylong@gmail.com>2019-08-14 12:36:38 +0200
committerMichael Long <mchobbylong@gmail.com>2019-08-14 12:36:38 +0200
commit940819167f58bad7efb87b9dacd91ba44029ab4d (patch)
treec7b0d2c3c3d564ab7d095f6c689f736ff692af35
parent1f90f7b985214319b1363d0fa2b497d2a1cd9a8d (diff)
Define constant PHPREDIS_VERSION
-rw-r--r--system/libraries/Session/drivers/Session_redis_driver.php6
1 files changed, 4 insertions, 2 deletions
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);
}