\HTMLPurifier_ConfigSchema

Configuration definition, defines directives and their defaults.

Summary

Methods
Properties
Constants
__construct()
makeFromSerial()
instance()
add()
addValueAliases()
addAllowedValues()
addAlias()
postProcess()
$defaults
$defaultPlist
$info
No constants found
No protected methods found
$singleton
N/A
No private methods found
No private properties found
N/A

Properties

$defaults

$defaults

Defaults of the directives and namespaces.

$defaultPlist

$defaultPlist

The default property list. Do not edit this property list.

$info

$info

Definition of the directives.

The structure of this is:

array( 'Namespace' => array( 'Directive' => new stdClass(), ) )

The stdClass may have the following properties:

  • If isAlias isn't set:
    • type: Integer type of directive, see HTMLPurifier_VarParser for definitions
    • allow_null: If set, this directive allows null values
    • aliases: If set, an associative array of value aliases to real values
    • allowed: If set, a lookup array of allowed (string) values
  • If isAlias is set:
    • namespace: Namespace this directive aliases to
    • name: Directive name this directive aliases to

In certain degenerate cases, stdClass will actually be an integer. In that case, the value is equivalent to an stdClass with the type property set to the integer. If the integer is negative, type is equal to the absolute value of integer, and allow_null is true.

This class is friendly with HTMLPurifier_Config. If you need introspection about the schema, you're better of using the ConfigSchema_Interchange, which uses more memory but has much richer information.

$singleton

$singleton

Application-wide singleton

Methods

__construct()

__construct() : mixed

Returns

mixed —

makeFromSerial()

makeFromSerial() : \HTMLPurifier_ConfigSchema

Unserializes the default ConfigSchema.

Returns

\HTMLPurifier_ConfigSchema —

instance()

instance(\HTMLPurifier_ConfigSchema  $prototype = null) : \HTMLPurifier_ConfigSchema

Retrieves an instance of the application-wide configuration definition.

Parameters

\HTMLPurifier_ConfigSchema $prototype

Returns

\HTMLPurifier_ConfigSchema —

add()

add(string  $key, mixed  $default, string  $type, bool  $allow_null) : mixed

Defines a directive for configuration

Parameters

string $key

Name of directive

mixed $default

Default value of directive

string $type

Allowed type of the directive. See HTMLPurifier_VarParser::$types for allowed values

bool $allow_null

Whether or not to allow null values

Returns

mixed —

addValueAliases()

addValueAliases(string  $key, array  $aliases) : mixed

Defines a directive value alias.

Directive value aliases are convenient for developers because it lets them set a directive to several values and get the same result.

Parameters

string $key

Name of Directive

array $aliases

Hash of aliased values to the real alias

Returns

mixed —

addAllowedValues()

addAllowedValues(string  $key, array  $allowed) : mixed

Defines a set of allowed values for a directive.

Parameters

string $key

Name of directive

array $allowed

Lookup array of allowed values

Returns

mixed —

addAlias()

addAlias(string  $key, string  $new_key) : mixed

Defines a directive alias for backwards compatibility

Parameters

string $key

Directive that will be aliased

string $new_key

Directive that the alias will be to

Returns

mixed —

postProcess()

postProcess() : mixed

Replaces any stdClass that only has the type property with type integer.

Returns

mixed —