This is a resource manager for memcached

package Default

 Methods

Add one server

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

Parameters

$id

string

$server

stringarray

Returns

\Zend\Cache\Storage\Adapter\MemcachedResourceManager

Add servers

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

Parameters

$id

string

$servers

stringarray

Returns

\Zend\Cache\Storage\Adapter\MemcachedResourceManager

Get one Libmemcached option

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

Parameters

$id

string

$key

stringinteger

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) : boolean

Parameters

$id

string

Returns

boolean

Remove a resource

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

Parameters

$id

string

Returns

\Zend\Cache\Storage\Adapter\MemcachedResourceManagerFluent interface

Set one Libmemcached option

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

Parameters

$id

string

$key

stringinteger

$value

mixed

Returns

\Zend\Cache\Storage\Adapter\MemcachedResourceManagerFluent interface

Set Libmemcached options

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

Parameters

$id

string

$libOptions

array

Returns

\Zend\Cache\Storage\Adapter\MemcachedResourceManagerFluent interface

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

\Zend\Cache\Storage\Adapter\MemcachedResourceManagerFluent interface

Set a resource

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

Parameters

$id

string

$resource

array\Traversable\Memcached

Returns

\Zend\Cache\Storage\Adapter\MemcachedResourceManagerFluent interface

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

\Zend\Cache\Storage\Adapter\MemcachedResourceManager

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

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

Parameters

$serverA

array

$serverB

array

Returns

integer

Convert option name into it's constant value

normalizeLibOptionKey(string|integer $key) 

Parameters

$key

stringinteger

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($server) 

Parameters

$server

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

Default

array()