메소드 | 설명 | |
---|---|---|
acquireKey ( string $key, &$autoUnlocker ) : boolean | Try to lock key, and if key is already locked - wait, until key will be unlocked. | |
add ( string $key, mixed $value, integer $ttl = 600, array | string $tags = null ) : boolean | Save a value into memory only if it DOESN'T exists (or false will be returned). | |
delete ( string | array $key ) : boolean | array | Delete key or array of keys from storage. | |
deleteByTags ( array | string $tag ) : boolean | Delete keys by tags. | |
deleteOld ( ) : boolean | Delete expired cache values. | |
increment ( string $key, mixed $byValue = 1, integer $limitKeysCount, integer $ttl = 259200 ) : integer | string | array | Increment value of the key. | |
lockKey ( mixed $key, mixed &$autoUnlockerVariable ) | Get exclusive mutex for key. Key will be still accessible to read and write, but another process can exclude dog-pile effect, if before updating the key he will try to get this mutex. | |
read ( string | array $key, mixed &$ttlLeft ) : mixed | Get the cache data for the given $key. | |
save ( string $key, mixed $value, integer $ttl = 600, array | string $tags = null ) : boolean | Save a value into memory. | |
selectByCallback ( callable $callback, boolean $getArray = false ) : mixed | Select from storage via callback function. |
public acquireKey ( string $key, &$autoUnlocker ) : boolean | ||
$key | string | Name of the cache key. |
$autoUnlocker | ||
리턴 | boolean |
public add ( string $key, mixed $value, integer $ttl = 600, array | string $tags = null ) : boolean | ||
$key | string | Name of the key. |
$value | mixed | Value you wish to save. |
$ttl | integer | For how long to store value. (in seconds) |
$tags | array | string | Tags you wish to assign to this cache entry. |
리턴 | boolean | True if value was added, otherwise false. |
public increment ( string $key, mixed $byValue = 1, integer $limitKeysCount, integer $ttl = 259200 ) : integer | string | array | ||
$key | string | Name of the cache key. |
$byValue | mixed | If stored value is an array: - If $by_value is a value in array, new element will be pushed to the end of array, - If $by_value is a key=>value array, new key=>value pair will be added (or updated). |
$limitKeysCount | integer | Maximum count of elements (used only if stored value is array). |
$ttl | integer | Set time to live for key. |
리턴 | integer | string | array | New key value. |
public save ( string $key, mixed $value, integer $ttl = 600, array | string $tags = null ) : boolean | ||
$key | string | Name of the key. |
$value | mixed | Value you wish to save. |
$ttl | integer | For how long to store value. (in seconds) |
$tags | array | string | Tags you wish to assign to this cache entry. |
리턴 | boolean | True if value was stored successfully, otherwise false. |