\BaiduMemcachedStore

Storage engine using memcached.

Summary

Methods
Properties
Constants
__construct()
get()
set()
remove()
removeAll()
No public properties found
No constants found
getKeyForStore()
$supportedKeys
$clientId
$memcache
$sessionId
N/A
No private methods found
No private properties found
N/A

Properties

$supportedKeys

$supportedKeys : array

Supported variable key name.

Type

array

$clientId

$clientId

$memcache

$memcache : \Memcache

Memcache instance

Type

\Memcache —

$sessionId

$sessionId : string

Session ID for current user to distinguish with other users.

Type

string

Methods

__construct()

__construct(string  $clientId, \Memcache  $memcache, mixed  $sessionId) : mixed

Parameters

string $clientId
\Memcache $memcache
mixed $sessionId

Returns

mixed —

get()

get(mixed  $key, mixed  $default = false) : \mix

Get the variable value specified by the variable key name for current session user from the storage system.

Parameters

mixed $key

Variable key name

mixed $default

Default value if the key couldn't be found

Returns

\mix —

Returns the value for the specified key if it exists, otherwise return $default value

set()

set(mixed  $key, mixed  $value) : bool

Save the variable item specified by the variable key name into the storage system for current session user.

Parameters

mixed $key

Variable key name

mixed $value

Variable value

Returns

bool —

Returns true if the saving operation is success, otherwise returns false

remove()

remove(mixed  $key) : bool

Remove the stored variable item specified by the variable key name from the storage system for current session user.

Parameters

mixed $key

Variable key name

Returns

bool —

Returns true if remove success, otherwise returns false

removeAll()

removeAll() : bool

Remove all the stored variable items for current session user from the storage system.

Returns

bool —

Returns true if remove success, otherwise returns false

getKeyForStore()

getKeyForStore(mixed  $key) : string

Get the actual key name for current storage engine.

Parameters

mixed $key

The original key name

Returns

string —