HumHub Documentation (unofficial)

HTMLPurifier_DefinitionCache
in package

AbstractYes

Abstract class representing Definition cache managers that implements useful common methods and is a factory.

Tags
todo

Create a separate maintenance file advanced users can use to cache their custom HTMLDefinition, which can be loaded via a configuration directive

todo

Implement memcached

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

Methods

__construct()

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

Type of definition objects this instance of the cache will handle.

cleanup()

Clears all expired (older version or revision) objects from cache

public abstract cleanup(HTMLPurifier_Config $config) : mixed
Parameters
$config : HTMLPurifier_Config
Tags
note

Be careful implementing this method as flush. Flush must not interfere with other Definition types, and cleanup() should not be repeatedly called by userland code.

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
bool

        
On this page

Search results