Configuration object that triggers customizable behavior.
Methods | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct(HTMLPurifier_ConfigSchema $definition, HTMLPurifier_PropertyList $parent = null)
Constructor
Constructor Parameters
|
# | ||||||||||
public
static
|
create(mixed $config, HTMLPurifier_ConfigSchema $schema = null): HTMLPurifier_Config
Convenience constructor that creates a config object based on a mixed var
Convenience constructor that creates a config object based on a mixed var Parameters
ReturnsConfigured object |
# | ||||||||||
public
static
|
inherit(HTMLPurifier_Config $config): HTMLPurifier_Config
Creates a new config object that inherits from a previous one.
Creates a new config object that inherits from a previous one. Parameters
Returnsobject with $config as its parent. |
# | ||||||||||
public
static
|
createDefault(): HTMLPurifier_Config
Convenience constructor that creates a default configuration object.
Convenience constructor that creates a default configuration object. Returnsdefault object. |
# | ||||||||||
public
|
get(string $key, mixed $a = null): mixed
Retrieves a value from the configuration.
Retrieves a value from the configuration. Parameters
|
# | ||||||||||
public
|
getBatch(string $namespace): array
Retrieves an array of directives to values from a given namespace
Retrieves an array of directives to values from a given namespace Parameters
|
# | ||||||||||
public
|
getBatchSerial(string $namespace): string
Returns a SHA-1 signature of a segment of the configuration object
that uniquely identifies that particular…
Returns a SHA-1 signature of a segment of the configuration object that uniquely identifies that particular configuration Parameters
|
# | ||||||||||
public
|
getSerial(): string
Returns a SHA-1 signature for the entire configuration object
that uniquely identifies that particular configuration
Returns a SHA-1 signature for the entire configuration object that uniquely identifies that particular configuration |
# | ||||||||||
public
|
getAll()
Retrieves all directives, organized by namespace
Retrieves all directives, organized by namespace |
# | ||||||||||
public
|
set(string $key, mixed $value, mixed $a = null)
Sets a value to configuration.
Sets a value to configuration. Parameters
|
# | ||||||||||
public
|
getHTMLDefinition(bool $raw = false, bool $optimized = false): HTMLPurifier_HTMLDefinition|null
Retrieves object reference to the HTML definition.
Retrieves object reference to the HTML definition. Parameters
|
# | ||||||||||
public
|
getCSSDefinition(bool $raw = false, bool $optimized = false): HTMLPurifier_CSSDefinition|null
Retrieves object reference to the CSS definition
Retrieves object reference to the CSS definition Parameters
|
# | ||||||||||
public
|
getURIDefinition(bool $raw = false, bool $optimized = false): HTMLPurifier_URIDefinition|null
Retrieves object reference to the URI definition
Retrieves object reference to the URI definition Parameters
|
# | ||||||||||
public
|
getDefinition(string $type, bool $raw = false, bool $optimized = false): HTMLPurifier_Definition|null
Retrieves a definition
Retrieves a definition Parameters
Throws
|
# | ||||||||||
public
|
maybeGetRawDefinition($name)
|
# | ||||||||||
public
|
maybeGetRawHTMLDefinition(): HTMLPurifier_HTMLDefinition|null
|
# | ||||||||||
public
|
maybeGetRawCSSDefinition(): HTMLPurifier_CSSDefinition|null
|
# | ||||||||||
public
|
maybeGetRawURIDefinition(): HTMLPurifier_URIDefinition|null
|
# | ||||||||||
public
|
loadArray(array $config_array)
Loads configuration values from an array with the following structure:
Namespace.Directive => Value
Loads configuration values from an array with the following structure: Namespace.Directive => Value Parameters
|
# | ||||||||||
public
static
|
getAllowedDirectivesForForm(array $allowed, HTMLPurifier_ConfigSchema $schema = null): array
Returns a list of array(namespace, directive) for all directives
that are allowed in a web-form context as per an…
Returns a list of array(namespace, directive) for all directives that are allowed in a web-form context as per an allowed namespaces/directives list. Parameters
|
# | ||||||||||
public
static
|
loadArrayFromForm(
array $array,
string|bool $index = false,
array|bool $allowed = true,
bool $mq_fix = true,
HTMLPurifier_ConfigSchema $schema = null,
): mixed
Loads configuration values from $_GET/$_POST that were posted
via ConfigForm
Loads configuration values from $_GET/$_POST that were posted via ConfigForm Parameters
|
# | ||||||||||
public
|
mergeArrayFromForm(array $array, string|bool $index = false, array|bool $allowed = true, bool $mq_fix = true)
Merges in configuration values from $_GET/$_POST to object. NOT STATIC.
Merges in configuration values from $_GET/$_POST to object. NOT STATIC. Parameters
|
# | ||||||||||
public
static
|
prepareArrayFromForm(
array $array,
string|bool $index = false,
array|bool $allowed = true,
bool $mq_fix = true,
HTMLPurifier_ConfigSchema $schema = null,
): array
Prepares an array from a form into something usable for the more
strict parts of HTMLPurifier_Config
Prepares an array from a form into something usable for the more strict parts of HTMLPurifier_Config Parameters
|
# | ||||||||||
public
|
loadIni(string $filename)
Loads configuration values from an ini file
Loads configuration values from an ini file Parameters
|
# | ||||||||||
public
|
isFinalized(string|bool $error = false): bool
Checks whether or not the configuration object is finalized.
Checks whether or not the configuration object is finalized. Parameters
|
# | ||||||||||
public
|
autoFinalize()
Finalizes configuration only if auto finalize is on and not
already finalized
Finalizes configuration only if auto finalize is on and not already finalized |
# | ||||||||||
public
|
finalize()
Finalizes a configuration object, prohibiting further change
Finalizes a configuration object, prohibiting further change |
# | ||||||||||
protected
|
triggerError(string $msg, int $no)
Produces a nicely formatted error message by supplying the
stack frame information OUTSIDE of HTMLPurifier_Config.
Produces a nicely formatted error message by supplying the stack frame information OUTSIDE of HTMLPurifier_Config. Parameters
|
# | ||||||||||
public
|
serialize(): string
Returns a serialized form of the configuration object that can
be reconstituted.
Returns a serialized form of the configuration object that can be reconstituted. |
# |
Properties | |||
---|---|---|---|
public
|
|
$version = '4.15.0'
HTML Purifier's version
HTML Purifier's version |
# |
public
|
|
$autoFinalize = true
Whether or not to automatically finalize
the object if a read operation is done.
Whether or not to automatically finalize the object if a read operation is done. |
# |
protected
|
|
$serials = []
Namespace indexed array of serials for specific namespaces.
Namespace indexed array of serials for specific namespaces. |
# |
protected
|
|
$serial
Serial for entire configuration object.
Serial for entire configuration object. |
# |
protected
|
|
$parser = null
Parser for variables.
Parser for variables. |
# |
public
|
|
$def
Reference HTMLPurifier_ConfigSchema for value checking.
Reference HTMLPurifier_ConfigSchema for value checking. |
# |
protected
|
|
$definitions
Indexed array of definitions.
Indexed array of definitions. |
# |
protected
|
|
$finalized = false
Whether or not config is finalized.
Whether or not config is finalized. |
# |
protected
|
|
$plist
Property list containing configuration directives.
Property list containing configuration directives. |
# |
public
|
|
$chatty = true
Set to false if you do not want line and file numbers in errors.
(useful when unit testing). This will also compress…
Set to false if you do not want line and file numbers in errors. (useful when unit testing). This will also compress some errors and exceptions. |
# |