summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers
diff options
context:
space:
mode:
authorKakysha <ezhikvdele@gmail.com>2013-10-28 17:20:24 +0100
committerKakysha <ezhikvdele@gmail.com>2013-10-28 18:26:39 +0100
commit2d14673d1a513a372a5921775aa3987f8444477e (patch)
tree1d0a3c5f8b154404a253054a067852978f4bd396 /system/libraries/Cache/drivers
parent80d663aa81eec7bc0894efe1012faec7f6d452b0 (diff)
Correct Redis connection troubleshooting
Diffstat (limited to 'system/libraries/Cache/drivers')
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index 8daed8bc3..b0315a3ab 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -164,8 +164,7 @@ class CI_Cache_redis extends CI_Driver
{
if (extension_loaded('redis'))
{
- $this->_setup_redis();
- return TRUE;
+ return $this->_setup_redis();
}
else
{
@@ -206,18 +205,26 @@ class CI_Cache_redis extends CI_Driver
$v = $this->_redis->connect($config['socket']);
} else // tcp socket
{
- $this->_redis->connect($config['host'], $config['port'], $config['timeout']);
+ $v = $this->_redis->connect($config['host'], $config['port'], $config['timeout']);
+ }
+ if (!$v)
+ {
+ log_message('debug','Redis connection refused. Check the config.');
+ return FALSE;
}
}
catch (RedisException $e)
{
- show_error('Redis connection refused. ' . $e->getMessage());
+ log_message('debug','Redis connection refused. ' . $e->getMessage());
+ return FALSE;
}
if (isset($config['password']))
{
$this->_redis->auth($config['password']);
}
+
+ return TRUE;
}
// ------------------------------------------------------------------------