This is a resource manager for memcache

package Default

 Methods

Add one server

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

Parameters

$id

string

$server

stringarray

Returns

\Zend\Cache\Storage\Adapter\MemcacheResourceManager

Add servers

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

Parameters

$id

string

$servers

stringarray

Returns

\Zend\Cache\Storage\Adapter\MemcacheResourceManager

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) : integer | null

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

integernull

Get callback for server connection failures

getFailureCallback(string $id) : callable

Parameters

$id

string

Exceptions

\Zend\Cache\Exception\RuntimeException

Returns

callable

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

Parameters

$id

string

Returns

boolean

Remove a resource

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

Parameters

$id

string

Returns

\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

\Zend\Cache\Storage\Adapter\MemcacheResourceManager

Set compress threshold

setAutoCompressThreshold(string $id, integer|string|array|\ArrayAccess|null $threshold, float|string|boolean $minSavings = false) : \Zend\Cache\Storage\Adapter\MemcacheResourceManager

Parameters

$id

string

$threshold

integerstringarray\ArrayAccessnull

$minSavings

floatstringboolean

Returns

\Zend\Cache\Storage\Adapter\MemcacheResourceManager

Set callback for server connection failures

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

Parameters

$id

string

$failureCallback

callablenull

Returns

\Zend\Cache\Storage\Adapter\MemcacheResourceManager

Set a resource

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

Parameters

$id

string

$resource

array\Traversable\Memcache

$failureCallback

callable

$serverDefaults

array\Traversable

Returns

\Zend\Cache\Storage\Adapter\MemcacheResourceManager

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

\Zend\Cache\Storage\Adapter\MemcacheResourceManager

addServerToResource()

addServerToResource(\Memcache $resource, array $server, array $serverDefaults, callable|null $failureCallback) 

Parameters

$resource

\Memcache

$server

array

$serverDefaults

array

$failureCallback

callablenull

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

Normalize compress threshold options

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

Parameters

$threshold

integerstringarray\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, integer $threshold, float $minSavings) 

Parameters

$resource

\Memcache

$threshold

integer

$minSavings

float

 Properties

 

Failure callback per resource

$failureCallbacks : array<mixed,callable>

Default

array()
 

Registered resources

$resources : array

Default

array()
 

Default server values per resource

$serverDefaults : array

Default

array()