diff options
author | logach <logach3@gmail.com> | 2016-09-27 14:56:22 +0200 |
---|---|---|
committer | logach <logach3@gmail.com> | 2016-09-27 14:56:22 +0200 |
commit | 7ed227b9075498e307c91a3ae0345755f935a520 (patch) | |
tree | 0bd089501d7f3b9ae5dcf5eb1e106bfb476a1c0a | |
parent | 89c9749fb8808eeaa7710128712b33502483b6e0 (diff) |
Add database index by default
Select database if exists
-rw-r--r-- | system/libraries/Cache/drivers/Cache_redis.php | 8 |
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) { |