Lines Matching +full:ini +full:- +full:values
108 $parent = $parent ? $parent : $definition->defaultPlist;
109 $this->plist = new HTMLPurifier_PropertyList($parent);
110 $this->def = $definition; // keep a copy around for checking
111 $this->parser = new HTMLPurifier_VarParser_Flexible();
119 * or a string filename of an ini file.
126 // pass-through
135 $ret->loadIni($config);
136 } elseif (is_array($config)) $ret->loadArray($config);
147 return new HTMLPurifier_Config($config->def, $config->plist);
172 $this->triggerError(
173 "Using deprecated API: use \$config->get('$key.$a') instead",
178 if (!$this->finalized) {
179 $this->autoFinalize();
181 if (!isset($this->def->info[$key])) {
183 $this->triggerError(
189 if (isset($this->def->info[$key]->isAlias)) {
190 $d = $this->def->info[$key];
191 $this->triggerError(
192 'Cannot get value from aliased directive, use real name ' . $d->key,
197 if ($this->lock) {
199 if ($ns !== $this->lock) {
200 $this->triggerError(
202 $this->lock .
210 return $this->plist->get($key);
214 * Retrieves an array of directives to values from a given namespace
222 if (!$this->finalized) {
223 $this->autoFinalize();
225 $full = $this->getAll();
227 $this->triggerError(
238 * Returns a SHA-1 signature of a segment of the configuration object
249 if (empty($this->serials[$namespace])) {
250 $batch = $this->getBatch($namespace);
252 $this->serials[$namespace] = sha1(serialize($batch));
254 return $this->serials[$namespace];
258 * Returns a SHA-1 signature for the entire configuration object
265 if (empty($this->serial)) {
266 $this->serial = sha1(serialize($this->getAll()));
268 return $this->serial;
278 if (!$this->finalized) {
279 $this->autoFinalize();
282 foreach ($this->plist->squash() as $name => $value) {
303 …$this->triggerError("Using deprecated API: use \$config->set('$key', ...) instead", E_USER_NOTICE);
307 if ($this->isFinalized('Cannot set directive after finalization')) {
310 if (!isset($this->def->info[$key])) {
311 $this->triggerError(
317 $def = $this->def->info[$key];
319 if (isset($def->isAlias)) {
320 if ($this->aliasMode) {
321 $this->triggerError(
322 'Double-aliases not allowed, please fix '.
328 $this->aliasMode = true;
329 $this->set($def->key, $value);
330 $this->aliasMode = false;
331 … $this->triggerError("$key is an alias, preferred directive name is {$def->key}", E_USER_NOTICE);
337 $rtype = is_int($def) ? $def : $def->type;
339 $type = -$rtype;
343 $allow_null = isset($def->allow_null);
347 $value = $this->parser->parse($value, $type, $allow_null);
349 $this->triggerError(
358 if (isset($def->aliases[$value])) {
359 $value = $def->aliases[$value];
362 if (isset($def->allowed) && !isset($def->allowed[$value])) {
363 $this->triggerError(
364 'Value not supported, valid values are: ' .
365 $this->_listify($def->allowed),
371 $this->plist->set($key, $value);
377 $this->definitions[$namespace] = null;
380 $this->serials[$namespace] = false;
415 return $this->getDefinition('HTML', $raw, $optimized);
434 return $this->getDefinition('CSS', $raw, $optimized);
453 return $this->getDefinition('URI', $raw, $optimized);
466 * Check out enduser-customize.html for more details.
478 if (!$this->finalized) {
479 $this->autoFinalize();
482 $lock = $this->lock;
483 $this->lock = null;
485 $cache = $factory->create($type, $this);
486 $this->lock = $lock;
489 // ---------------
491 if (!empty($this->definitions[$type])) {
492 $def = $this->definitions[$type];
494 if ($def->setup) {
497 $def->setup($this);
498 if ($def->optimized) {
499 $cache->add($def, $this);
505 $def = $cache->get($this);
508 $this->definitions[$type] = $def;
512 $def = $this->initDefinition($type);
514 $this->lock = $type;
515 $def->setup($this);
516 $this->lock = null;
518 $cache->add($def, $this);
523 // --------------
527 if (is_null($this->get($type . '.DefinitionID'))) {
534 if (!empty($this->definitions[$type])) {
535 $def = $this->definitions[$type];
536 if ($def->setup && !$optimized) {
537 $extra = $this->chatty ?
545 if ($def->optimized === null) {
546 $extra = $this->chatty ? " (try flushing your cache)" : "";
551 if ($def->optimized !== $optimized) {
553 $extra = $this->chatty ?
563 if ($def->setup) {
578 // trailing code), we always short-circuit above.
579 $def = $cache->get($this);
583 $this->definitions[$type] = $def;
589 if (!is_null($this->get($type . '.DefinitionID'))) {
590 if ($this->chatty) {
591 $this->triggerError(
598 … '<a href="http://htmlpurifier.org/docs/enduser-customize.html#optimized">' .
603 $this->triggerError(
611 $def = $this->initDefinition($type);
612 $def->optimized = $optimized;
640 $this->definitions[$type] = $def;
646 return $this->getDefinition($name, true, true);
654 return $this->getDefinition('HTML', true, true);
662 return $this->getDefinition('CSS', true, true);
670 return $this->getDefinition('URI', true, true);
674 * Loads configuration values from an array with the following structure:
681 if ($this->isFinalized('Cannot load directives after finalization')) {
687 $this->set($key, $value);
692 $this->set($namespace .'.'. $directive, $value2);
700 * that are allowed in a web-form context as per an allowed
723 if ($ns_or_directive[0] == '-') {
735 foreach ($schema->info as $key => $def) {
745 if (isset($def->isAlias)) {
757 * Loads configuration values from $_GET/$_POST that were posted
776 * Merges in configuration values from $_GET/$_POST to object. NOT STATIC.
785 … $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def);
786 $this->loadArray($ret);
827 * Loads configuration values from an ini file
829 * @param string $filename Name of ini file
833 if ($this->isFinalized('Cannot load directives after finalization')) {
837 $this->loadArray($array);
849 if ($this->finalized && $error) {
850 $this->triggerError($error, E_USER_ERROR);
852 return $this->finalized;
861 if ($this->autoFinalize) {
862 $this->finalize();
864 $this->plist->squash(true);
873 $this->finalized = true;
874 $this->parser = null;
888 if ($this->chatty) {
890 // zip(tail(trace), trace) -- but PHP is not Haskell har har
891 for ($i = 0, $c = count($trace); $i < $c - 1; $i++) {
912 $this->getDefinition('HTML');
913 $this->getDefinition('CSS');
914 $this->getDefinition('URI');