protected function addMemcacheServers($cache, $servers)
    {
        $class = new \ReflectionClass($cache);
        $paramCount = $class->getMethod('addServer')->getNumberOfParameters();
        foreach ($servers as $server) {
            // $timeout is used for memcache versions that do not have $timeoutms parameter
            $timeout = (int) ($server->timeout / 1000) + (($server->timeout % 1000 > 0) ? 1 : 0);
            if ($paramCount === 9) {
                $cache->addServer(
                    $server->host,
                    $server->port,
                    $server->persistent,
                    $server->weight,
                    $timeout,
                    $server->retryInterval,
                    $server->status,
                    $server->failureCallback,
                    $server->timeout
                );
            } else {
                $cache->addServer(
                    $server->host,
                    $server->port,
                    $server->persistent,
                    $server->weight,
                    $timeout,
                    $server->retryInterval,
                    $server->status,
                    $server->failureCallback
                );
            }
        }
    }
protected function addMemcacheServers($cache, $servers)
    {
        $class = new \ReflectionClass($cache);
        $paramCount = $class->getMethod('addServer')->getNumberOfParameters();
        foreach ($servers as $server) {
            // $timeout is used for memcache versions that do not have $timeoutms parameter
            $timeout = (int) ($server->timeout / 1000) + (($server->timeout % 1000 > 0) ? 1 : 0);
            if ($paramCount === 9) {
                $cache->addServer(
                    $server->host,
                    $server->port,
                    $server->persistent,
                    $server->weight,
                    $timeout,
                    $server->retryInterval,
                    $server->status,
                    $server->failureCallback,
                    $server->timeout
                );
            } else {
                $cache->addServer(
                    $server->host,
                    $server->port,
                    $server->persistent,
                    $server->weight,
                    $timeout,
                    $server->retryInterval,
                    $server->status,
                    $server->failureCallback
                );
            }
        }
    }
protected function addMemcacheServers ( $ cache , $ servers ) { $ class = new \ ReflectionClass ( $ cache ) ; $ paramCount = $ class -> getMethod ( 'addServer' ) -> getNumberOfParameters ( ) ; foreach ( $ servers as $ server ) { // $timeout is used for memcache versions that do not have $timeoutms parameter $ timeout = ( int ) ( $ server -> timeout / 1000 ) + ( ( $ server -> timeout % 1000 > 0 ) ? 1 : 0 ) ; if ( $ paramCount === 9 ) { $ cache -> addServer ( $ server -> host , $ server -> port , $ server -> persistent , $ server -> weight , $ timeout , $ server -> retryInterval , $ server -> status , $ server -> failureCallback , $ server -> timeout ) ; } else { $ cache -> addServer ( $ server -> host , $ server -> port , $ server -> persistent , $ server -> weight , $ timeout , $ server -> retryInterval , $ server -> status , $ server -> failureCallback ) ; } } }
Add servers to the server pool of the cache specified
Used for memcache PECL extension.

@param \Memcache $cache
@param MemCacheServer[] $servers
Add servers to the server pool of the cache specified Used for memcache PECL extension .