HTMLPurifier.autoload.php 839 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * @file
  4. * Convenience file that registers autoload handler for HTML Purifier.
  5. * It also does some sanity checks.
  6. */
  7. if (function_exists('spl_autoload_register') && function_exists('spl_autoload_unregister')) {
  8. // We need unregister for our pre-registering functionality
  9. HTMLPurifier_Bootstrap::registerAutoload();
  10. if (function_exists('__autoload')) {
  11. // Be polite and ensure that userland autoload gets retained
  12. spl_autoload_register('__autoload');
  13. }
  14. } elseif (!function_exists('__autoload')) {
  15. function __autoload($class)
  16. {
  17. return HTMLPurifier_Bootstrap::autoload($class);
  18. }
  19. }
  20. if (ini_get('zend.ze1_compatibility_mode')) {
  21. trigger_error("HTML Purifier is not compatible with zend.ze1_compatibility_mode; please turn it off", E_USER_ERROR);
  22. }
  23. // vim: et sw=4 sts=4