Cheetah
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Attributes | List of all members
HTMLPurifier_ConfigSchema Class Reference

Public Member Functions

 __construct ()
 
 add ($key, $default, $type, $allow_null)
 
 addValueAliases ($key, $aliases)
 
 addAllowedValues ($key, $allowed)
 
 addAlias ($key, $new_key)
 
 postProcess ()
 

Static Public Member Functions

static makeFromSerial ()
 
static instance ($prototype=null)
 

Public Attributes

 $defaults = array()
 
 $defaultPlist
 
 $info = array()
 

Static Protected Attributes

static $singleton
 

Detailed Description

Configuration definition, defines directives and their defaults.

Definition at line 2716 of file HTMLPurifier.standalone.php.

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_ConfigSchema::__construct ( )

Definition at line 2770 of file HTMLPurifier.standalone.php.

Member Function Documentation

◆ add()

HTMLPurifier_ConfigSchema::add (   $key,
  $default,
  $type,
  $allow_null 
)

Defines a directive for configuration

Warning
Will fail of directive's namespace is defined.
This method's signature is slightly different from the legacy define() static method! Beware!
Parameters
string$keyName of directive
mixed$defaultDefault value of directive
string$typeAllowed type of the directive. See HTMLPurifier_VarParser::$types for allowed values
bool$allow_nullWhether or not to allow null values

Definition at line 2816 of file HTMLPurifier.standalone.php.

◆ addAlias()

HTMLPurifier_ConfigSchema::addAlias (   $key,
  $new_key 
)

Defines a directive alias for backwards compatibility

Parameters
string$keyDirective that will be aliased
string$new_keyDirective that the alias will be to

Definition at line 2863 of file HTMLPurifier.standalone.php.

◆ addAllowedValues()

HTMLPurifier_ConfigSchema::addAllowedValues (   $key,
  $allowed 
)

Defines a set of allowed values for a directive.

Warning
This is slightly different from the corresponding static method definition.
Parameters
string$keyName of directive
array$allowedLookup array of allowed values

Definition at line 2853 of file HTMLPurifier.standalone.php.

◆ addValueAliases()

HTMLPurifier_ConfigSchema::addValueAliases (   $key,
  $aliases 
)

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$keyName of Directive
array$aliasesHash of aliased values to the real alias

Definition at line 2836 of file HTMLPurifier.standalone.php.

◆ instance()

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

Retrieves an instance of the application-wide configuration definition.

Parameters
HTMLPurifier_ConfigSchema$prototype
Returns
HTMLPurifier_ConfigSchema

Definition at line 2795 of file HTMLPurifier.standalone.php.

◆ makeFromSerial()

static HTMLPurifier_ConfigSchema::makeFromSerial ( )
static

Unserializes the default ConfigSchema.

Returns
HTMLPurifier_ConfigSchema

Definition at line 2779 of file HTMLPurifier.standalone.php.

◆ postProcess()

HTMLPurifier_ConfigSchema::postProcess ( )

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

Definition at line 2874 of file HTMLPurifier.standalone.php.

Member Data Documentation

◆ $defaultPlist

HTMLPurifier_ConfigSchema::$defaultPlist

The default property list. Do not edit this property list. @type array

Definition at line 2729 of file HTMLPurifier.standalone.php.

◆ $defaults

HTMLPurifier_ConfigSchema::$defaults = array()

Defaults of the directives and namespaces. @type array

Note
This shares the exact same structure as HTMLPurifier_Config::$conf

Definition at line 2723 of file HTMLPurifier.standalone.php.

◆ $info

HTMLPurifier_ConfigSchema::$info = array()

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. @type array

Definition at line 2762 of file HTMLPurifier.standalone.php.

◆ $singleton

HTMLPurifier_ConfigSchema::$singleton
staticprotected

Application-wide singleton @type HTMLPurifier_ConfigSchema

Definition at line 2768 of file HTMLPurifier.standalone.php.


The documentation for this class was generated from the following file: