Documentation

MemcachedDriver extends AbstractDriver
in package

Memcached cache backend

Table of Contents

__construct()  : mixed
Driver for PHP Memcache extension
__destruct()  : mixed
Disconnect from memcached server
delete()  : bool
Remove an item from the cache
deleteMultiple()  : bool
Remove multiple items from the cache
exists()  : bool
See if a key currently exists in the cache
expiresAt()  : bool
Set the specified key to expire at the given time
flush()  : bool
Empty the cache
get()  : mixed
Get the value for the selected cache key
getMultiple()  : array<string|int, mixed>
Retrieve a set of values by their cache key
set()  : bool
Set a cached value
setLogger()  : void
Set a logger to keep track of errors
setMultiple()  : bool
Set multiple cache values

Methods

__construct()

Driver for PHP Memcache extension

public __construct([array<string|int, mixed> $config = ['host' => '127.0.0.1', 'port' => '11211'] ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$config : array<string|int, mixed> = ['host' => '127.0.0.1', 'port' => '11211']
$options : array<string|int, mixed> = []
Tags
codeCoverageIgnore
throws
CacheException
Return values
mixed

__destruct()

Disconnect from memcached server

public __destruct() : mixed
Tags
codeCoverageIgnore
Return values
mixed

delete()

Remove an item from the cache

public delete(string $key) : bool
Parameters
$key : string
Return values
bool

deleteMultiple()

Remove multiple items from the cache

public deleteMultiple([array<string|int, string> $keys = [] ]) : bool
Parameters
$keys : array<string|int, string> = []
Return values
bool

exists()

See if a key currently exists in the cache

public exists(string $key) : bool
Parameters
$key : string
Return values
bool

expiresAt()

Set the specified key to expire at the given time

public expiresAt(string $key, int $expires) : bool
Parameters
$key : string
$expires : int
Return values
bool

flush()

Empty the cache

public flush() : bool
Return values
bool

get()

Get the value for the selected cache key

public get(string $key) : mixed
Parameters
$key : string
Return values
mixed

getMultiple()

Retrieve a set of values by their cache key

public getMultiple([array<string|int, string> $keys = [] ]) : array<string|int, mixed>
Parameters
$keys : array<string|int, string> = []
Return values
array<string|int, mixed>

set()

Set a cached value

public set(string $key, mixed $value[, int|DateInterval|null $expires = NULL ]) : bool
Parameters
$key : string
$value : mixed
$expires : int|DateInterval|null = NULL
Tags
throws
InvalidArgumentException
Return values
bool

setLogger()

Set a logger to keep track of errors

public setLogger(LoggerInterface $logger) : void
Parameters
$logger : LoggerInterface
Return values
void

setMultiple()

Set multiple cache values

public setMultiple(array<string|int, mixed> $items[, DateInterval|int|null $expires = NULL ]) : bool
Parameters
$items : array<string|int, mixed>
$expires : DateInterval|int|null = NULL
Return values
bool

        

Search results