forked from GNUsocial/gnu-social
Clean up host/port separation in memcached plugin -- use : not ; as separator and clean up some warnings
This commit is contained in:
parent
2f32181c93
commit
5783874cc2
@ -165,22 +165,20 @@ class MemcachePlugin extends Plugin
|
|||||||
$this->_conn = new Memcache();
|
$this->_conn = new Memcache();
|
||||||
|
|
||||||
if (is_array($this->servers)) {
|
if (is_array($this->servers)) {
|
||||||
foreach ($this->servers as $server) {
|
$servers = $this->servers;
|
||||||
list($host, $port) = @explode(';', $server);
|
} else {
|
||||||
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;
|
$port = 11211;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_conn->addServer($host, $port, $this->persistent);
|
$this->_conn->addServer($host, $port, $this->persistent);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$this->_conn->addServer($this->servers, $this->persistent);
|
|
||||||
list($host, $port) = explode(';', $this->servers);
|
|
||||||
if (empty($port)) {
|
|
||||||
$port = 11211;
|
|
||||||
}
|
|
||||||
$this->_conn->addServer($host, $port, $this->persistent);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compress items stored in the cache if they're over threshold in size
|
// Compress items stored in the cache if they're over threshold in size
|
||||||
// (default 2KiB) and the compression would save more than min savings
|
// (default 2KiB) and the compression would save more than min savings
|
||||||
|
Loading…
Reference in New Issue
Block a user