diff options
author | Kakysha <ezhikvdele@gmail.com> | 2013-10-27 22:39:17 +0100 |
---|---|---|
committer | Kakysha <ezhikvdele@gmail.com> | 2013-10-28 18:26:28 +0100 |
commit | 80d663aa81eec7bc0894efe1012faec7f6d452b0 (patch) | |
tree | 8462aeb3464683e63c6215b8fb5c3b02f8db0342 /system/libraries/Cache/drivers | |
parent | 96185a3a0edcc27fa0af6df761d6353a2208ea9d (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.php | 9 |
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) { |