vB_Memcache
in package
Uses
vB_Trait_NoSerialize
This implements an object wrapper for Memcache
Table of Contents
- $config : array<string|int, mixed>
- Contains the config variables loaded from the config file
- $defaultExpiration : mixed
- $instance : vB_Memcached
- A reference to the singleton instance
- $memcached : mixed
- The Memcache object (can be either Memcache or Memcached)
- $memcached_connected : bool
- To verify a connection is still active
- __serialize() : mixed
- __sleep() : mixed
- __unserialize() : mixed
- __wakeup() : mixed
- add() : bool
- Add an item under a new key
- close() : bool
- Close any memcache open connections
- connect() : int
- Connect Wrapper for Memcache
- delete() : bool
- Delete an item
- flush() : bool
- Invalidate all items in the cache
- get() : mixed
- Retrieve an item
- instance() : mixed
- set() : bool
- Store an item
- setConfig() : mixed
- __construct() : mixed
- addServers() : mixed
Properties
$config
Contains the config variables loaded from the config file
protected
array<string|int, mixed>
$config
=
ull
$defaultExpiration
protected
mixed
$defaultExpiration
$instance
A reference to the singleton instance
protected
static vB_Memcached
$instance
$memcached
The Memcache object (can be either Memcache or Memcached)
protected
mixed
$memcached
=
ull
$memcached_connected
To verify a connection is still active
protected
bool
$memcached_connected
= alse
Methods
__serialize()
public
__serialize() : mixed
Return values
mixed —__sleep()
public
__sleep() : mixed
Return values
mixed —__unserialize()
public
__unserialize(mixed $serialized) : mixed
Parameters
- $serialized : mixed
Return values
mixed —__wakeup()
public
__wakeup() : mixed
Return values
mixed —add()
Add an item under a new key
public
add(string $key, mixed $value[, mixed $expiration = NULL ]) : bool
Parameters
- $key : string
- $value : mixed
- $expiration : mixed = NULL
Return values
bool —close()
Close any memcache open connections
public
close() : bool
Return values
bool —Whether closing connection was success or failure.
connect()
Connect Wrapper for Memcache
public
connect() : int
Return values
int —When a new connection is made 1 is returned, 2 if a connection already existed, 3 if problems on adding server
delete()
Delete an item
public
delete(string $key) : bool
Parameters
- $key : string
Return values
bool —flush()
Invalidate all items in the cache
public
flush() : bool
Return values
bool —get()
Retrieve an item
public
get(mixed $keys) : mixed
Parameters
- $keys : mixed
Return values
mixed —instance()
public
static instance() : mixed
Return values
mixed —set()
Store an item
public
set(string $key, mixed $value[, $expiration = NULL ]) : bool
Parameters
Return values
bool —setConfig()
public
setConfig(mixed &$config) : mixed
Parameters
- $config : mixed
Return values
mixed —__construct()
protected
__construct() : mixed
Return values
mixed —addServers()
protected
addServers() : mixed