-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathautoload.php
30 lines (30 loc) · 890 Bytes
/
autoload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* autoload.php
*
* Autoloader for Tecnick.com libraries
*
* @since 2015-03-04
* @category Library
* @package PdfParser
* @author Nicola Asuni <[email protected]>
* @copyright 2015-2024 Nicola Asuni - Tecnick.com LTD
* @license http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* @link https://github.com/tecnickcom/tc-lib-pdf-parser
*
* This file is part of tc-lib-pdf-parser software library.
*/
spl_autoload_register(
function ($class) {
$prefix = 'Com\\Tecnick\\';
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
return;
}
$relative_class = substr($class, $len);
$file = dirname(dirname(__DIR__)).'/'.str_replace('\\', '/', $relative_class).'.php';
if (file_exists($file)) {
require $file;
}
}
);