This is a resource manager for memcache

 Methods

Add one server

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

Parameters

$id

string

$server

stringarray

Returns

Add servers

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

Parameters

$id

string

$servers

stringarray

Returns

Get compress min savings

getAutoCompressMinSavings(string $id) : float | null

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

floatnull

Get compress threshold

getAutoCompressThreshold(string $id) : int | null

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

intnull

Get callback for server connection failures

getFailureCallback(string $id) : \Zend\Cache\Storage\Adapter\callable | null

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

\Zend\Cache\Storage\Adapter\callablenull

Gets a memcache resource

getResource(string $id) : \Memcache

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

\Memcache

Get default server values

getServerDefaults(string $id) : array

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

array

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\MemcacheResourceManager

Set compress min savings

setAutoCompressMinSavings(string $id, float | string | null $minSavings) : \Zend\Cache\Storage\Adapter\MemcacheResourceManager

Parameters

$id

string

$minSavings

floatstringnull

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

Set compress threshold

setAutoCompressThreshold(string $id, int | string | array | \ArrayAccess | null $threshold, float | string | bool $minSavings) : \Zend\Cache\Storage\Adapter\MemcacheResourceManager

Parameters

$id

string

$threshold

intstringarray\ArrayAccessnull

$minSavings

floatstringbool

Returns

Set callback for server connection failures

setFailureCallback(string $id, \Zend\Cache\Storage\Adapter\callable | null $failureCallback) : \Zend\Cache\Storage\Adapter\MemcacheResourceManager

Parameters

$id

string

$failureCallback

\Zend\Cache\Storage\Adapter\callablenull

Returns

Set a resource

setResource(string $id, array | \Traversable | \Memcache $resource, $failureCallback, $serverDefaults) : \Zend\Cache\Storage\Adapter\MemcacheResourceManager

Parameters

$id

string

$resource

array\Traversable\Memcache

$failureCallback

$serverDefaults

Returns

Set default server values array( 'persistent' => <persistent>, 'weight' => <weight>, 'timeout' => <timeout>, 'retry_interval' => <retryInterval>, )

setServerDefaults(string $id, array $serverDefaults) : \Zend\Cache\Storage\Adapter\MemcacheResourceManager

Parameters

$id

string

$serverDefaults

array

Returns

addServerToResource()

addServerToResource(\Memcache $resource, array $server, array $serverDefaults, \Zend\Cache\Storage\Adapter\callable | null $failureCallback) 

Parameters

$resource

\Memcache

$server

array

$serverDefaults

array

$failureCallback

\Zend\Cache\Storage\Adapter\callablenull

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

Normalize compress threshold options

normalizeAutoCompressThreshold(int | string | array | \ArrayAccess $threshold, float | string $minSavings) 

Parameters

$threshold

intstringarray\ArrayAccess

$minSavings

floatstring

Normalize one server into the following format: array( 'host' => <host>, 'port' => <port>, 'weight' => <weight>, 'status' => <status>, 'persistent' => <persistent>, 'timeout' => <timeout>, 'retry_interval' => <retryInterval>, )

normalizeServer(string | array $server) 

Parameters

$server

stringarray

Exceptions

\Zend\Cache\Exception\InvalidArgumentException

normalizeServerDefaults()

normalizeServerDefaults(array $serverDefaults) 

Parameters

$serverDefaults

array

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

Set compress threshold on a Memcache resource

setResourceAutoCompressThreshold(\Memcache $resource, $threshold, $minSavings) 

Parameters

$resource

\Memcache

$threshold

$minSavings

 Properties

 

Failure callback per resource

$failureCallbacks : \Zend\Cache\Storage\Adapter\callable[]

 

Registered resources

$resources : array

 

Default server values per resource

$serverDefaults : array