Skip to content

Commit f627771

Browse files
committed
Revert "Drop custom autoload"
This reverts commit aca3d1c. Turns out this file is used by DomPdf for his manual autoloading mechanism.
1 parent 69597ce commit f627771

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/autoload.php

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

0 commit comments

Comments
 (0)