HumHub Documentation (unofficial)

FileCache
in package
implements CacheInterface

File cache.

Caches feature into a file.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

Table of Contents

Interfaces

CacheInterface
Parser cache interface.

Properties

$path  : mixed

Methods

__construct()  : mixed
Initializes file cache.
isFresh()  : bool
Checks that cache for feature exists and is fresh.
read()  : FeatureNode
Reads feature cache from path.
write()  : mixed
Caches feature node.
getCachePathFor()  : string
Returns feature cache file path from features path.

Properties

Methods

__construct()

Initializes file cache.

public __construct(string $path) : mixed
Parameters
$path : string

Path to the folder where to store caches.

Tags
throws
CacheException

isFresh()

Checks that cache for feature exists and is fresh.

public isFresh(string $path, int $timestamp) : bool
Parameters
$path : string

Feature path

$timestamp : int

The last time feature was updated

Return values
bool

write()

Caches feature node.

public write(string $path, FeatureNode $feature) : mixed
Parameters
$path : string

Feature path

$feature : FeatureNode

Feature instance

getCachePathFor()

Returns feature cache file path from features path.

protected getCachePathFor(string $path) : string
Parameters
$path : string

Feature path

Return values
string

        
On this page

Search results