class MemcachedStorage implements Storage, BulkReader, BulkWriter

Memcached storage using memcached extension.

Constants

private internal MetaCallbacks

private internal MetaData

private internal MetaDelta

Methods

static bool
isAvailable()

No description

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

No description

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

Adds a Memcached server to the connection pool.

Memcached
getConnection()

No description

mixed
read(string $key)

Reads item from the cache. Returns null if the item does not exist or has expired.

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, mixed $data, array $dp)

Writes item into the cache.

void
bulkWrite(array $items, array $dp)

Writes to cache in bulk.

void
remove(string $key)

Removes item from the cache.

void
bulkRemove(array $keys)

Removes multiple items from cache.

void
clean(array $conditions)

Removes items from the cache by conditions.

Details

at line 29
static bool isAvailable()

No description

Return Value

bool

at line 35
__construct(string $host = 'localhost', int $port = 11211, string $prefix = '', Journal|null $journal = null)

No description

Parameters

string $host
int $port
string $prefix
Journal|null $journal

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

Adds a Memcached server to the connection pool.

Parameters

string $host
int $port

Return Value

void

at line 63
Memcached getConnection()

No description

Return Value

Memcached

at line 69
mixed read(string $key)

Reads item from the cache. Returns null if the item does not exist or has expired.

Parameters

string $key

Return Value

mixed

at line 98
array bulkRead(array $keys)

Reads from cache in bulk.

Parameters

array $keys

Return Value

array

key => value pairs, missing items are omitted

at line 125
void lock(string $key)

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

Parameters

string $key

Return Value

void

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

Writes item into the cache.

Parameters

string $key
mixed $data
array $dp

Return Value

void

at line 165
void bulkWrite(array $items, array $dp)

Writes to cache in bulk.

Parameters

array $items
array $dp

Return Value

void

at line 201
void remove(string $key)

Removes item from the cache.

Parameters

string $key

Return Value

void

at line 207
void bulkRemove(array $keys)

Removes multiple items from cache.

Parameters

array $keys

Return Value

void

at line 213
void clean(array $conditions)

Removes items from the cache by conditions.

Parameters

array $conditions

Return Value

void