PHP Class MatthiasMullie\Scrapbook\Adapters\Flysystem

Flysystem doesn't allow locking files, though. To guarantee interference from other processes, we'll create separate lock-files to flag a cache key in use.
Author: Matthias Mullie ([email protected])
Inheritance: implements MatthiasMullie\Scrapbook\KeyValueStore
Afficher le fichier Open project: matthiasmullie/scrapbook

Protected Properties

Свойство Type Description
$filesystem League\Flysystem\Filesystem

Méthodes publiques

Méthode Description
__construct ( League\Flysystem\Filesystem $filesystem )
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 split up (increment won't accept negative values).
exists ( string $key ) : boolean
lock ( string $key ) : boolean Obtain a lock for a given key.
normalizeTime ( integer $time ) : integer Times can be: * relative (in seconds) to current time, within 30 days * absolute unix timestamp * 0, for infinity.
path ( string $key ) : string
read ( string $key ) : boolean | array Fetch stored data from cache file.
unlock ( string $key ) : boolean Release the lock for a given key.
wrap ( string $value, integer $expire ) : string Build value, token & expiration time to be stored in cache file.

Method Details

__construct() public méthode

public __construct ( League\Flysystem\Filesystem $filesystem )
$filesystem League\Flysystem\Filesystem

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 split up (increment won't accept negative values).
protected doIncrement ( string $key, integer $offset, integer $initial, integer $expire ) : integer | boolean
$key string
$offset integer
$initial integer
$expire integer
Résultat integer | boolean

exists() protected méthode

protected exists ( string $key ) : boolean
$key string
Résultat 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

increment() public méthode

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

lock() protected méthode

It'll try to get a lock for a couple of times, but ultimately give up if no lock can be obtained in a reasonable time.
protected lock ( string $key ) : boolean
$key string
Résultat boolean

normalizeTime() protected méthode

The first case (relative time) will be normalized into a fixed absolute timestamp.
protected normalizeTime ( integer $time ) : integer
$time integer
Résultat integer

path() protected méthode

protected path ( string $key ) : string
$key string
Résultat string

read() protected méthode

Fetch stored data from cache file.
protected read ( string $key ) : boolean | array
$key string
Résultat boolean | array

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

touch() public méthode

public touch ( $key, $expire )

unlock() protected méthode

Release the lock for a given key.
protected unlock ( string $key ) : boolean
$key string
Résultat boolean

wrap() protected méthode

Build value, token & expiration time to be stored in cache file.
protected wrap ( string $value, integer $expire ) : string
$value string
$expire integer
Résultat string

Property Details

$filesystem protected_oe property

protected Filesystem,League\Flysystem $filesystem
Résultat League\Flysystem\Filesystem