Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
HTMLPurifier_DefinitionCache Class Reference
Inheritance diagram for HTMLPurifier_DefinitionCache:
HTMLPurifier_DefinitionCache_Decorator HTMLPurifier_DefinitionCache_Null HTMLPurifier_DefinitionCache_Serializer HTMLPurifier_DefinitionCache_Decorator_Cleanup HTMLPurifier_DefinitionCache_Decorator_Memory

Public Member Functions

 __construct ($type)
 
 add ($def, $config)
 Adds a definition object to the cache.
 
 checkDefType ($def)
 Checks if a definition's type jives with the cache's type.
 
 cleanup ($config)
 Clears all expired (older version or revision) objects from cache.
 
 flush ($config)
 Clears all objects from cache.
 
 generateKey ($config)
 Generates a unique identifier for a particular configuration.
 
 get ($config)
 Retrieves a definition object from the cache.
 
 isOld ($key, $config)
 Tests whether or not a key is old with respect to the configuration's version and revision number.
 
 remove ($config)
 Removes a definition object to the cache.
 
 replace ($def, $config)
 Replace an object in the cache.
 
 set ($def, $config)
 Unconditionally saves a definition object to the cache.
 

Public Attributes

 $type
 @type string
 

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_DefinitionCache::__construct ( $type)
Parameters
string$typeType of definition objects this instance of the cache will handle.

Member Function Documentation

◆ add()

◆ checkDefType()

HTMLPurifier_DefinitionCache::checkDefType ( $def)

Checks if a definition's type jives with the cache's type.

Note
Throws an error on failure
Parameters
HTMLPurifier_Definition$defDefinition object to check
Return values
booltrue if good, false if not

◆ cleanup()

HTMLPurifier_DefinitionCache::cleanup ( $config)
abstract

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

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.
Parameters
HTMLPurifier_Config$config

Reimplemented in HTMLPurifier_DefinitionCache_Decorator, HTMLPurifier_DefinitionCache_Null, and HTMLPurifier_DefinitionCache_Serializer.

◆ flush()

HTMLPurifier_DefinitionCache::flush ( $config)
abstract

◆ generateKey()

HTMLPurifier_DefinitionCache::generateKey ( $config)

Generates a unique identifier for a particular configuration.

Parameters
HTMLPurifier_Config$configInstance of HTMLPurifier_Config
Return values
string

◆ get()

HTMLPurifier_DefinitionCache::get ( $config)
abstract

◆ isOld()

HTMLPurifier_DefinitionCache::isOld ( $key,
$config )

Tests whether or not a key is old with respect to the configuration's version and revision number.

Parameters
string$keyKey to test
HTMLPurifier_Config$configInstance of HTMLPurifier_Config to test against
Return values
bool

◆ remove()

HTMLPurifier_DefinitionCache::remove ( $config)
abstract

Removes a definition object to the cache.

Parameters
HTMLPurifier_Config$config

Reimplemented in HTMLPurifier_DefinitionCache_Decorator, HTMLPurifier_DefinitionCache_Null, and HTMLPurifier_DefinitionCache_Serializer.

◆ replace()

◆ set()

HTMLPurifier_DefinitionCache::set ( $def,
$config )
abstract

The documentation for this class was generated from the following file: