\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.

Summary

Methods
Properties
Constants
__construct()
decorate()
copy()
add()
set()
replace()
get()
remove()
flush()
cleanup()
generateKey()
isOld()
checkDefType()
$cache
$name
$type
No constants found
No protected methods found
$definitions
N/A
No private methods found
No private properties found
N/A

Properties

$cache

$cache

Cache object we are decorating

$name

$name : string

The name of the decorator

Type

string

$type

$type

$definitions

$definitions

Methods

__construct()

__construct(string  $type) : mixed

Parameters

string $type

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

Returns

mixed —

decorate()

decorate(\HTMLPurifier_DefinitionCache  $cache) : \HTMLPurifier_DefinitionCache_Decorator

Lazy decorator function

Parameters

\HTMLPurifier_DefinitionCache $cache

Reference to cache object to decorate

Returns

\HTMLPurifier_DefinitionCache_Decorator —

copy()

copy() : \HTMLPurifier_DefinitionCache_Decorator_Memory

Cross-compatible clone substitute

Returns

\HTMLPurifier_DefinitionCache_Decorator_Memory —

add()

add(\HTMLPurifier_Definition  $def, \HTMLPurifier_Config  $config) : mixed

Adds a definition object to the cache

Parameters

\HTMLPurifier_Definition $def
\HTMLPurifier_Config $config

Returns

mixed —

set()

set(\HTMLPurifier_Definition  $def, \HTMLPurifier_Config  $config) : mixed

Unconditionally saves a definition object to the cache

Parameters

\HTMLPurifier_Definition $def
\HTMLPurifier_Config $config

Returns

mixed —

replace()

replace(\HTMLPurifier_Definition  $def, \HTMLPurifier_Config  $config) : mixed

Replace an object in the cache

Parameters

\HTMLPurifier_Definition $def
\HTMLPurifier_Config $config

Returns

mixed —

get()

get(\HTMLPurifier_Config  $config) : mixed

Retrieves a definition object from the cache

Parameters

\HTMLPurifier_Config $config

Returns

mixed —

remove()

remove(\HTMLPurifier_Config  $config) : mixed

Removes a definition object to the cache

Parameters

\HTMLPurifier_Config $config

Returns

mixed —

flush()

flush(\HTMLPurifier_Config  $config) : mixed

Clears all objects from cache

Parameters

\HTMLPurifier_Config $config

Returns

mixed —

cleanup()

cleanup(\HTMLPurifier_Config  $config) : mixed

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

Parameters

\HTMLPurifier_Config $config

Returns

mixed —

generateKey()

generateKey(\HTMLPurifier_Config  $config) : string

Generates a unique identifier for a particular configuration

Parameters

\HTMLPurifier_Config $config

Instance of HTMLPurifier_Config

Returns

string —

isOld()

isOld(string  $key, \HTMLPurifier_Config  $config) : bool

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

Parameters

string $key

Key to test

\HTMLPurifier_Config $config

Instance of HTMLPurifier_Config to test against

Returns

bool —

checkDefType()

checkDefType(\HTMLPurifier_Definition  $def) : bool

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

Parameters

\HTMLPurifier_Definition $def

Definition object to check

Returns

bool —

true if good, false if not