HTMLPurifier.autoload.php 835 B

1234567891011121314151617181920212223242526
  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. return HTMLPurifier_Bootstrap::autoload($class);
  17. }
  18. }
  19. if (ini_get('zend.ze1_compatibility_mode')) {
  20. trigger_error("HTML Purifier is not compatible with zend.ze1_compatibility_mode; please turn it off", E_USER_ERROR);
  21. }
  22. // vim: et sw=4 sts=4