PHP 클래스 Bluz\Cache\Cache

Configuration 'enabled' => true, // Boolean,optional, true by default 'cacheAdapter' => 'redis', // Required if option 'enabled' set to true 'tagAdapter' => 'memcached', // Optional 'settings' => [ 'redis' => [], // Settings for setup Instance of Bluz\Cache\CacheInterface. 'memcached' => [], // Settings for another cache adapter ]
상속: implements Bluz\Cache\CacheInterface, implements Bluz\Cache\TagableInterface, use trait Bluz\Common\Options
파일 보기 프로젝트 열기: bluzphp/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$adapter Instance of cache adapter
$prefix Prefix for cache keys
$tagAdapter Instance of tag adapter
$tagPrefix Prefix for tags

공개 메소드들

메소드 설명
add ( string $id, mixed $data, integer $ttl = Cache::TTL_NO_EXPIRY ) : boolean
addTag ( string $id, string $tag ) : boolean
contains ( string $id ) : boolean
delete ( string $id ) : mixed
deleteByTag ( string $tag ) : boolean
flush ( ) : void
get ( string $id ) : mixed
getAdapter ( string $adapterName = null ) : Bluz\Cache\CacheInterface Get underlying cache adapter
getTagAdapter ( ) : Bluz\Cache\CacheInterface Get underlying tag adapter
set ( string $id, mixed $data, integer $ttl = Cache::TTL_NO_EXPIRY ) : boolean
setPrefix ( string $prefix ) : void Setup prefix for cache records
setTagPrefix ( string $prefix ) : void Setup prefix for cache records of tags

보호된 메소드들

메소드 설명
initAdapter ( string $adapterName ) : Bluz\Cache\CacheInterface Initialize adapter
initOptions ( ) : void Check Cache configuration
prepareId ( string $id ) : string Prepare Id with prefix

메소드 상세

add() 공개 메소드

public add ( string $id, mixed $data, integer $ttl = Cache::TTL_NO_EXPIRY ) : boolean
$id string
$data mixed
$ttl integer
리턴 boolean

addTag() 공개 메소드

public addTag ( string $id, string $tag ) : boolean
$id string
$tag string
리턴 boolean

contains() 공개 메소드

public contains ( string $id ) : boolean
$id string
리턴 boolean

delete() 공개 메소드

public delete ( string $id ) : mixed
$id string
리턴 mixed

deleteByTag() 공개 메소드

public deleteByTag ( string $tag ) : boolean
$tag string
리턴 boolean

flush() 공개 메소드

public flush ( ) : void
리턴 void

get() 공개 메소드

public get ( string $id ) : mixed
$id string
리턴 mixed

getAdapter() 공개 메소드

Get underlying cache adapter
public getAdapter ( string $adapterName = null ) : Bluz\Cache\CacheInterface
$adapterName string
리턴 Bluz\Cache\CacheInterface

getTagAdapter() 공개 메소드

Get underlying tag adapter
public getTagAdapter ( ) : Bluz\Cache\CacheInterface
리턴 Bluz\Cache\CacheInterface

initAdapter() 보호된 메소드

Initialize adapter
protected initAdapter ( string $adapterName ) : Bluz\Cache\CacheInterface
$adapterName string
리턴 Bluz\Cache\CacheInterface

initOptions() 보호된 메소드

Check Cache configuration
protected initOptions ( ) : void
리턴 void

prepareId() 보호된 메소드

Prepare Id with prefix
protected prepareId ( string $id ) : string
$id string
리턴 string

set() 공개 메소드

public set ( string $id, mixed $data, integer $ttl = Cache::TTL_NO_EXPIRY ) : boolean
$id string
$data mixed
$ttl integer
리턴 boolean

setPrefix() 공개 메소드

Setup prefix for cache records
public setPrefix ( string $prefix ) : void
$prefix string
리턴 void

setTagPrefix() 공개 메소드

Setup prefix for cache records of tags
public setTagPrefix ( string $prefix ) : void
$prefix string
리턴 void

프로퍼티 상세

$adapter 보호되어 있는 프로퍼티

Instance of cache adapter
protected $adapter

$prefix 보호되어 있는 프로퍼티

Prefix for cache keys
protected $prefix

$tagAdapter 보호되어 있는 프로퍼티

Instance of tag adapter
protected $tagAdapter

$tagPrefix 보호되어 있는 프로퍼티

Prefix for tags
protected $tagPrefix