Class HTMLPurifier_DefinitionCache
Abstract class representing Definition cache managers that implements useful
common methods and is a factory.
Methods summary
public
|
#
__construct( $name $type )
Parameters
- $type
$name Type of definition objects this instance of the cache will handle.
|
public
|
#
generateKey( Instance $config )
Generates a unique identifier for a particular configuration
Generates a unique identifier for a particular configuration
Parameters
- $config
Instance of HTMLPurifier_Config
|
public
|
#
isOld( $key $key, $config $config )
Tests whether or not a key is old with respect to the configuration's version
and revision number.
Tests whether or not a key is old with respect to the configuration's version
and revision number.
Parameters
- $key
$key Key to test
- $config
$config Instance of HTMLPurifier_Config to test against
|
public
Boolean
|
#
checkDefType( $def $def )
Checks if a definition's type jives with the cache's type
Checks if a definition's type jives with the cache's type
Parameters
- $def
$def Definition object to check
Returns
Boolean true if good, false if not
Note
Throws an error on failure
|
abstract public
|
#
add( $def, $config )
Adds a definition object to the cache
Adds a definition object to the cache
|
abstract public
|
#
set( $def, $config )
Unconditionally saves a definition object to the cache
Unconditionally saves a definition object to the cache
|
abstract public
|
#
replace( $def, $config )
Replace an object in the cache
Replace an object in the cache
|
abstract public
|
#
get( $config )
Retrieves a definition object from the cache
Retrieves a definition object from the cache
|
abstract public
|
#
remove( $config )
Removes a definition object to the cache
Removes a definition object to the cache
|
abstract public
|
#
flush( $config )
Clears all objects from cache
Clears all objects from cache
|
abstract public
|
#
cleanup( $config )
Clears all expired (older version or revision) objects from cache
Clears all expired (older version or revision) objects from cache
Note
Be carefuly implementing this method as flush. Flush must not interfere with
other Definition types, and cleanup() should not be repeatedly called by
userland code.
|
Properties summary
public
|
$type
|
|
|