Documentation

MemcacheStorage extends BaseStorage
in package

Cache storage on a memcache installation.

Tags
author

Duck duck@obala.net

author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2006-2021 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

deprecated

Use HashTable driver instead.

Table of Contents

$logger  : Horde_Log_Logger|null
Logger.
$memcache  : Horde_Memcache
Memcache object.
$objectcache  : array<string|int, mixed>
Cache results of exists()/get() calls (since we will get the entire object on an exists() call anyway).
$params  : array<string|int, mixed>
Parameters.
__construct()  : mixed
Construct a new Horde_Cache_Memcache object.
__serialize()  : array<string|int, mixed>
__unserialize()  : void
clear()  : mixed
Clears all data from the cache.
exists()  : bool
Checks if a given key exists in the cache, valid for the given lifetime.
expire()  : bool
Expire any existing data for the given key.
get()  : mixed
Retrieve cached data.
serialize()  : string
set()  : mixed
Store an object in the cache.
setLogger()  : void
Set the logging object.
unserialize()  : mixed
_initOb()  : mixed
Do initialization tasks.

Properties

$logger

Logger.

protected Horde_Log_Logger|null $logger

$objectcache

Cache results of exists()/get() calls (since we will get the entire object on an exists() call anyway).

protected array<string|int, mixed> $objectcache = []

$params

Parameters.

protected array<string|int, mixed> $params = []

Methods

__construct()

Construct a new Horde_Cache_Memcache object.

public __construct([array<string|int, mixed> $params = [] ]) : mixed
Parameters
$params : array<string|int, mixed> = []

Parameter array:

  - memcache: (Horde_Memcache) [REQUIRED] A Horde_Memcache object.
  - prefix: (string) The prefix to use for the cache keys.
            DEFAULT: ''
Return values
mixed

__serialize()

public __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__unserialize()

public __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>
Return values
void

clear()

Clears all data from the cache.

public clear() : mixed
Tags
inheritDoc
Return values
mixed

exists()

Checks if a given key exists in the cache, valid for the given lifetime.

public exists(string $key, int $lifetime) : bool
Parameters
$key : string

Cache key to check.

$lifetime : int

Lifetime of the key in seconds.

Tags
inheritDoc
Return values
bool

Existence.

expire()

Expire any existing data for the given key.

public expire(string $key) : bool
Parameters
$key : string

Cache key to expire.

Tags
inheritDoc
Return values
bool

Success or failure.

get()

Retrieve cached data.

public get(string $key, int $lifetime) : mixed
Parameters
$key : string

Object ID to query.

$lifetime : int

Lifetime of the object in seconds.

Tags
inheritDoc
Return values
mixed

Cached data, or false if none was found.

serialize()

public serialize() : string
Return values
string

set()

Store an object in the cache.

public set(string $key, mixed $data, int $lifetime) : mixed
Parameters
$key : string

Object ID used as the caching key.

$data : mixed

Data to store in the cache.

$lifetime : int

Object lifetime - i.e. the time before the data becomes available for garbage collection. If 0 will not be GC'd.

Tags
inheritDoc
Return values
mixed

setLogger()

Set the logging object.

public setLogger(Horde_Log_Logger $logger) : void
Parameters
$logger : Horde_Log_Logger

Log object.

Return values
void

unserialize()

public unserialize(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

_initOb()

Do initialization tasks.

protected _initOb() : mixed
Tags
inheritDoc
Return values
mixed

Search results