XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
HTMLPurifier_DefinitionCache Class Reference
Inheritance diagram for HTMLPurifier_DefinitionCache:
Inheritance graph

Public Member Functions

 __construct ($type)
 
 add ($def, $config)
 
 checkDefType ($def)
 
 cleanup ($config)
 
 flush ($config)
 
 generateKey ($config)
 
 get ($config)
 
 isOld ($key, $config)
 
 remove ($config)
 
 replace ($def, $config)
 
 set ($def, $config)
 

Public Attributes

 $type
 

Detailed Description

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

Todo:

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

Implement memcached

Definition at line 11 of file DefinitionCache.php.

Constructor & Destructor Documentation

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

Definition at line 20 of file DefinitionCache.php.

References $type.

Member Function Documentation

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

Adds a definition object to the cache

HTMLPurifier_DefinitionCache::checkDefType (   $def)

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

Note
Throws an error on failure
Parameters
$defDefinition object to check
Returns
Boolean true if good, false if not

Definition at line 60 of file DefinitionCache.php.

Referenced by HTMLPurifier_DefinitionCache_Serializer\add(), HTMLPurifier_DefinitionCache_Serializer\replace(), and HTMLPurifier_DefinitionCache_Serializer\set().

Here is the caller graph for this function:

HTMLPurifier_DefinitionCache::cleanup (   $config)
abstract

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.
HTMLPurifier_DefinitionCache::flush (   $config)
abstract

Clears all objects from cache

HTMLPurifier_DefinitionCache::generateKey (   $config)
HTMLPurifier_DefinitionCache::get (   $config)
abstract

Retrieves a definition object from the cache

HTMLPurifier_DefinitionCache::isOld (   $key,
  $config 
)

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

Parameters
$keyKey to test
$configInstance of HTMLPurifier_Config to test against

Definition at line 40 of file DefinitionCache.php.

References $config.

Referenced by HTMLPurifier_DefinitionCache_Serializer\cleanup().

Here is the caller graph for this function:

HTMLPurifier_DefinitionCache::remove (   $config)
abstract

Removes a definition object to the cache

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

Replace an object in the cache

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

Unconditionally saves a definition object to the cache

Member Data Documentation

HTMLPurifier_DefinitionCache::$type

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