\Pop\Cache\AdapterMemcached

Memcached cache adapter class

Summary

Methods
Properties
Constants
__construct()
setTtl()
getTtl()
getItemTtl()
saveItem()
getItem()
hasItem()
deleteItem()
clear()
destroy()
memcached()
addServer()
addServers()
getVersion()
No public properties found
No constants found
No protected methods found
$ttl
$memcached
$version
N/A
No private methods found
No private properties found
N/A

Properties

$ttl

$ttl : integer

Global time-to-live

Type

integer

$memcached

$memcached : \Memcached

Memcached object

Type

\Memcached

$version

$version : string

Memcached version

Type

string

Methods

__construct()

__construct(integer  $ttl, string  $host = 'localhost', integer  $port = 11211, integer  $weight = 1) 

Constructor

Instantiate the memcached cache object

Parameters

integer $ttl
string $host
integer $port
integer $weight

Throws

\Pop\Cache\Adapter\Exception

setTtl()

setTtl(integer  $ttl) : \Pop\Cache\Adapter\AbstractAdapter

Set the global time-to-live for the cache adapter

Parameters

integer $ttl

Returns

\Pop\Cache\Adapter\AbstractAdapter

getTtl()

getTtl() : integer

Get the global time-to-live for the cache object

Returns

integer

getItemTtl()

getItemTtl(string  $id) : integer

Get the time-to-live for an item in cache

Parameters

string $id

Returns

integer

saveItem()

saveItem(string  $id, mixed  $value, integer  $ttl = null) : \Pop\Cache\Adapter\Memcached

Save an item to cache

Parameters

string $id
mixed $value
integer $ttl

Returns

\Pop\Cache\Adapter\Memcached

getItem()

getItem(string  $id) : mixed

Get an item from cache

Parameters

string $id

Returns

mixed

hasItem()

hasItem(string  $id) : boolean

Determine if the item exist in cache

Parameters

string $id

Returns

boolean

deleteItem()

deleteItem(string  $id) : \Pop\Cache\Adapter\Memcached

Delete a value in cache

Parameters

string $id

Returns

\Pop\Cache\Adapter\Memcached

memcached()

memcached() : \Memcached

Get the memcached object.

Returns

\Memcached

addServer()

addServer(string  $host, integer  $port = 11211, integer  $weight = 1) : \Pop\Cache\Adapter\Memcached

Get the current version of memcached.

Parameters

string $host
integer $port
integer $weight

Returns

\Pop\Cache\Adapter\Memcached

addServers()

addServers(array  $servers) : \Pop\Cache\Adapter\Memcached

Get the current version of memcached.

Parameters

array $servers

Returns

\Pop\Cache\Adapter\Memcached

getVersion()

getVersion() : string

Get the current version of memcached.

Returns

string