PHP Класс Horde_Cache, horde

Автор: Anil Madhavapeddy ([email protected])
Автор: Chuck Hagenbuch ([email protected])
Автор: Michael Slusarz ([email protected])
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_logger Horde_Log_Logger Logger.
$_params array Cache parameters.
$_storage Horde_Cache_Storage Storage object.

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

Метод Описание
__construct ( Horde_Cache_Storage_Base $storage, array $params = [] ) Constructor.
clear ( ) Clears all data from the cache.
exists ( string $key, integer $lifetime = 1 ) : boolean Checks if a given key exists in the cache, valid for the given lifetime.
expire ( string $key ) : boolean Expire any existing data for the given key.
get ( string $key, integer $lifetime = 1 ) : mixed Retrieve cached data.
output ( string $key, integer $lifetime = 1 ) : boolean Attempts to directly output a cached object.
set ( string $key, string $data, integer $lifetime = null ) Store an object in the cache.
testReadWrite ( ) : boolean Tests the driver for read/write access.

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

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

Constructor.
public __construct ( Horde_Cache_Storage_Base $storage, array $params = [] )
$storage Horde_Cache_Storage_Base The storage object.
$params array Parameter array:
  - compress: (boolean) Compress data (if possible)?
              DEFAULT: false
  - lifetime: (integer) Lifetime of data, in seconds.
              DEFAULT: 86400 seconds
  - logger: (Horde_Log_Logger) Log object to use for log/debug messages.

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

Clears all data from the cache.
public clear ( )

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

Checks if a given key exists in the cache, valid for the given lifetime.
public exists ( string $key, integer $lifetime = 1 ) : boolean
$key string Cache key to check.
$lifetime integer Lifetime of the key in seconds.
Результат boolean Existence.

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

Expire any existing data for the given key.
public expire ( string $key ) : boolean
$key string Cache key to expire.
Результат boolean Success or failure.

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

Retrieve cached data.
public get ( string $key, integer $lifetime = 1 ) : mixed
$key string Object ID to query.
$lifetime integer Lifetime of the object in seconds.
Результат mixed Cached data, or false if none was found.

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

Attempts to directly output a cached object.
public output ( string $key, integer $lifetime = 1 ) : boolean
$key string Object ID to query.
$lifetime integer Lifetime of the object in seconds.
Результат boolean True if output or false if no object was found.

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

Store an object in the cache.
public set ( string $key, string $data, integer $lifetime = null )
$key string Object ID used as the caching key.
$data string Data to store in the cache.
$lifetime integer Object lifetime - i.e. the time before the data becomes available for garbage collection, in seconds. If null use the default Horde GC time. If 0 will not be GC'd.

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

Tests the driver for read/write access.
public testReadWrite ( ) : boolean
Результат boolean True if read/write is available.

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

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

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

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

Cache parameters.
protected array $_params
Результат array

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

Storage object.
protected Horde_Cache_Storage $_storage
Результат Horde_Cache_Storage