protected function _formatHostList($host)
{
$fromString = function ($host) {
if (strpos($host, ':')) {
list($host, $port) = explode(':', $host);
return array($host, (int) $port);
}
return array($host, Memcache::CONN_DEFAULT_PORT);
};
if (is_string($host)) {
return array($fromString($host));
}
$servers = array();
while (list($server, $weight) = each($this->_config['host'])) {
if (is_string($weight)) {
$servers[] = $fromString($weight);
continue;
}
$server = $fromString($server);
$server[] = $weight;
$servers[] = $server;
}
return $servers;
}