summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache
diff options
context:
space:
mode:
authorTim Nolte <noltet@sekisui-spi.com>2015-06-08 18:25:34 +0200
committerTim Nolte <noltet@sekisui-spi.com>2015-06-08 18:25:34 +0200
commit89ed9fafd75e3b65a7691f1b13440bdedadf5eda (patch)
tree5dfa69c55ff48502527fcb6f4f532fb5ad6651ca /system/libraries/Cache
parent2ac4177b4b6afc63d594523416c3991d23dddf20 (diff)
parentb76394834a3e36e8c376913cd9666a8d7a4cea45 (diff)
Merge branch 'develop' into feature/mysqli-ssl
Diffstat (limited to 'system/libraries/Cache')
-rw-r--r--system/libraries/Cache/Cache.php22
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php4
2 files changed, 3 insertions, 23 deletions
diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php
index 40ac70103..215a7c528 100644
--- a/system/libraries/Cache/Cache.php
+++ b/system/libraries/Cache/Cache.php
@@ -100,28 +100,10 @@ class CI_Cache extends CI_Driver_Library {
*/
public function __construct($config = array())
{
- $default_config = array(
- 'adapter',
- 'memcached'
- );
-
- foreach ($default_config as $key)
- {
- if (isset($config[$key]))
- {
- $param = '_'.$key;
-
- $this->{$param} = $config[$key];
- }
- }
-
+ isset($config['adapter']) && $this->_adapter = $config['adapter'];
+ isset($config['backup']) && $this->_backup_driver = $config['backup'];
isset($config['key_prefix']) && $this->key_prefix = $config['key_prefix'];
- if (isset($config['backup']) && in_array($config['backup'], $this->valid_drivers))
- {
- $this->_backup_driver = $config['backup'];
- }
-
// If the specified adapter isn't available, check the backup.
if ( ! $this->is_supported($this->_adapter))
{
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index b940b76cb..66966ba16 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -125,9 +125,7 @@ class CI_Cache_redis extends CI_Driver
$this->_redis->sRemove('_ci_redis_serialized', $id);
}
- return ($ttl)
- ? $this->_redis->setex($id, $ttl, $data)
- : $this->_redis->set($id, $data);
+ return $this->_redis->set($id, $data, $ttl);
}
// ------------------------------------------------------------------------