HumHub Documentation (unofficial)

HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCache
in package

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

Table of Contents

Properties

$type  : mixed

Methods

__construct()  : mixed
add()  : int|bool
Adds a definition object to the cache
checkDefType()  : bool
Checks if a definition's type jives with the cache's type
cleanup()  : bool
Clears all expired (older version or revision) objects from cache
flush()  : bool
Clears all objects from cache
generateBaseDirectoryPath()  : mixed|string
Generates path to base directory that contains all definition type serials
generateDirectoryPath()  : string
Generates the path to the directory contain this cache's serial files
generateFilePath()  : string
Generates the file path to the serial file corresponding to the configuration and definition name
generateKey()  : string
Generates a unique identifier for a particular configuration
get()  : bool|HTMLPurifier_Config
Retrieves a definition object from the cache
isOld()  : bool
Tests whether or not a key is old with respect to the configuration's version and revision number.
remove()  : bool
Removes a definition object to the cache
replace()  : int|bool
Replace an object in the cache
set()  : int|bool
Unconditionally saves a definition object to the cache
_prepareDir()  : bool
Prepares the directory that this type stores the serials in
_testPermissions()  : bool
Tests permissions on a directory and throws out friendly error messages and attempts to chmod it itself if possible
_write()  : int|bool
Convenience wrapper function for file_put_contents

Properties

Methods

__construct()

public __construct(string $type) : mixed
Parameters
$type : string

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

generateBaseDirectoryPath()

Generates path to base directory that contains all definition type serials

public generateBaseDirectoryPath(HTMLPurifier_Config $config) : mixed|string
Parameters
$config : HTMLPurifier_Config
Tags
todo

Make protected

Return values
mixed|string

generateDirectoryPath()

Generates the path to the directory contain this cache's serial files

public generateDirectoryPath(HTMLPurifier_Config $config) : string
Parameters
$config : HTMLPurifier_Config
Tags
note

No trailing slash

todo

Make protected

Return values
string

generateFilePath()

Generates the file path to the serial file corresponding to the configuration and definition name

public generateFilePath(HTMLPurifier_Config $config) : string
Parameters
$config : HTMLPurifier_Config
Tags
todo

Make protected

Return values
string

isOld()

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

public isOld(string $key, HTMLPurifier_Config $config) : bool
Parameters
$key : string

Key to test

$config : HTMLPurifier_Config

Instance of HTMLPurifier_Config to test against

Return values
bool

_testPermissions()

Tests permissions on a directory and throws out friendly error messages and attempts to chmod it itself if possible

private _testPermissions(string $dir, int $chmod) : bool
Parameters
$dir : string

Directory path

$chmod : int

Permissions

Return values
bool

True if directory is writable

_write()

Convenience wrapper function for file_put_contents

private _write(string $file, string $data, HTMLPurifier_Config $config) : int|bool
Parameters
$file : string

File name to write to

$data : string

Data to write into file

$config : HTMLPurifier_Config
Return values
int|bool

Number of bytes written if success, or false if failure.


        
On this page

Search results