Свойство | Type | Description | |
---|---|---|---|
$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. |
Méthode | Description | |
---|---|---|
exists ( mixed $key ) : boolean | Checks whether a specified key exists in the cache. | |
init ( ) | Initializes this application component. |
Méthode | Description | |
---|---|---|
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. |
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. |
Résultat | boolean | true if the value is successfully stored into cache, false otherwise |
protected deleteValue ( string $key ) : boolean | ||
$key | string | the key of the value to be deleted |
Résultat | boolean | if no error happens during deletion |
protected flushValues ( ) : boolean | ||
Résultat | boolean | whether the flush operation was successful. |
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. |
Résultat | boolean | true if the value is successfully stored into cache, false otherwise. |