diff options
author | Evan Prodromou <evan@status.net> | 2010-01-16 07:48:59 -0800 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-16 07:48:59 -0800 |
commit | 21c3e08804b312aaea21ae6bd0a0691304d6e4cd (patch) | |
tree | 9a950feabe17cd52e241eddf06d61409a190bba6 /plugins/MemcachePlugin.php | |
parent | d6b8b13116b9a2de5d745487277551b281796975 (diff) | |
parent | 598072468c9fdb07df2cda9da207f123b14566ae (diff) |
Merge branch 'master' of git@gitorious.org:statusnet/mainline
Diffstat (limited to 'plugins/MemcachePlugin.php')
-rw-r--r-- | plugins/MemcachePlugin.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/MemcachePlugin.php b/plugins/MemcachePlugin.php index bc7fd9076..5214ab9c8 100644 --- a/plugins/MemcachePlugin.php +++ b/plugins/MemcachePlugin.php @@ -165,20 +165,18 @@ class MemcachePlugin extends Plugin $this->_conn = new Memcache(); if (is_array($this->servers)) { - foreach ($this->servers as $server) { - list($host, $port) = @explode(';', $server); - if (empty($port)) { - $port = 11211; - } - - $this->_conn->addServer($host, $port, $this->persistent); - } + $servers = $this->servers; } else { - $this->_conn->addServer($this->servers, $this->persistent); - list($host, $port) = explode(';', $this->servers); - if (empty($port)) { + $servers = array($this->servers); + } + foreach ($servers as $server) { + if (strpos($server, ':') !== false) { + list($host, $port) = explode(':', $server); + } else { + $host = $server; $port = 11211; } + $this->_conn->addServer($host, $port, $this->persistent); } |