63 $contents = file_get_contents(HTMLPURIFIER_PREFIX .
'/HTMLPurifier/ConfigSchema/schema.ser');
64 $r = unserialize($contents);
66 $hash = sha1($contents);
67 trigger_error(
"Unserialization of configuration schema failed, sha1 of file was $hash", E_USER_ERROR);
75 public static function instance($prototype = null) {
76 if ($prototype !== null) {
96 public function add($key, $default,
$type, $allow_null) {
97 $obj =
new stdclass();
99 if ($allow_null) $obj->allow_null =
true;
100 $this->info[$key] = $obj;
101 $this->defaults[$key] = $default;
102 $this->defaultPlist->set($key, $default);
115 if (!isset($this->info[$key]->aliases)) {
116 $this->info[$key]->aliases = array();
118 foreach ($aliases as $alias => $real) {
119 $this->info[$key]->aliases[$alias] = $real;
132 $this->info[$key]->allowed =
$allowed;
144 $obj->key = $new_key;
145 $obj->isAlias =
true;
146 $this->info[$key] = $obj;
153 foreach ($this->info as $key => $v) {
154 if (count((array) $v) == 1) {
155 $this->info[$key] = $v->type;
156 } elseif (count((array) $v) == 2 && isset($v->allow_null)) {
157 $this->info[$key] = -$v->type;