PHP 클래스 yii\caching\ApcCache

To use this application component, the APC PHP extension must be loaded. Alternatively APCu PHP extension could be used via setting useApcu to true. In order to enable APC or APCu for CLI you should add "apc.enable_cli = 1" to your php.ini. See Cache for common cache operations that ApcCache supports. For more details and usage information on Cache, see the guide article on caching.
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends Cache
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$useApcu whether to use apcu or apc as the underlying caching extension. If true, apcu will be used. If false, apc will be used. Defaults to false.

공개 메소드들

메소드 설명
exists ( mixed $key ) : boolean Checks whether a specified key exists in the cache.
init ( ) Initializes this application component.

보호된 메소드들

메소드 설명
addValue ( string $key, mixed $value, integer $duration ) : boolean Stores a value identified by a key into cache if the cache does not contain this key.
addValues ( array $data, integer $duration ) : array Adds multiple key-value pairs to cache.
deleteValue ( string $key ) : boolean Deletes a value with the specified key from cache This is the implementation of the method declared in the parent class.
flushValues ( ) : boolean Deletes all values from cache.
getValue ( string $key ) : mixed | false Retrieves a value from cache with a specified key.
getValues ( array $keys ) : array Retrieves multiple values from cache with the specified keys.
setValue ( string $key, mixed $value, integer $duration ) : boolean Stores a value identified by a key in cache.
setValues ( array $data, integer $duration ) : array Stores multiple key-value pairs in cache.

메소드 상세

addValue() 보호된 메소드

This is the implementation of the method declared in the parent class.
protected addValue ( string $key, mixed $value, integer $duration ) : boolean
$key string the key identifying the value to be cached
$value mixed the value to be cached. Most often it's a string. If you have disabled [[serializer]], it could be something else.
$duration integer the number of seconds in which the cached value will expire. 0 means never expire.
리턴 boolean true if the value is successfully stored into cache, false otherwise

addValues() 보호된 메소드

Adds multiple key-value pairs to cache.
protected addValues ( array $data, integer $duration ) : array
$data array array where key corresponds to cache key while value is the value stored
$duration integer the number of seconds in which the cached values will expire. 0 means never expire.
리턴 array array of failed keys

deleteValue() 보호된 메소드

Deletes a value with the specified key from cache This is the implementation of the method declared in the parent class.
protected deleteValue ( string $key ) : boolean
$key string the key of the value to be deleted
리턴 boolean if no error happens during deletion

exists() 공개 메소드

This can be faster than getting the value from the cache if the data is big. Note that this method does not check whether the dependency associated with the cached data, if there is any, has changed. So a call to [[get]] may return false while exists returns true.
public exists ( mixed $key ) : boolean
$key mixed a key identifying the cached value. This can be a simple string or a complex data structure consisting of factors representing the key.
리턴 boolean true if a value exists in cache, false if the value is not in the cache or expired.

flushValues() 보호된 메소드

This is the implementation of the method declared in the parent class.
protected flushValues ( ) : boolean
리턴 boolean whether the flush operation was successful.

getValue() 보호된 메소드

This is the implementation of the method declared in the parent class.
protected getValue ( string $key ) : mixed | false
$key string a unique key identifying the cached value
리턴 mixed | false the value stored in cache, false if the value is not in the cache or expired.

getValues() 보호된 메소드

Retrieves multiple values from cache with the specified keys.
protected getValues ( array $keys ) : array
$keys array a list of keys identifying the cached values
리턴 array a list of cached values indexed by the keys

init() 공개 메소드

It checks if extension required is loaded.
public init ( )

setValue() 보호된 메소드

This is the implementation of the method declared in the parent class.
protected setValue ( string $key, mixed $value, integer $duration ) : boolean
$key string the key identifying the value to be cached
$value mixed the value to be cached. Most often it's a string. If you have disabled [[serializer]], it could be something else.
$duration integer the number of seconds in which the cached value will expire. 0 means never expire.
리턴 boolean true if the value is successfully stored into cache, false otherwise.

setValues() 보호된 메소드

Stores multiple key-value pairs in cache.
protected setValues ( array $data, integer $duration ) : array
$data array array where key corresponds to cache key while value
$duration integer the number of seconds in which the cached values will expire. 0 means never expire.
리턴 array array of failed keys

프로퍼티 상세

$useApcu 공개적으로 프로퍼티

whether to use apcu or apc as the underlying caching extension. If true, apcu will be used. If false, apc will be used. Defaults to false.
부터: 2.0.7
public $useApcu