42. Class

42.1. Zend\Cache\Storage\Adapter\MemcachedResourceManager

This is a resource manager for memcached

42.1.1. Methods

42.1.1.1. hasResource

hasResource()

Check if a resource exists

Parameters:string
Return type:boolean

42.1.1.2. getResource

getResource()

Gets a memcached resource

Parameters:string
Return type:MemcachedResource
Throws :ExceptionRuntimeException

42.1.1.3. setResource

setResource()

Set a resource

Parameters:
  • string
  • array|Traversable|MemcachedResource
Return type:

MemcachedResourceManager Fluent interface

42.1.1.4. removeResource

removeResource()

Remove a resource

Parameters:string
Return type:MemcachedResourceManager Fluent interface

42.1.1.5. setPersistentId

setPersistentId()

Set the persistent id

Parameters:
  • string
  • string
Return type:

MemcachedResourceManager Fluent interface

Throws :

ExceptionRuntimeException

42.1.1.6. getPersistentId

getPersistentId()

Get the persistent id

Parameters:string
Return type:string
Throws :ExceptionRuntimeException

42.1.1.7. normalizePersistentId

normalizePersistentId()

Normalize the persistent id

Parameters:string

42.1.1.8. setLibOptions

setLibOptions()

Set Libmemcached options

Parameters:
  • string
  • array
Return type:

MemcachedResourceManager Fluent interface

42.1.1.9. getLibOptions

getLibOptions()

Get Libmemcached options

Parameters:string
Return type:array
Throws :ExceptionRuntimeException

42.1.1.10. setLibOption

setLibOption()

Set one Libmemcached option

Parameters:
  • string
  • string|int
  • mixed
Return type:

MemcachedResourceManager Fluent interface

42.1.1.11. getLibOption

getLibOption()

Get one Libmemcached option

Parameters:
  • string
  • string|int
Return type:

mixed

Throws :

ExceptionRuntimeException

42.1.1.12. normalizeLibOptions

normalizeLibOptions()

Normalize libmemcached options

Parameters:array|Traversable
Throws ExceptionInvalidArgumentException:
 

42.1.1.13. normalizeLibOptionKey

normalizeLibOptionKey()

Convert option name into it’s constant value

Parameters:string|int
Throws ExceptionInvalidArgumentException:
 

42.1.1.14. setServers

setServers()

Set servers

$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://]<host>[:<port>][?weight=<weight>] - Assoc: array(‘host’ => <host>[, ‘port’ => <port>][, ‘weight’ => <weight>]) - List: array(<host>[, <port>][, <weight>])

Parameters:
  • string
  • string|array
Return type:

MemcachedResourceManager

42.1.1.15. getServers

getServers()

Get servers

Parameters:string
Throws ExceptionRuntimeException:
 
Return type:array array(‘host’ => <host>, ‘port’ => <port>, ‘weight’ => <weight>)

42.1.1.16. addServers

addServers()

Add servers

Parameters:
  • string
  • string|array
Return type:

MemcachedResourceManager

42.1.1.17. addServer

addServer()

Add one server

Parameters:
  • string
  • string|array
Return type:

MemcachedResourceManager

42.1.1.18. normalizeServers

normalizeServers()

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

Parameters:string|array

42.1.1.19. normalizeServer

normalizeServer()

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

Parameters:string|array
Throws ExceptionInvalidArgumentException:
 

42.1.1.20. compareServers

compareServers()

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

Parameters:
  • array
  • array
Return type:

int