HTMLPurifierExtras.php 676 B

1234567891011121314151617181920212223242526272829
  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. $path = HTMLPurifierExtras::getPath($class);
  10. if (!$path) return false;
  11. require $path;
  12. return true;
  13. }
  14. public static function getPath($class) {
  15. if (
  16. strncmp('FSTools', $class, 7) !== 0 &&
  17. strncmp('ConfigDoc', $class, 9) !== 0
  18. ) return false;
  19. // Custom implementations can go here
  20. // Standard implementation:
  21. return str_replace('_', '/', $class) . '.php';
  22. }
  23. }
  24. // vim: et sw=4 sts=4