71 $contents = file_get_contents(HTMLPURIFIER_PREFIX .
'/HTMLPurifier/ConfigSchema/schema.ser');
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) {
106 public function add($key, $default, $type, $allow_null)
108 $obj =
new stdclass();
111 $obj->allow_null =
true;
113 $this->info[$key] = $obj;
114 $this->defaults[$key] = $default;
115 $this->defaultPlist->set($key, $default);
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;
158 $this->info[$key] = $obj;
166 foreach ($this->info as $key => $v) {
167 if (count((
array) $v) == 1) {
168 $this->info[$key] = $v->type;
169 } elseif (count((
array) $v) == 2 && isset($v->allow_null)) {
170 $this->info[$key] = -$v->type;
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.
Create styles array
The data for the language used.
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.