summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorlogach <logach3@gmail.com>2016-09-27 14:56:22 +0200
committerlogach <logach3@gmail.com>2016-09-27 14:56:22 +0200
commit7ed227b9075498e307c91a3ae0345755f935a520 (patch)
tree0bd089501d7f3b9ae5dcf5eb1e106bfb476a1c0a /system/libraries
parent89c9749fb8808eeaa7710128712b33502483b6e0 (diff)
Add database index by default
Select database if exists
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index ec4432437..2d1ead452 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -58,7 +58,8 @@ class CI_Cache_redis extends CI_Driver
'host' => '127.0.0.1',
'password' => NULL,
'port' => 6379,
- 'timeout' => 0
+ 'timeout' => 0,
+ 'database' => 0
);
/**
@@ -113,6 +114,11 @@ class CI_Cache_redis extends CI_Driver
{
log_message('error', 'Cache: Redis authentication failed.');
}
+
+ if (isset($config['database']) && $config['database'] > 0 && ! $this->_redis->select($config['database']))
+ {
+ log_message('error', 'Cache: Redis select database failed.');
+ }
}
catch (RedisException $e)
{