class MemcacheContainer (View source)

Remove direct interaction with Memcache object for ease of mocking in tests.

Methods

__construct()

Initialises a Memcache instance

bool
close()

Closes the Memcache instance.

string
get(string $key)

Finds the value associated with input key, from Memcache.

bool
set(string $key, string $value, int $expire)

Inserts a key value pair, with expiry time, into Memcache.

bool
delete(string $key)

Removes the key value pair, keyed with the input variable.

Details

__construct()

Initialises a Memcache instance

bool close()

Closes the Memcache instance.

Return Value

bool true if successful, false otherwise

string get(string $key)

Finds the value associated with input key, from Memcache.

Parameters

string $key Input key from which to find value

Return Value

string value associated with input key

bool set(string $key, string $value, int $expire)

Inserts a key value pair, with expiry time, into Memcache.

Parameters

string $key Input key to associate with the value
string $value Input value to be stored
int $expire Time until the pair can be garbage collected

Return Value

bool true if successful, false otherwise

bool delete(string $key)

Removes the key value pair, keyed with the input variable.

Parameters

string $key Input key to remove key value pair

Return Value

bool true if successful, false otherwise