forked from GNUsocial/gnu-social
Better handling for combined memcache identifiers
This commit is contained in:
parent
3dbfa97979
commit
b6df936454
@ -92,12 +92,18 @@ class Status_network extends Safe_DataObject
|
|||||||
// or a single-process script which is switching
|
// or a single-process script which is switching
|
||||||
// configurations.
|
// configurations.
|
||||||
$persist = php_sapi_name() != 'cli' || self::$cacheInitialized;
|
$persist = php_sapi_name() != 'cli' || self::$cacheInitialized;
|
||||||
if (is_array($servers)) {
|
if (!is_array($servers)) {
|
||||||
foreach($servers as $server) {
|
$servers = array($servers);
|
||||||
self::$cache->addServer($server, 11211, $persist);
|
}
|
||||||
|
foreach($servers as $server) {
|
||||||
|
$parts = explode(':', $server);
|
||||||
|
$server = $parts[0];
|
||||||
|
if (count($parts) > 1) {
|
||||||
|
$port = $parts[1];
|
||||||
|
} else {
|
||||||
|
$port = 11211;
|
||||||
}
|
}
|
||||||
} else {
|
self::$cache->addServer($server, $port, $persist);
|
||||||
self::$cache->addServer($servers, 11211, $persist);
|
|
||||||
}
|
}
|
||||||
self::$cacheInitialized = true;
|
self::$cacheInitialized = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user