Merge pull request #4524 from masterklavi/memcached_refactoring
Cache_memcached configuration refactoring
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php
index df02ca2..6dee1e8 100644
--- a/system/libraries/Cache/drivers/Cache_memcached.php
+++ b/system/libraries/Cache/drivers/Cache_memcached.php
@@ -60,7 +60,7 @@
*
* @var array
*/
- protected $_memcache_conf = array(
+ protected $_config = array(
'default' => array(
'host' => '127.0.0.1',
'port' => 11211,
@@ -81,19 +81,11 @@
{
// Try to load memcached server info from the config file.
$CI =& get_instance();
- $defaults = $this->_memcache_conf['default'];
+ $defaults = $this->_config['default'];
if ($CI->config->load('memcached', TRUE, TRUE))
{
- if (is_array($CI->config->config['memcached']))
- {
- $this->_memcache_conf = array();
-
- foreach ($CI->config->config['memcached'] as $name => $conf)
- {
- $this->_memcache_conf[$name] = $conf;
- }
- }
+ $this->_config = $CI->config->config['memcached'];
}
if (class_exists('Memcached', FALSE))
@@ -110,7 +102,7 @@
return;
}
- foreach ($this->_memcache_conf as $cache_server)
+ foreach ($this->_config as $cache_server)
{
isset($cache_server['hostname']) OR $cache_server['hostname'] = $defaults['host'];
isset($cache_server['port']) OR $cache_server['port'] = $defaults['port'];