< HTMLPurifier_DefinitionCache > Protocol Reference

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

List of all members.

Public Member Functions

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

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

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

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
Todo:
Implement memcached
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

Definition at line 11 of file DefinitionCache.php.


Constructor & Destructor Documentation

HTMLPurifier_DefinitionCache-p::__construct ( type  ) 

Parameters:
$name Type of definition objects this instance of the cache will handle.

Definition at line 20 of file DefinitionCache.php.

HTMLPurifier_DefinitionCache-p::__construct ( type  ) 

Parameters:
$name Type of definition objects this instance of the cache will handle.

Definition at line 2179 of file HTMLPurifier.standalone.php.


Member Function Documentation

HTMLPurifier_DefinitionCache-p::generateKey ( config  ) 

Generates a unique identifier for a particular configuration.

Parameters:
Instance of HTMLPurifier_Config

Definition at line 28 of file DefinitionCache.php.

HTMLPurifier_DefinitionCache-p::isOld ( key,
config 
)

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

Parameters:
$key Key to test
$config Instance of HTMLPurifier_Config to test against

Definition at line 40 of file DefinitionCache.php.

References $version.

HTMLPurifier_DefinitionCache-p::checkDefType ( def  ) 

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

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

Definition at line 60 of file DefinitionCache.php.

HTMLPurifier_DefinitionCache-p::add ( def,
config 
) [abstract]

Adds a definition object to the cache.

HTMLPurifier_DefinitionCache-p::set ( def,
config 
) [abstract]

Unconditionally saves a definition object to the cache.

HTMLPurifier_DefinitionCache-p::replace ( def,
config 
) [abstract]

Replace an object in the cache.

HTMLPurifier_DefinitionCache-p::get ( config  )  [abstract]

Retrieves a definition object from the cache.

HTMLPurifier_DefinitionCache-p::remove ( config  )  [abstract]

Removes a definition object to the cache.

HTMLPurifier_DefinitionCache-p::flush ( config  )  [abstract]

Clears all objects from cache.

HTMLPurifier_DefinitionCache-p::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-p::generateKey ( config  ) 

Generates a unique identifier for a particular configuration.

Parameters:
Instance of HTMLPurifier_Config

Definition at line 2187 of file HTMLPurifier.standalone.php.

HTMLPurifier_DefinitionCache-p::isOld ( key,
config 
)

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

Parameters:
$key Key to test
$config Instance of HTMLPurifier_Config to test against

Definition at line 2199 of file HTMLPurifier.standalone.php.

References $version.

HTMLPurifier_DefinitionCache-p::checkDefType ( def  ) 

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

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

Definition at line 2219 of file HTMLPurifier.standalone.php.

HTMLPurifier_DefinitionCache-p::add ( def,
config 
) [abstract]

Adds a definition object to the cache.

HTMLPurifier_DefinitionCache-p::set ( def,
config 
) [abstract]

Unconditionally saves a definition object to the cache.

HTMLPurifier_DefinitionCache-p::replace ( def,
config 
) [abstract]

Replace an object in the cache.

HTMLPurifier_DefinitionCache-p::get ( config  )  [abstract]

Retrieves a definition object from the cache.

HTMLPurifier_DefinitionCache-p::remove ( config  )  [abstract]

Removes a definition object to the cache.

HTMLPurifier_DefinitionCache-p::flush ( config  )  [abstract]

Clears all objects from cache.

HTMLPurifier_DefinitionCache-p::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.


Member Data Documentation

HTMLPurifier_DefinitionCache-p::$type

Definition at line 14 of file DefinitionCache.php.


The documentation for this protocol was generated from the following files:
Generated on Thu Jun 19 18:47:30 2008 for HTMLPurifier by  doxygen 1.5.3