40. Class

40.1. Zend\Cache\Storage\Adapter\Memcached

40.1.1. Methods

40.1.1.1. __construct

__construct()

Constructor

Parameters:null|array|Traversable|MemcachedOptions
Throws ExceptionExceptionInterface:
 

40.1.1.2. getMemcachedResource

getMemcachedResource()

Initialize the internal memcached resource

Return type:MemcachedResource

40.1.1.3. setOptions

setOptions()

Set options.

Parameters:array|Traversable|MemcachedOptions
Return type:Memcached
See :

40.1.1.4. getOptions

getOptions()

Get options.

Return type:MemcachedOptions
See :

40.1.1.5. flush

flush()

Flush the whole storage

Return type:bool

40.1.1.6. getTotalSpace

getTotalSpace()

Get total space in bytes

Return type:int|float

40.1.1.7. getAvailableSpace

getAvailableSpace()

Get available space in bytes

Return type:int|float

40.1.1.8. internalGetItem

internalGetItem()

Internal method to get an item.

Parameters:
  • string
  • bool
  • mixed
Return type:

mixed Data on success, null on failure

Throws :

ExceptionExceptionInterface

40.1.1.9. internalGetItems

internalGetItems()

Internal method to get multiple items.

Parameters:array
Return type:array Associative array of keys and values
Throws :ExceptionExceptionInterface

40.1.1.10. internalHasItem

internalHasItem()

Internal method to test if an item exists.

Parameters:string
Return type:bool
Throws :ExceptionExceptionInterface

40.1.1.11. internalHasItems

internalHasItems()

Internal method to test multiple items.

Parameters:array
Return type:array Array of found keys
Throws :ExceptionExceptionInterface

40.1.1.12. internalGetMetadatas

internalGetMetadatas()

Get metadata of multiple items

Parameters:array
Return type:array Associative array of keys and metadata
Throws :ExceptionExceptionInterface

40.1.1.13. internalSetItem

internalSetItem()

Internal method to store an item.

Parameters:
  • string
  • mixed
Return type:

bool

Throws :

ExceptionExceptionInterface

40.1.1.14. internalSetItems

internalSetItems()

Internal method to store multiple items.

Parameters:array
Return type:array Array of not stored keys
Throws :ExceptionExceptionInterface

40.1.1.15. internalAddItem

internalAddItem()

Add an item.

Parameters:
  • string
  • mixed
Return type:

bool

Throws :

ExceptionExceptionInterface

40.1.1.16. internalReplaceItem

internalReplaceItem()

Internal method to replace an existing item.

Parameters:
  • string
  • mixed
Return type:

bool

Throws :

ExceptionExceptionInterface

40.1.1.17. internalCheckAndSetItem

internalCheckAndSetItem()

Internal method to set an item only if token matches

Parameters:
  • mixed
  • string
  • mixed
Return type:

bool

Throws :

ExceptionExceptionInterface

See :
See :

40.1.1.18. internalRemoveItem

internalRemoveItem()

Internal method to remove an item.

Parameters:string
Return type:bool
Throws :ExceptionExceptionInterface

40.1.1.19. internalRemoveItems

internalRemoveItems()

Internal method to remove multiple items.

Parameters:array
Return type:array Array of not removed keys
Throws :ExceptionExceptionInterface

40.1.1.20. internalIncrementItem

internalIncrementItem()

Internal method to increment an item.

Parameters:
  • string
  • int
Return type:

int|bool The new value on success, false on failure

Throws :

ExceptionExceptionInterface

40.1.1.21. internalDecrementItem

internalDecrementItem()

Internal method to decrement an item.

Parameters:
  • string
  • int
Return type:

int|bool The new value on success, false on failure

Throws :

ExceptionExceptionInterface

40.1.1.22. internalGetCapabilities

internalGetCapabilities()

Internal method to get capabilities of this adapter

Return type:Capabilities

40.1.1.23. expirationTime

expirationTime()

Get expiration time by ttl

Some storage commands involve sending an expiration value (relative to an item or to an operation requested by the client) to the server. In all such cases, the actual value sent may either be Unix time (number of seconds since January 1, 1970, as an integer), or a number of seconds starting from current time. In the latter case, this number of seconds may not exceed 60*60*24*30 (number of seconds in 30 days); if the expiration value is larger than that, the server will consider it to be real Unix time value rather than an offset from current time.

Return type:int

40.1.1.24. getExceptionByResultCode

getExceptionByResultCode()

Generate exception based of memcached result code

Parameters:int
Return type:ExceptionRuntimeException
Throws :ExceptionInvalidArgumentException On success code