Jet\Cache_Files

A generic (abstract and not used by itself) backend cache that uses files to store data.

Method Importance
abstract public isActive(
) : bool
An abstract method that the backend must implement, which indicates whether the backend is active - whether it is functional and available for use.
protected getDataFilePath(
string $entity
) : string
Returns the path to the generic data file.

Uses the system configuration SysConf_Path::getCache()
protected readData(
string $entity
) : array|null
Read the generic data from the file. Returns null if the file does not exist or is not readable.
protected writeData(
string $entity,
array $data
) : void
Writes the generic data to the file.
protected getHtmlFilePath(
string $key
) : string
Returns the path to the file, which will contain HTML and not general data.

Uses the system configuration SysConf_Path::getCache()
protected readHtml(
string $key
) : string|null
Read HTML from the file. If the file does not exist or is not readable, it returns null.
protected writeHtml(
string $key,
string $html
) : void
Writes HTML to the file.
public resetDataFiles(
string $prefix
) : void
Removes generic data files whose name begins with the given prefix.
public resetDataFile(
string $key
) : void
Removes one specific record - one specific generic data file.
public resetHtmlFiles(
string $prefix
) : void
Removes HTML files whose name begins with the given prefix.
public resetHtmlFile(
string $key
) : void
Removes one specific record - one specific HTML file.
Previous chapter
Cache - Jet\Cache
Next chapter
Jet\Cache_Redis