From d327a4fc32b507a44e418cdd4b6e2c63690bc5cc Mon Sep 17 00:00:00 2001 From: Masterklavi Date: Mon, 14 Mar 2016 14:05:12 +0500 Subject: Unix socket check in one long line --- system/libraries/Cache/drivers/Cache_redis.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'system/libraries/Cache') diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php index 475dd4420..ec4432437 100644 --- a/system/libraries/Cache/drivers/Cache_redis.php +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -104,14 +104,7 @@ class CI_Cache_redis extends CI_Driver try { - // for unix domain socket - if ($config['host'][0] === '/') - { - $config['port'] = 0; - $config['timeout'] = 0; - } - - if ( ! $this->_redis->connect($config['host'], $config['port'], $config['timeout'])) + if ( ! $this->_redis->connect($config['host'], ($config['host'][0] === '/' ? 0 : $config['port']), $config['timeout'])) { log_message('error', 'Cache: Redis connection failed. Check your configuration.'); } -- cgit v1.2.3-24-g4f1b