summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-03-12 11:33:07 +0100
committerAndrey Andreev <narf@devilix.net>2016-03-12 11:33:07 +0100
commitb32dd76567c8ff09dfae59f2bd177ed8af470e23 (patch)
tree355e555f74f15f78c6148b2470e0ef0fa66a9590
parentfef66f16148a81d57eb2168fda0502be16258870 (diff)
parenta604554c592c090334b3a57d41e498d6f03fd1e4 (diff)
Merge pull request #4524 from masterklavi/memcached_refactoring
Cache_memcached configuration refactoring
-rw-r--r--system/libraries/Cache/drivers/Cache_memcached.php16
1 files changed, 4 insertions, 12 deletions
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php
index df02ca2d0..6dee1e8e4 100644
--- a/system/libraries/Cache/drivers/Cache_memcached.php
+++ b/system/libraries/Cache/drivers/Cache_memcached.php
@@ -60,7 +60,7 @@ class CI_Cache_memcached extends CI_Driver {
*
* @var array
*/
- protected $_memcache_conf = array(
+ protected $_config = array(
'default' => array(
'host' => '127.0.0.1',
'port' => 11211,
@@ -81,19 +81,11 @@ class CI_Cache_memcached extends CI_Driver {
{
// 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 @@ class CI_Cache_memcached extends CI_Driver {
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'];