Skip to content

Commit

Permalink
Revert "Drop custom autoload"
Browse files Browse the repository at this point in the history
This reverts commit aca3d1c.

Turns out this file is used by DomPdf for his manual autoloading
mechanism.
  • Loading branch information
PowerKiKi committed Oct 18, 2021
1 parent 69597ce commit f627771
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* @package php-svg-lib
* @link http://github.com/PhenX/php-svg-lib
* @author Fabien Ménager <fabien.menager@gmail.com>
* @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html
*/

spl_autoload_register(function($class) {
if (0 === strpos($class, "Svg")) {
$file = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$file = realpath(__DIR__ . DIRECTORY_SEPARATOR . $file . '.php');
if (file_exists($file)) {
include_once $file;
}
}
});

0 comments on commit f627771

Please sign in to comment.