Class HTMLPurifier_Config

Description

Configuration object that triggers customizable behavior.

  • todo: Reconsider some of the public member variables

Located in /lib/core/Parsers/htmlpurifier/HTMLPurifier.standalone.php (line 1317)


	
			
Variable Summary
mixed $chatty
mixed $def
mixed $definitions
mixed $finalized
mixed $parser
mixed $plist
mixed $serial
mixed $serials
mixed $version
Method Summary
static Configured create (mixed $config, [HTMLPurifier_ConfigSchema $schema = null])
static Default createDefault ()
static void getAllowedDirectivesForForm ($allowed $allowed, [ $schema = null])
static void loadArrayFromForm ( $array, [$index $index = false], [$allowed $allowed = true], [$mq_fix $mq_fix = true], [$schema $schema = null], $array $_GET)
static void prepareArrayFromForm ( $array, [ $index = false], [ $allowed = true], [ $mq_fix = true], [ $schema = null])
HTMLPurifier_Config __construct ($definition $definition, [ $parent = null])
void autoFinalize ()
void finalize ()
void get ($key $key, [ $a = null])
void getAll ()
void getBatch ($namespace $namespace)
void getBatchSerial ($namespace $namespace)
void getCSSDefinition ([$raw $raw = false])
void getDefinition ($type $type, [$raw $raw = false])
void getHTMLDefinition ([$raw $raw = false])
void getSerial ()
void isFinalized ([$error $error = false])
void loadArray ($config_array $config_array)
void loadIni ($filename $filename)
void mergeArrayFromForm ( $array, [ $index = false], [ $allowed = true], [ $mq_fix = true])
void serialize ()
void set ($key $key, $value $value, [ $a = null])
void triggerError ( $msg,  $no)
Variables
mixed $autoFinalize = true (line 1329)

Bool indicator whether or not to automatically finalize

the object if a read operation is done

  • access: public
mixed $chatty = true (line 1381)

Set to false if you do not want line and file numbers in errors

(useful when unit testing)

  • access: public
mixed $def (line 1354)

Reference HTMLPurifier_ConfigSchema for value checking

  • access: public
mixed $definitions (line 1359)

Indexed array of definitions

  • access: protected
mixed $finalized = false (line 1364)

Bool indicator whether or not config is finalized

  • access: protected
mixed $parser (line 1347)

Parser for variables

  • access: protected
mixed $plist (line 1369)

Property list containing configuration directives.

  • access: protected
mixed $serial (line 1342)

Serial for entire configuration object

  • access: protected
mixed $serials = array() (line 1337)

Namespace indexed array of serials for specific namespaces (see getSerial() for more info).

  • access: protected
mixed $version = '4.2.0' (line 1323)

HTML Purifier's version

  • access: public
Methods
static method create (line 1408)

Convenience constructor that creates a config object based on a mixed var

  • return: HTMLPurifier_Config object
  • access: public
static Configured create (mixed $config, [HTMLPurifier_ConfigSchema $schema = null])
  • mixed $config: Variable that defines the state of the config object. Can be: a HTMLPurifier_Config() object, an array of directives based on loadArray(), or a string filename of an ini file.
  • HTMLPurifier_ConfigSchema $schema: Schema object
static method createDefault (line 1437)

Convenience constructor that creates a default configuration object.

  • return: HTMLPurifier_Config object.
  • access: public
static Default createDefault ()
static method getAllowedDirectivesForForm (line 1724)

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.

  • access: public
static void getAllowedDirectivesForForm ($allowed $allowed, [ $schema = null])
  • $allowed $allowed: List of allowed namespaces/directives
  • $schema
static method inherit (line 1429)

Creates a new config object that inherits from a previous one.

  • return: object with $config as its parent.
  • access: public
static HTMLPurifier_Config inherit (HTMLPurifier_Config $config)
static method loadArrayFromForm (line 1770)

Loads configuration values from $_GET/$_POST that were posted

via ConfigForm

  • access: public
static void loadArrayFromForm ( $array, [$index $index = false], [$allowed $allowed = true], [$mq_fix $mq_fix = true], [$schema $schema = null], $array $_GET)
  • $array $_GET: or $_POST array to import
  • $index $index: Index/name that the config variables are in
  • $allowed $allowed: List of allowed namespaces/directives
  • $mq_fix $mq_fix: Boolean whether or not to enable magic quotes fix
  • $schema $schema: Instance of HTMLPurifier_ConfigSchema to use, if not global copy
  • $array
static method prepareArrayFromForm (line 1789)

Prepares an array from a form into something usable for the more

strict parts of HTMLPurifier_Config

  • access: public
static void prepareArrayFromForm ( $array, [ $index = false], [ $allowed = true], [ $mq_fix = true], [ $schema = null])
  • $array
  • $index
  • $allowed
  • $mq_fix
  • $schema
Constructor __construct (line 1392)
  • access: public
HTMLPurifier_Config __construct ($definition $definition, [ $parent = null])
  • $definition $definition: HTMLPurifier_ConfigSchema that defines what directives are allowed.
  • $parent
autoFinalize (line 1834)

Finalizes configuration only if auto finalize is on and not

already finalized

  • access: public
void autoFinalize ()
finalize (line 1845)

Finalizes a configuration object, prohibiting further change

  • access: public
void finalize ()
get (line 1447)

Retreives a value from the configuration.

  • access: public
void get ($key $key, [ $a = null])
  • $key $key: String key
  • $a
getAll (line 1521)

Retrieves all directives, organized by namespace

  • access: public
void getAll ()
getBatch (line 1479)

Retreives an array of directives to values from a given namespace

  • access: public
void getBatch ($namespace $namespace)
  • $namespace $namespace: String namespace
getBatchSerial (line 1497)

Returns a md5 signature of a segment of the configuration object

that uniquely identifies that particular configuration

  • access: public
void getBatchSerial ($namespace $namespace)
  • $namespace $namespace: Namespace to get serial for
getCSSDefinition (line 1631)

Retrieves object reference to the CSS definition

  • access: public
void getCSSDefinition ([$raw $raw = false])
  • $raw $raw: Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work.
getDefinition (line 1640)

Retrieves a definition

  • access: public
void getDefinition ($type $type, [$raw $raw = false])
  • $type $type: Type of definition: HTML, CSS, etc
  • $raw $raw: Whether or not definition should be returned raw
getHTMLDefinition (line 1622)

Retrieves object reference to the HTML definition.

  • access: public
void getHTMLDefinition ([$raw $raw = false])
  • $raw $raw: Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work.
getSerial (line 1510)

Returns a md5 signature for the entire configuration object

that uniquely identifies that particular configuration

  • access: public
void getSerial ()
isFinalized (line 1823)

Checks whether or not the configuration object is finalized.

  • access: public
void isFinalized ([$error $error = false])
  • $error $error: String error message, or false for no error
loadArray (line 1702)

Loads configuration values from an array with the following structure:

Namespace.Directive => Value

  • access: public
void loadArray ($config_array $config_array)
  • $config_array $config_array: Configuration associative array
loadIni (line 1813)

Loads configuration values from an ini file

  • access: public
void loadIni ($filename $filename)
  • $filename $filename: Name of ini file
mergeArrayFromForm (line 1780)

Merges in configuration values from $_GET/$_POST to object. NOT STATIC.

  • access: public
void mergeArrayFromForm ( $array, [ $index = false], [ $allowed = true], [ $mq_fix = true])
  • $array
  • $index
  • $allowed
  • $mq_fix
serialize (line 1871)

Returns a serialized form of the configuration object that can be reconstituted.

  • access: public
void serialize ()
set (line 1536)

Sets a value to configuration.

  • access: public
void set ($key $key, $value $value, [ $a = null])
  • $key $key: String key
  • $value $value: Mixed value
  • $a
triggerError (line 1855)

Produces a nicely formatted error message by supplying the stack frame information from two levels up and OUTSIDE of HTMLPurifier_Config.

  • access: protected
void triggerError ( $msg,  $no)
  • $msg
  • $no

Documentation generated on Sun, 06 Mar 2011 00:24:01 -0500 by phpDocumentor 1.4.3