\CodeIgniter\Cache\HandlersMemcachedHandler

Mamcached cache handler

Summary

Methods
Properties
Constants
__construct()
__destruct()
initialize()
get()
save()
delete()
increment()
decrement()
clean()
getCacheInfo()
getMetaData()
isSupported()
No public properties found
No constants found
No protected methods found
$prefix
$memcached
$config
N/A
No private methods found
No private properties found
N/A

Properties

$prefix

$prefix : string

Prefixed to all cache names.

Type

string

$memcached

$memcached : \Memcached|\Memcache

The memcached object

Type

\Memcached|\Memcache

$config

$config : array

Memcached Configuration

Type

array

Methods

__construct()

__construct(\CodeIgniter\Cache\Handlers\type  $config) 

Constructor.

Parameters

\CodeIgniter\Cache\Handlers\type $config

Throws

\CodeIgniter\Cache\Handlers\type

__destruct()

__destruct() 

Class destructor

Closes the connection to Memcache(d) if present.

initialize()

initialize() 

Takes care of any handler-specific setup that must be done.

get()

get(string  $key) : mixed

Attempts to fetch an item from the cache store.

Parameters

string $key

Cache item name

Returns

mixed

save()

save(string  $key, mixed  $value, integer  $ttl = 60) : mixed

Saves an item to the cache store.

Parameters

string $key

Cache item name

mixed $value

The data to save

integer $ttl

Time To Live, in seconds (default 60)

Returns

mixed

delete()

delete(string  $key) : mixed

Deletes a specific item from the cache store.

Parameters

string $key

Cache item name

Returns

mixed

increment()

increment(string  $key, integer  $offset = 1) : mixed

Performs atomic incrementation of a raw stored value.

Parameters

string $key

Cache ID

integer $offset

Step/value to increase by

Returns

mixed

decrement()

decrement(string  $key, integer  $offset = 1) : mixed

Performs atomic decrementation of a raw stored value.

Parameters

string $key

Cache ID

integer $offset

Step/value to increase by

Returns

mixed

clean()

clean() : mixed

Will delete all items in the entire cache.

Returns

mixed

getCacheInfo()

getCacheInfo() : mixed

Returns information on the entire cache.

The information returned and the structure of the data varies depending on the handler.

Returns

mixed

getMetaData()

getMetaData(string  $key) : mixed

Returns detailed information about the specific item in the cache.

Parameters

string $key

Cache item name.

Returns

mixed

isSupported()

isSupported() : boolean

Determines if the driver is supported on this system.

Returns

boolean