This is a resource manager for memcached

 Methods

Add one server

addServer(string $id, string | array $server) : \Zend\Cache\Storage\Adapter\MemcachedResourceManager

Parameters

$id

string

$server

stringarray

Returns

Add servers

addServers(string $id, string | array $servers) : \Zend\Cache\Storage\Adapter\MemcachedResourceManager

Parameters

$id

string

$servers

stringarray

Returns

Get one Libmemcached option

getLibOption(string $id, string | int $key) : mixed

Parameters

$id

string

$key

stringint

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

mixed

Get Libmemcached options

getLibOptions(string $id) : array

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

array

Get the persistent id

getPersistentId(string $id) : string

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

string

Gets a memcached resource

getResource(string $id) : \Memcached

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

\Memcached

Get servers

getServers(string $id) : array

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

arrayarray('host' => , 'port' => , 'weight' => )

Check if a resource exists

hasResource(string $id) : bool

Parameters

$id

string

Returns

bool

Remove a resource

removeResource(string $id) : \Zend\Cache\Storage\Adapter\MemcachedResourceManager

Parameters

$id

string

Returns

Set one Libmemcached option

setLibOption(string $id, string | int $key, mixed $value) : \Zend\Cache\Storage\Adapter\MemcachedResourceManager

Parameters

$id

string

$key

stringint

$value

mixed

Returns

Set Libmemcached options

setLibOptions(string $id, array $libOptions) : \Zend\Cache\Storage\Adapter\MemcachedResourceManager

Parameters

$id

string

$libOptions

array

Returns

Set the persistent id

setPersistentId(string $id, string $persistentId) : \Zend\Cache\Storage\Adapter\MemcachedResourceManager

Parameters

$id

string

$persistentId

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

Set a resource

setResource(string $id, array | \Traversable | \Memcached $resource) : \Zend\Cache\Storage\Adapter\MemcachedResourceManager

Parameters

$id

string

$resource

array\Traversable\Memcached

Returns

Set servers

setServers(string $id, string | array $servers) : \Zend\Cache\Storage\Adapter\MemcachedResourceManager

$servers can be an array list or a comma separated list of servers. One server in the list can be descripted as follows: - URI: [tcp://][:][?weight=] - Assoc: array('host' => [, 'port' => ][, 'weight' => ]) - List: array([, ][, ])

Parameters

$id

string

$servers

stringarray

Returns

Compare 2 normalized server arrays (Compares only the host and the port)

compareServers(array $serverA, array $serverB) : int

Parameters

$serverA

array

$serverB

array

Returns

int

Convert option name into it's constant value

normalizeLibOptionKey(string | int $key) 

Parameters

$key

stringint

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

Normalize libmemcached options

normalizeLibOptions(array | \Traversable $libOptions) 

Parameters

$libOptions

array\Traversable

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

Normalize the persistent id

normalizePersistentId(string $persistentId) 

Parameters

$persistentId

string

Normalize one server into the following format: array('host' => <host>, 'port' => <port>, 'weight' => <weight>)

normalizeServer(string | array $server) 

Parameters

$server

stringarray

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

Normalize a list of servers into the following format: array(array('host' => <host>, 'port' => <port>, 'weight' => <weight>)[, .

normalizeServers(string | array $servers) 

..])

Parameters

$servers

stringarray

 Properties

 

Registered resources

$resources : array