HTMLPurifierExtras.php 684 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Meta-class for HTML Purifier's extra class hierarchies, similar to
  4. * HTMLPurifier_Bootstrap.
  5. */
  6. class HTMLPurifierExtras
  7. {
  8. public static function autoload($class)
  9. {
  10. $path = HTMLPurifierExtras::getPath($class);
  11. if (!$path) return false;
  12. require $path;
  13. return true;
  14. }
  15. public static function getPath($class)
  16. {
  17. if (
  18. strncmp('FSTools', $class, 7) !== 0 &&
  19. strncmp('ConfigDoc', $class, 9) !== 0
  20. ) return false;
  21. // Custom implementations can go here
  22. // Standard implementation:
  23. return str_replace('_', '/', $class) . '.php';
  24. }
  25. }
  26. // vim: et sw=4 sts=4