autoload.php 483 B

1234567891011121314151617
  1. <?php
  2. /**
  3. * @package php-svg-lib
  4. * @link http://github.com/PhenX/php-svg-lib
  5. * @author Fabien Ménager <fabien.menager@gmail.com>
  6. * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html
  7. */
  8. spl_autoload_register(function($class) {
  9. if (0 === strpos($class, "Svg")) {
  10. $file = str_replace('\\', DIRECTORY_SEPARATOR, $class);
  11. $file = realpath(__DIR__ . DIRECTORY_SEPARATOR . $file . '.php');
  12. if (file_exists($file)) {
  13. include_once $file;
  14. }
  15. }
  16. });