summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers
diff options
context:
space:
mode:
authorKakysha <ezhikvdele@gmail.com>2013-10-27 22:39:17 +0100
committerKakysha <ezhikvdele@gmail.com>2013-10-28 18:26:28 +0100
commit80d663aa81eec7bc0894efe1012faec7f6d452b0 (patch)
tree8462aeb3464683e63c6215b8fb5c3b02f8db0342 /system/libraries/Cache/drivers
parent96185a3a0edcc27fa0af6df761d6353a2208ea9d (diff)
Added option to connect through unix socket in redis cache driver
Diffstat (limited to 'system/libraries/Cache/drivers')
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index 40823fcb4..8daed8bc3 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -44,6 +44,7 @@ class CI_Cache_redis extends CI_Driver
* @var array
*/
protected static $_default_config = array(
+ 'socket_type' => 'tcp',
'host' => '127.0.0.1',
'password' => NULL,
'port' => 6379,
@@ -200,7 +201,13 @@ class CI_Cache_redis extends CI_Driver
try
{
- $this->_redis->connect($config['host'], $config['port'], $config['timeout']);
+ if ($config['socket_type'] === 'unix')
+ {
+ $v = $this->_redis->connect($config['socket']);
+ } else // tcp socket
+ {
+ $this->_redis->connect($config['host'], $config['port'], $config['timeout']);
+ }
}
catch (RedisException $e)
{