PHP 클래스 Horde_Cache, horde

저자: Anil Madhavapeddy ([email protected])
저자: Chuck Hagenbuch ([email protected])
저자: Michael Slusarz ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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