PHP Класс 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.
Автор: Matthias Mullie ([email protected])
Наследование: implements MatthiasMullie\Scrapbook\KeyValueStore
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$filesystem League\Flysystem\Filesystem

Открытые методы

Метод Описание
__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 )

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

add() публичный Метод

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

cas() публичный Метод

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

decrement() публичный Метод

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

delete() публичный Метод

public delete ( $key )

deleteMulti() публичный Метод

public deleteMulti ( array $keys )
$keys array

doIncrement() защищенный Метод

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
Результат integer | boolean

exists() защищенный Метод

protected exists ( string $key ) : boolean
$key string
Результат boolean

flush() публичный Метод

public flush ( )

get() публичный Метод

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

getMulti() публичный Метод

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

increment() публичный Метод

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

lock() защищенный Метод

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
Результат boolean

normalizeTime() защищенный Метод

The first case (relative time) will be normalized into a fixed absolute timestamp.
protected normalizeTime ( integer $time ) : integer
$time integer
Результат integer

path() защищенный Метод

protected path ( string $key ) : string
$key string
Результат string

read() защищенный Метод

Fetch stored data from cache file.
protected read ( string $key ) : boolean | array
$key string
Результат boolean | array

replace() публичный Метод

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

set() публичный Метод

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

setMulti() публичный Метод

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

touch() публичный Метод

public touch ( $key, $expire )

unlock() защищенный Метод

Release the lock for a given key.
protected unlock ( string $key ) : boolean
$key string
Результат boolean

wrap() защищенный Метод

Build value, token & expiration time to be stored in cache file.
protected wrap ( string $value, integer $expire ) : string
$value string
$expire integer
Результат string

Описание свойств

$filesystem защищенное свойство

protected Filesystem,League\Flysystem $filesystem
Результат League\Flysystem\Filesystem