HTMLPurifier.autoload.php 910 B

12345678910111213141516171819202122232425
  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. require dirname(__FILE__) . '/HTMLPurifier.autoload-legacy.php';
  16. }
  17. // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.zend_ze1_compatibility_modeRemoved
  18. if (ini_get('zend.ze1_compatibility_mode')) {
  19. trigger_error("HTML Purifier is not compatible with zend.ze1_compatibility_mode; please turn it off", E_USER_ERROR);
  20. }
  21. // vim: et sw=4 sts=4