Method | Description | |
---|---|---|
add ( string $key, mixed $value, integer $expire ) : boolean | Adds an item under new key. | |
cas ( mixed $token, string $key, mixed $value, integer $expire ) : boolean | Replaces an item in 1 atomic operation, to ensure it didn't change since it was originally read, when the CAS token was issued. | |
decrement ( string $key, integer $offset = 1, integer $initial, integer $expire ) : integer | boolean | Decrements a counter value, or sets an initial value if it does not yet exist. | |
delete ( string $key ) : boolean | Deletes an item from the cache. | |
deleteMulti ( array $keys ) : bool[] | Deletes multiple items at once (reduced network traffic compared to individual operations). | |
flush ( ) : boolean | Clears the entire cache. | |
get ( string $key, mixed &$token = null ) : mixed | boolean | Retrieves an item from the cache. | |
getMulti ( array $keys, array &$tokens = null ) : mixed[] | Retrieves multiple items at once. | |
increment ( string $key, integer $offset = 1, integer $initial, integer $expire ) : integer | boolean | Increments a counter value, or sets an initial value if it does not yet exist. | |
replace ( string $key, mixed $value, integer $expire ) : boolean | Replaces an item. | |
set ( string $key, mixed $value, integer $expire ) : boolean | Stores a value, regardless of whether or not the key already exists (in which case it will overwrite the existing value for that key). | |
setMulti ( array $items, integer $expire ) : bool[] | Store multiple values at once. | |
touch ( string $key, integer $expire ) : boolean | Updates an item's expiration time without altering the stored value. |
public add ( string $key, mixed $value, integer $expire ) : boolean | ||
$key | string | |
$value | mixed | |
$expire | integer | Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp |
return | boolean |
public cas ( mixed $token, string $key, mixed $value, integer $expire ) : boolean | ||
$token | mixed | Token received from get() or getMulti() |
$key | string | |
$value | mixed | |
$expire | integer | Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp |
return | boolean |
public decrement ( string $key, integer $offset = 1, integer $initial, integer $expire ) : integer | boolean | ||
$key | string | |
$offset | integer | Value to decrement with |
$initial | integer | Initial value (if item doesn't yet exist) |
$expire | integer | Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp |
return | integer | boolean | New value or false on failure |
public deleteMulti ( array $keys ) : bool[] | ||
$keys | array | |
return | bool[] |
public increment ( string $key, integer $offset = 1, integer $initial, integer $expire ) : integer | boolean | ||
$key | string | |
$offset | integer | Value to increment with |
$initial | integer | Initial value (if item doesn't yet exist) |
$expire | integer | Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp |
return | integer | boolean | New value or false on failure |
public replace ( string $key, mixed $value, integer $expire ) : boolean | ||
$key | string | |
$value | mixed | |
$expire | integer | Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp |
return | boolean |
public set ( string $key, mixed $value, integer $expire ) : boolean | ||
$key | string | |
$value | mixed | |
$expire | integer | Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp |
return | boolean |