Documentation

Memcache
in package
implements CacheDriver

Memcache-based Cache driver.

Table of Contents

Interfaces

CacheDriver
Cache driver interface.

Constants

TAGS_KEY  : mixed = 'memcache_tags_array'

Properties

$backend  : Memcache
$flags  : int|false
$tags  : array<string|int, mixed>
$tags_changed  : mixed

Methods

__construct()  : mixed
__destruct()  : mixed
delete()  : bool
Delete cache items by id or tag.
deleteExpired()  : void
Deletes all expired cache items.
find()  : array<string|int, mixed>
Find all of the cache ids for a given tag.
get()  : mixed
Get a cache item.
set()  : mixed
Sets a cache item to the given data, tags, and lifetime.

Constants

TAGS_KEY

public mixed TAGS_KEY = 'memcache_tags_array'

Properties

$tags

protected static array<string|int, mixed> $tags

$tags_changed

protected static mixed $tags_changed = FALSE

Methods

__construct()

public __construct() : mixed

__destruct()

public __destruct() : mixed

delete()

Delete cache items by id or tag.

public delete(mixed $id[, mixed $tag = false ]) : bool
Parameters
$id : mixed

true to delete all items

$tag : mixed = false

set true to delete by tag

Return values
bool

deleteExpired()

Deletes all expired cache items.

public deleteExpired() : void

find()

Find all of the cache ids for a given tag.

public find(mixed $tag) : array<string|int, mixed>
Parameters
$tag : mixed
Return values
array<string|int, mixed> —

[ id => data ]

get()

Get a cache item.

public get(mixed $id) : mixed

Return NULL if the cache item is not found.

Parameters
$id : mixed

set()

Sets a cache item to the given data, tags, and lifetime.

public set(mixed $id, mixed $data[, array<string|int, mixed>|null $tags = null ][, mixed $lifetime = 0 ]) : mixed
Parameters
$id : mixed
$data : mixed
$tags : array<string|int, mixed>|null = null
$lifetime : mixed = 0

in seconds

On this page

Search results