|
Memcached::addServer(PECL memcached >= 0.1.0) Memcached::addServer — Add a server to the server pool Описание
public bool Memcached::addServer
( string $host
, int $port
[, int $weight = 0
] )
Memcached::addServer() adds the specified server to the server pool. No connection is established to the server at this time, but if you are using consistent key distribution option (via Memcached::DISTRIBUTION_CONSISTENT or Memcached::OPT_LIBKETAMA_COMPATIBLE), some of the internal data structures will have to be updated. Thus, if you need to add multiple servers, it is better to use Memcached::addServers() as the update then happens only once. The same server may appear multiple times in the server pool, because no duplication checks are made. This is not advisable; instead, use the weight option to increase the selection weighting of this server. Список параметров
Возвращаемые значенияВозвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки. Примеры
Пример #1 Memcached::addServer() example
<?php |
|