\Pop\Cache\AdapterMemcache

Memcache cache adapter class

Summary

Methods
Properties
Constants
__construct()
setLifetime()
save()
load()
remove()
clear()
isExpired()
getStart()
getExpiration()
getLifetime()
memcache()
getVersion()
No public properties found
No constants found
No protected methods found
$lifetime
$memcache
$version
N/A
No private methods found
No private properties found
N/A

Properties

$lifetime

$lifetime : integer

Cache lifetime

Type

integer

$memcache

$memcache : \Memcache

Memcache object

Type

\Memcache

$version

$version : string

Memcache version

Type

string

Methods

__construct()

__construct(integer  $lifetime, string  $host = 'localhost', integer  $port = 11211) : \Pop\Cache\Adapter\Memcache

Constructor

Instantiate the memcache cache object

Parameters

integer $lifetime
string $host
integer $port

Throws

\Pop\Cache\Adapter\Exception

Returns

\Pop\Cache\Adapter\Memcache

setLifetime()

setLifetime(integer  $lifetime) : \Pop\Cache\Adapter\AbstractAdapter

Set the lifetime.

Parameters

integer $lifetime

Returns

\Pop\Cache\Adapter\AbstractAdapter

save()

save(string  $id, mixed  $value) : \Pop\Cache\Adapter\Memcache

Save a value to cache.

Parameters

string $id
mixed $value

Returns

\Pop\Cache\Adapter\Memcache

load()

load(string  $id) : mixed

Load a value from cache.

Parameters

string $id

Returns

mixed

remove()

remove(string  $id) : \Pop\Cache\Adapter\Memcache

Remove a value in cache.

Parameters

string $id

Returns

\Pop\Cache\Adapter\Memcache

isExpired()

isExpired(string  $id) : boolean

Tell is a value is expired.

Parameters

string $id

Returns

boolean

getStart()

getStart(string  $id) : integer

Get original start timestamp of the value.

Parameters

string $id

Returns

integer

getExpiration()

getExpiration(string  $id) : integer

Get expiration timestamp of the value.

Parameters

string $id

Returns

integer

getLifetime()

getLifetime(string  $id) : integer

Get the lifetime of the value.

Parameters

string $id

Returns

integer

memcache()

memcache() : \Memcache

Get the memcache object.

Returns

\Memcache

getVersion()

getVersion() : string

Get the current version of memcache.

Returns

string