summaryrefslogtreecommitdiffstats
path: root/library/vendor/iplx/Loader.php
blob: 5a6c9c037f23a3c761b5fc0079b20c89369d6271 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

spl_autoload_register(function ($class) {
    $prefix = 'iplx\\';
    $len = strlen($prefix);

    $baseDir = __DIR__ . '/';

    if (strncmp($prefix, $class, $len) !== 0) {
        return;
    }

    $relative = substr($class, $len);

    $file = $baseDir . str_replace('\\', '/', $relative) . '.php';

    if (file_exists($file)) {
        require $file;
    }
});