autoload.inc.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. require_once __DIR__ . '/lib/html5lib/Parser.php';
  11. // Sabberworm
  12. spl_autoload_register(function($class)
  13. {
  14. if (strpos($class, 'Sabberworm') !== false) {
  15. $file = str_replace('\\', DIRECTORY_SEPARATOR, $class);
  16. $file = realpath(__DIR__ . '/lib/php-css-parser/lib/' . (empty($file) ? '' : DIRECTORY_SEPARATOR) . $file . '.php');
  17. if (file_exists($file)) {
  18. require_once $file;
  19. return true;
  20. }
  21. }
  22. return false;
  23. });
  24. // php-font-lib
  25. require_once __DIR__ . '/lib/php-font-lib/src/FontLib/Autoloader.php';
  26. //php-svg-lib
  27. require_once __DIR__ . '/lib/php-svg-lib/src/autoload.php';
  28. /*
  29. * New PHP 5.3.0 namespaced autoloader
  30. */
  31. require_once __DIR__ . '/src/Autoloader.php';
  32. Dompdf\Autoloader::register();