forked from biati-digital/alfred-calculate-anything
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoload.php
26 lines (21 loc) · 847 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
<?php
require __DIR__ . '/vendor/autoload.php';
spl_autoload_register(function ($class) {
$class = str_replace('_', '-', $class);
$class = str_replace('\\CalculateAnything\\', '\\tools\\', $class);
$class = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$class = strtolower($class) . '.php';
$dir = __DIR__;
$file = $dir . '/' . $class;
if (is_readable($file)) {
include_once $file;
} else {
$libs = [
'olifolkerd/convertor/convertor.php' => $dir . '/workflow/lib/units/Convertor.php',
'olifolkerd/convertor/exceptions/convertorinvalidunitexception.php' => $dir . '/workflow/lib/units/Exceptions/ConvertorInvalidUnitException.php',
];
if (isset($libs[$class]) && is_readable($libs[$class])) {
include_once $libs[$class];
}
}
});