PHP Class MatthiasMullie\Scrapbook\Adapters\Redis

Author: Matthias Mullie ([email protected])
Inheritance: implements MatthiasMullie\Scrapbook\KeyValueStore
Afficher le fichier Open project: matthiasmullie/scrapbook Class Usage Examples

Protected Properties

Свойство Type Description
$client Redis
$version string | null

Méthodes publiques

Méthode Description
__construct ( Redis $client )
add ( $key, $value, $expire )
cas ( $token, $key, $value, $expire )
decrement ( $key, $offset = 1, $initial, $expire )
delete ( $key )
deleteMulti ( array $keys )
flush ( )
get ( $key, &$token = null )
getMulti ( array $keys, array &$tokens = null )
increment ( $key, $offset = 1, $initial, $expire )
replace ( $key, $value, $expire )
set ( $key, $value, $expire )
setMulti ( array $items, $expire )
touch ( $key, $expire )

Méthodes protégées

Méthode Description
doIncrement ( string $key, integer $offset, integer $initial, integer $expire ) : integer | boolean Shared between increment/decrement: both have mostly the same logic (decrement just increments a negative value), but need their validation & use of non-ttl native methods split up.
getVersion ( ) : string Returns the version of the Redis server we're connecting to.
supportsOptionsArray ( ) : boolean Version-based check to test if passing an options array to set() is supported.
ttl ( integer $expire ) : integer | null Redis expects true TTL, not expiration timestamp.

Method Details

__construct() public méthode

public __construct ( Redis $client )
$client Redis

add() public méthode

public add ( $key, $value, $expire )

cas() public méthode

public cas ( $token, $key, $value, $expire )

decrement() public méthode

public decrement ( $key, $offset = 1, $initial, $expire )

delete() public méthode

public delete ( $key )

deleteMulti() public méthode

public deleteMulti ( array $keys )
$keys array

doIncrement() protected méthode

Shared between increment/decrement: both have mostly the same logic (decrement just increments a negative value), but need their validation & use of non-ttl native methods split up.
protected doIncrement ( string $key, integer $offset, integer $initial, integer $expire ) : integer | boolean
$key string
$offset integer
$initial integer
$expire integer
Résultat integer | boolean

flush() public méthode

public flush ( )

get() public méthode

public get ( $key, &$token = null )

getMulti() public méthode

public getMulti ( array $keys, array &$tokens = null )
$keys array
$tokens array

getVersion() protected méthode

Returns the version of the Redis server we're connecting to.
protected getVersion ( ) : string
Résultat string

increment() public méthode

public increment ( $key, $offset = 1, $initial, $expire )

replace() public méthode

public replace ( $key, $value, $expire )

set() public méthode

public set ( $key, $value, $expire )

setMulti() public méthode

public setMulti ( array $items, $expire )
$items array

supportsOptionsArray() protected méthode

Version-based check to test if passing an options array to set() is supported.
protected supportsOptionsArray ( ) : boolean
Résultat boolean

touch() public méthode

public touch ( $key, $expire )

ttl() protected méthode

Redis expects true TTL, not expiration timestamp.
protected ttl ( integer $expire ) : integer | null
$expire integer
Résultat integer | null TTL in seconds, or `null` for no expiration

Property Details

$client protected_oe property

protected Redis,MatthiasMullie\Scrapbook\Adapters $client
Résultat Redis

$version protected_oe property

protected string|null $version
Résultat string | null