HTMLPurifier_DefinitionCache
in package
Abstract class representing Definition cache managers that implements useful common methods and is a factory.
Tags
Table of Contents
Properties
- $type : mixed
Methods
- __construct() : mixed
- add() : mixed
- Adds a definition object to the cache
- checkDefType() : bool
- Checks if a definition's type jives with the cache's type
- cleanup() : mixed
- Clears all expired (older version or revision) objects from cache
- flush() : mixed
- Clears all objects from cache
- generateKey() : string
- Generates a unique identifier for a particular configuration
- get() : mixed
- Retrieves a definition object from the cache
- isOld() : bool
- Tests whether or not a key is old with respect to the configuration's version and revision number.
- remove() : mixed
- Removes a definition object to the cache
- replace() : mixed
- Replace an object in the cache
- set() : mixed
- Unconditionally saves a definition object to the cache
Properties
$type
public
mixed
$type
Tags
Methods
__construct()
public
__construct(string $type) : mixed
Parameters
- $type : string
-
Type of definition objects this instance of the cache will handle.
add()
Adds a definition object to the cache
public
abstract add(HTMLPurifier_Definition $def, HTMLPurifier_Config $config) : mixed
Parameters
- $def : HTMLPurifier_Definition
- $config : HTMLPurifier_Config
checkDefType()
Checks if a definition's type jives with the cache's type
public
checkDefType(HTMLPurifier_Definition $def) : bool
Parameters
- $def : HTMLPurifier_Definition
-
Definition object to check
Tags
Return values
bool —true if good, false if not
cleanup()
Clears all expired (older version or revision) objects from cache
public
abstract cleanup(HTMLPurifier_Config $config) : mixed
Parameters
- $config : HTMLPurifier_Config
Tags
flush()
Clears all objects from cache
public
abstract flush(HTMLPurifier_Config $config) : mixed
Parameters
- $config : HTMLPurifier_Config
generateKey()
Generates a unique identifier for a particular configuration
public
generateKey(HTMLPurifier_Config $config) : string
Parameters
- $config : HTMLPurifier_Config
-
Instance of HTMLPurifier_Config
Return values
stringget()
Retrieves a definition object from the cache
public
abstract get(HTMLPurifier_Config $config) : mixed
Parameters
- $config : HTMLPurifier_Config
isOld()
Tests whether or not a key is old with respect to the configuration's version and revision number.
public
isOld(string $key, HTMLPurifier_Config $config) : bool
Parameters
- $key : string
-
Key to test
- $config : HTMLPurifier_Config
-
Instance of HTMLPurifier_Config to test against
Return values
boolremove()
Removes a definition object to the cache
public
abstract remove(HTMLPurifier_Config $config) : mixed
Parameters
- $config : HTMLPurifier_Config
replace()
Replace an object in the cache
public
abstract replace(HTMLPurifier_Definition $def, HTMLPurifier_Config $config) : mixed
Parameters
- $def : HTMLPurifier_Definition
- $config : HTMLPurifier_Config
set()
Unconditionally saves a definition object to the cache
public
abstract set(HTMLPurifier_Definition $def, HTMLPurifier_Config $config) : mixed
Parameters
- $def : HTMLPurifier_Definition
- $config : HTMLPurifier_Config