71 $contents = file_get_contents(HTMLPURIFIER_PREFIX .
'/HTMLPurifier/ConfigSchema/schema.ser');
72 $r = unserialize($contents);
74 $hash = sha1($contents);
75 trigger_error(
"Unserialization of configuration schema failed, sha1 of file was $hash", E_USER_ERROR);
85 public static function instance($prototype = null)
87 if ($prototype !== null) {
111 $obj->allow_null =
true;
128 if (!isset($this->
info[
$key]->aliases)) {
129 $this->
info[
$key]->aliases = array();
131 foreach ($aliases as $alias => $real) {
132 $this->
info[
$key]->aliases[$alias] = $real;
145 $this->
info[
$key]->allowed = $allowed;
156 $obj->key = $new_key;
157 $obj->isAlias =
true;
166 foreach ($this->
info as
$key => $v) {
167 if (count((array) $v) == 1) {
169 } elseif (count((array) $v) == 2 && isset($v->allow_null)) {
addAlias($key, $new_key)
Defines a directive alias for backwards compatibility.
addAllowedValues($key, $allowed)
Defines a set of allowed values for a directive.
static $types
Lookup table of allowed types.
$defaults
Defaults of the directives and namespaces.
static $singleton
Application-wide singleton HTMLPurifier_ConfigSchema.
addValueAliases($key, $aliases)
Defines a directive value alias.
$defaultPlist
The default property list.
Configuration definition, defines directives and their defaults.
static makeFromSerial()
Unserializes the default ConfigSchema.
Generic property list implementation.
$info
Definition of the directives.
static instance($prototype=null)
Retrieves an instance of the application-wide configuration definition.
postProcess()
Replaces any stdClass that only has the type property with type integer.
add($key, $default, $type, $allow_null)
Defines a directive for configuration.