class FileStorage extends Object implements IStorage

Cache file storage.

Constants

internal META_HEADER_LEN

internal META_TIME

internal META_SERIALIZED

internal META_EXPIRE

internal META_DELTA

internal META_ITEMS

internal META_CALLBACKS

FILE

additional cache structure

HANDLE

additional cache structure

Properties

static float $gcProbability
static bool $useDirectories

Methods

__construct($dir, IJournal $journal = NULL)

No description

mixed|null
read($key)

Read from cache.

void
lock($key)

Prevents item reading and writing. Lock is released by write() or remove().

void
write($key, $data, array $dp)

Writes item into the cache.

void
remove($key)

Removes item from the cache.

void
clean(array $conditions)

Removes items from the cache by conditions & garbage collector.

array|null
readMetaAndLock($file, $lock)

Reads cache data from disk.

mixed
readData($meta)

Reads cache data from disk and closes cache file handle.

string
getCacheFile($key)

Returns file name.

Details

at line 64
__construct($dir, IJournal $journal = NULL)

No description

Parameters

$dir
IJournal $journal

at line 85
mixed|null read($key)

Read from cache.

Parameters

$key

Return Value

mixed|null

at line 142
void lock($key)

Prevents item reading and writing. Lock is released by write() or remove().

Parameters

$key

Return Value

void

at line 163
void write($key, $data, array $dp)

Writes item into the cache.

Parameters

$key
$data
array $dp

Return Value

void

at line 248
void remove($key)

Removes item from the cache.

Parameters

$key

Return Value

void

at line 260
void clean(array $conditions)

Removes items from the cache by conditions & garbage collector.

Parameters

array $conditions

Return Value

void

at line 316
protected array|null readMetaAndLock($file, $lock)

Reads cache data from disk.

Parameters

$file
$lock

Return Value

array|null

at line 348
protected mixed readData($meta)

Reads cache data from disk and closes cache file handle.

Parameters

$meta

Return Value

mixed

at line 367
protected string getCacheFile($key)

Returns file name.

Parameters

$key

Return Value

string