From 80d663aa81eec7bc0894efe1012faec7f6d452b0 Mon Sep 17 00:00:00 2001 From: Kakysha Date: Mon, 28 Oct 2013 01:39:17 +0400 Subject: Added option to connect through unix socket in redis cache driver --- system/libraries/Cache/drivers/Cache_redis.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'system/libraries/Cache/drivers/Cache_redis.php') 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) { -- cgit v1.2.3-24-g4f1b