Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

80 lines
2.7KB

  1. Configuration Backwards-Compatibility Breaks
  2. In version 4.0.0, the configuration subsystem (composed of the outwards
  3. facing Config class, as well as the ConfigSchema and ConfigSchema_Interchange
  4. subsystems), was significantly revamped to make use of property lists.
  5. While most of the changes are internal, some internal APIs were changed for the
  6. sake of clarity. HTMLPurifier_Config was kept completely backwards compatible,
  7. although some of the functions were retrofitted with an unambiguous alternate
  8. syntax. Both of these changes are discussed in this document.
  9. 1. Outwards Facing Changes
  10. --------------------------------------------------------------------------------
  11. The HTMLPurifier_Config class now takes an alternate syntax. The general rule
  12. is:
  13. If you passed $namespace, $directive, pass "$namespace.$directive"
  14. instead.
  15. An example:
  16. $config->set('HTML', 'Allowed', 'p');
  17. becomes:
  18. $config->set('HTML.Allowed', 'p');
  19. New configuration options may have more than one namespace, they might
  20. look something like %Filter.YouTube.Blacklist. While you could technically
  21. set it with ('HTML', 'YouTube.Blacklist'), the logical extension
  22. ('HTML', 'YouTube', 'Blacklist') does not work.
  23. The old API will still work, but will emit E_USER_NOTICEs.
  24. 2. Internal API Changes
  25. --------------------------------------------------------------------------------
  26. Some overarching notes: we've completely eliminated the notion of namespace;
  27. it's now an informal construct for organizing related configuration directives.
  28. Also, the validation routines for keys (formerly "$namespace.$directive")
  29. have been completely relaxed. I don't think it really should be necessary.
  30. 2.1 HTMLPurifier_ConfigSchema
  31. First off, if you're interfacing with this class, you really shouldn't.
  32. HTMLPurifier_ConfigSchema_Builder_ConfigSchema is really the only class that
  33. should ever be creating HTMLPurifier_ConfigSchema, and HTMLPurifier_Config the
  34. only class that should be reading it.
  35. All namespace related methods were removed; they are completely unnecessary
  36. now. Any $namespace, $name arguments must be replaced with $key (where
  37. $key == "$namespace.$name"), including for addAlias().
  38. The $info and $defaults member variables are no longer indexed as
  39. [$namespace][$name]; they are now indexed as ["$namespace.$name"].
  40. All deprecated methods were finally removed, after having yelled at you as
  41. an E_USER_NOTICE for a while now.
  42. 2.2 HTMLPurifier_ConfigSchema_Interchange
  43. Member variable $namespaces was removed.
  44. 2.3 HTMLPurifier_ConfigSchema_Interchange_Id
  45. Member variable $namespace and $directive removed; member variable $key added.
  46. Any method that took $namespace, $directive now takes $key.
  47. 2.4 HTMLPurifier_ConfigSchema_Interchange_Namespace
  48. Removed.
  49. vim: et sw=4 sts=4