PHP Класс Horde_Memcache, horde

memcached website: http://www.danga.com/memcached/
Автор: Jan Schneider ([email protected])
Автор: Michael Slusarz ([email protected])
Автор: Didi Rieder ([email protected])
Наследование: implements Serializable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_locks array Locked keys.
$_logger Horde_Log_Logger Logger instance.
$_memcache Memcache Memcache object.
$_noexist array A list of items known not to exist.
$_params array Memcache defaults.
$_servers array The list of active servers.

Открытые методы

Метод Описание
__construct ( array $params = [] ) Constructor.
_init ( ) Do initialization.
delete ( string $key, integer $timeout ) : boolean Delete a key.
failover ( string $host, integer $port ) Failover method.
flush ( ) Mark all entries on a memcache installation as expired.
get ( mixed $keys ) : mixed Get data associated with a key.
lock ( string $key ) Obtain lock on a key.
replace ( string $key, string $var, $expire ) : boolean Replace the value of a key.
serialize ( ) : string Serialize.
set ( string $key, string $var, $expire ) : boolean Set the value of a key.
shutdown ( ) Shutdown function.
stats ( ) : array Get the statistics output from the current memcache pool.
unlock ( string $key ) Release lock on a key.
unserialize ( string $data ) Unserialize.

Защищенные методы

Метод Описание
_getFlags ( integer $count ) : integer Get flags for memcache call.
_getOSKeyArray ( $key, $length ) : array Returns the key listing of all key IDs for an oversized item.
_key ( string $key ) : string Obtains the md5 sum for a key.
_lockAdd ( string $key ) Small wrapper around Memcache[d]#add().
_set ( string $key, string $var, $expire, $len = null ) : boolean Set the value of a key.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters: - compression: (boolean) Compress data inside memcache? DEFAULT: false - c_threshold: (integer) The minimum value length before attempting to compress. DEFAULT: none - hostspec: (array) The memcached host(s) to connect to. DEFAULT: 'localhost' - large_items: (boolean) Allow storing large data items (larger than Horde_Memcache::MAX_SIZE)? Currently not supported with memcached extension. DEFAULT: true - persistent: (boolean) Use persistent DB connections? DEFAULT: false - prefix: (string) The prefix to use for the memcache keys. DEFAULT: 'horde' - port: (array) The port(s) memcache is listening on. Leave empty if using UNIX sockets. DEFAULT: 11211 - weight: (array) The weight(s) to use for each memcached host. DEFAULT: none (equal weight to all servers)

_getFlags() защищенный Метод

Get flags for memcache call.
protected _getFlags ( integer $count ) : integer
$count integer
Результат integer

_getOSKeyArray() защищенный Метод

Returns the key listing of all key IDs for an oversized item.
protected _getOSKeyArray ( $key, $length ) : array
Результат array The array of key IDs.

_init() публичный Метод

Do initialization.
public _init ( )

_key() защищенный Метод

Obtains the md5 sum for a key.
protected _key ( string $key ) : string
$key string The key.
Результат string The corresponding memcache key.

_lockAdd() защищенный Метод

Small wrapper around Memcache[d]#add().
protected _lockAdd ( string $key )
$key string The key to lock.

_set() защищенный Метод

Set the value of a key.
protected _set ( string $key, string $var, $expire, $len = null ) : boolean
$key string The key.
$var string The data to store (serialized).
Результат boolean True on success.

delete() публичный Метод

Delete a key.
См. также: Memcache::delete()
public delete ( string $key, integer $timeout ) : boolean
$key string The key.
$timeout integer Expiration time in seconds.
Результат boolean True on success.

failover() публичный Метод

Failover method.
См. также: Memcache::addServer()
public failover ( string $host, integer $port )
$host string Hostname.
$port integer Port.

flush() публичный Метод

Mark all entries on a memcache installation as expired.
public flush ( )

get() публичный Метод

Get data associated with a key.
См. также: Memcache::get()
public get ( mixed $keys ) : mixed
$keys mixed The key or an array of keys.
Результат mixed The string/array on success (return type is the type of $keys), false on failure.

lock() публичный Метод

Obtain lock on a key.
public lock ( string $key )
$key string The key to lock.

replace() публичный Метод

Replace the value of a key.
См. также: Memcache::replace()
public replace ( string $key, string $var, $expire ) : boolean
$key string The key.
$var string The data to store.
Результат boolean True on success, false if key doesn't exist.

serialize() публичный Метод

Serialize.
public serialize ( ) : string
Результат string Serialized representation of this object.

set() публичный Метод

Set the value of a key.
См. также: Memcache::set()
public set ( string $key, string $var, $expire ) : boolean
$key string The key.
$var string The data to store.
Результат boolean True on success.

shutdown() публичный Метод

Shutdown function.
public shutdown ( )

stats() публичный Метод

Get the statistics output from the current memcache pool.
public stats ( ) : array
Результат array The output from Memcache::getExtendedStats() using the current configuration values.

unlock() публичный Метод

Release lock on a key.
public unlock ( string $key )
$key string The key to lock.

unserialize() публичный Метод

Unserialize.
public unserialize ( string $data )
$data string Serialized data.

Описание свойств

$_locks защищенное свойство

Locked keys.
protected array $_locks
Результат array

$_logger защищенное свойство

Logger instance.
protected Horde_Log_Logger $_logger
Результат Horde_Log_Logger

$_memcache защищенное свойство

Memcache object.
protected Memcache $_memcache
Результат Memcache

$_noexist защищенное свойство

A list of items known not to exist.
protected array $_noexist
Результат array

$_params защищенное свойство

Memcache defaults.
protected array $_params
Результат array

$_servers защищенное свойство

The list of active servers.
protected array $_servers
Результат array