Class HTMLPurifier_ConfigSchema
Inheritance | HTMLPurifier_ConfigSchema |
---|
Configuration definition, defines directives and their defaults.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$defaultPlist | The default property list. Do not edit this property list. | HTMLPurifier_ConfigSchema | |
$defaults | Defaults of the directives and namespaces. | HTMLPurifier_ConfigSchema | |
$info | Definition of the directives. | HTMLPurifier_ConfigSchema |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$singleton | Application-wide singleton | HTMLPurifier_ConfigSchema |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | HTMLPurifier_ConfigSchema | |
add() | Defines a directive for configuration | HTMLPurifier_ConfigSchema |
addAlias() | Defines a directive alias for backwards compatibility | HTMLPurifier_ConfigSchema |
addAllowedValues() | Defines a set of allowed values for a directive. | HTMLPurifier_ConfigSchema |
addValueAliases() | Defines a directive value alias. | HTMLPurifier_ConfigSchema |
instance() | Retrieves an instance of the application-wide configuration definition. | HTMLPurifier_ConfigSchema |
makeFromSerial() | Unserializes the default ConfigSchema. | HTMLPurifier_ConfigSchema |
postProcess() | Replaces any stdclass that only has the type property with type integer. | HTMLPurifier_ConfigSchema |
Property Details
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.
Method Details
public void __construct ( ) |
Defines a directive for configuration
public void add ( $key, $default, $type, $allow_null ) | ||
$key | string | Name of directive |
$default | mixed | Default value of directive |
$type | string | Allowed type of the directive. See
|
$allow_null | bool | Whether or not to allow null values |
Defines a directive alias for backwards compatibility
public void addAlias ( $key, $new_key ) | ||
$key | string | Directive that will be aliased |
$new_key | string | Directive that the alias will be to |
Defines a set of allowed values for a directive.
public void addAllowedValues ( $key, $allowed ) | ||
$key | string | Name of directive |
$allowed | array | Lookup array of allowed values |
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.
public void addValueAliases ( $key, $aliases ) | ||
$key | string | Name of Directive |
$aliases | array | Hash of aliased values to the real alias |
Retrieves an instance of the application-wide configuration definition.
public static HTMLPurifier_ConfigSchema instance ( $prototype = null ) | ||
$prototype | HTMLPurifier_ConfigSchema |
Unserializes the default ConfigSchema.
public static HTMLPurifier_ConfigSchema makeFromSerial ( ) |
Replaces any stdclass that only has the type property with type integer.
public void postProcess ( ) |