class MemcachedStorage implements IStorage, IBulkReader

Memcached storage using memcached extension.

Traits

Strict class for better experience.

Constants

META_CALLBACKS

META_DATA

META_DELTA

Methods

static bool
isAvailable()

Checks if Memcached extension is available.

__construct(string $host = 'localhost', int $port = 11211, string $prefix = '', IJournal $journal = null)

No description

void
addServer(string $host = 'localhost', int $port = 11211)

No description

Memcached
getConnection()

No description

mixed
read(string $key)

Read from cache.

array
bulkRead(array $keys)

Reads from cache in bulk.

void
lock(string $key)

Prevents item reading and writing. Lock is released by write() or remove().

void
write(string $key, $data, array $dp)

Writes item into the cache.

void
remove(string $key)

Removes item from the cache.

void
clean(array $conditions)

Removes items from the cache by conditions.

Details

at line 42
static bool isAvailable()

Checks if Memcached extension is available.

Return Value

bool

at line 48
__construct(string $host = 'localhost', int $port = 11211, string $prefix = '', IJournal $journal = null)

Parameters

string $host
int $port
string $prefix
IJournal $journal

at line 63
void addServer(string $host = 'localhost', int $port = 11211)

Parameters

string $host
int $port

Return Value

void

at line 72
Memcached getConnection()

Return Value

Memcached

at line 78
mixed read(string $key)

Read from cache.

Parameters

string $key

Return Value

mixed

at line 107
array bulkRead(array $keys)

Reads from cache in bulk.

Parameters

array $keys

Return Value

array key => value pairs, missing items are omitted

at line 135
void lock(string $key)

Prevents item reading and writing. Lock is released by write() or remove().

Parameters

string $key

Return Value

void

at line 140
void write(string $key, $data, array $dp)

Writes item into the cache.

Parameters

string $key
$data
array $dp

Return Value

void

at line 174
void remove(string $key)

Removes item from the cache.

Parameters

string $key

Return Value

void

at line 180
void clean(array $conditions)

Removes items from the cache by conditions.

Parameters

array $conditions

Return Value

void