HTMLPurifier_DefinitionCache_Decorator_Memory
Definition cache decorator class that saves all cache retrievals to PHP's memory; good for unit tests or circumstances where there are lots of configuration objects floating around.
- Full name:
\HTMLPurifier_DefinitionCache_Decorator_Memory
- Parent class:
\HTMLPurifier_DefinitionCache_Decorator
Properties
definitions
name
The name of the decorator
Methods
copy
Cross-compatible clone substitute
add
Adds a definition object to the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$def |
\HTMLPurifier_Definition | |
$config |
\HTMLPurifier_Config |
set
Unconditionally saves a definition object to the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$def |
\HTMLPurifier_Definition | |
$config |
\HTMLPurifier_Config |
replace
Replace an object in the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$def |
\HTMLPurifier_Definition | |
$config |
\HTMLPurifier_Config |
get
Retrieves a definition object from the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
\HTMLPurifier_Config |
Inherited methods
__construct
generateKey
Generates a unique identifier for a particular configuration
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
\HTMLPurifier_Config | Instance of HTMLPurifier_Config |
isOld
Tests whether or not a key is old with respect to the configuration's version and revision number.
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
string | Key to test |
$config |
\HTMLPurifier_Config | Instance of HTMLPurifier_Config to test against |
checkDefType
Checks if a definition's type jives with the cache's type
Parameters:
Parameter | Type | Description |
---|---|---|
$def |
\HTMLPurifier_Definition | Definition object to check |
Return Value:
true if good, false if not
add
Adds a definition object to the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$def |
\HTMLPurifier_Definition | |
$config |
\HTMLPurifier_Config |
set
Unconditionally saves a definition object to the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$def |
\HTMLPurifier_Definition | |
$config |
\HTMLPurifier_Config |
replace
Replace an object in the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$def |
\HTMLPurifier_Definition | |
$config |
\HTMLPurifier_Config |
get
Retrieves a definition object from the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
\HTMLPurifier_Config |
remove
Removes a definition object to the cache
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
\HTMLPurifier_Config |
flush
Clears all objects from cache
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
\HTMLPurifier_Config |
cleanup
Clears all expired (older version or revision) objects from cache
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
\HTMLPurifier_Config |
decorate
Lazy decorator function
Parameters:
Parameter | Type | Description |
---|---|---|
$cache |
\HTMLPurifier_DefinitionCache | Reference to cache object to decorate |
copy
Cross-compatible clone substitute
Automatically generated on 2025-03-18