autoload.inc.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @package dompdf
  4. * @link http://dompdf.github.com/
  5. * @author Benj Carson <benjcarson@digitaljunkies.ca>
  6. * @author Fabien Ménager <fabien.menager@gmail.com>
  7. * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  8. */
  9. // HMLT5 Parser
  10. //FIXME: replace with masterminds HTML5
  11. //require_once __DIR__ . '/lib/html5lib/Parser.php';
  12. // Sabberworm
  13. spl_autoload_register(function($class)
  14. {
  15. if (strpos($class, 'Sabberworm') !== false) {
  16. $file = str_replace('\\', DIRECTORY_SEPARATOR, $class);
  17. $file = realpath(__DIR__ . '/lib/php-css-parser/lib/' . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php');
  18. if (file_exists($file)) {
  19. require_once $file;
  20. return true;
  21. }
  22. }
  23. return false;
  24. });
  25. // php-font-lib
  26. require_once __DIR__ . '/lib/php-font-lib/src/FontLib/Autoloader.php';
  27. //php-svg-lib
  28. require_once __DIR__ . '/lib/php-svg-lib/src/autoload.php';
  29. /*
  30. * New PHP 5.3.0 namespaced autoloader
  31. */
  32. require_once __DIR__ . '/src/Autoloader.php';
  33. Dompdf\Autoloader::register();