This repository has been archived by the owner on Dec 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
autoload-dev.php
41 lines (38 loc) · 1.61 KB
/
autoload-dev.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
31
32
33
34
35
36
37
38
39
40
41
<?php
// Override Composer packages with the files from the repository. This is very
// helpful in development, so you can test without having to publish a bunch of
// package versions.
require __DIR__.'/server/vendor/autoload.php';
require __DIR__.'/pubsub/vendor/autoload.php';
require __DIR__.'/tilmeld-server/vendor/autoload.php';
(function () {
$classMap = [];
foreach (glob(__DIR__.'/server/src/Drivers/*.php') as $file) {
$classMap['Nymph\\Drivers\\'.basename($file, '.php')] = $file;
}
foreach (glob(__DIR__.'/server/src/Exceptions/*.php') as $file) {
$classMap['Nymph\\Exceptions\\'.basename($file, '.php')] = $file;
}
foreach (glob(__DIR__.'/server/src/*.php') as $file) {
$classMap['Nymph\\'.basename($file, '.php')] = $file;
}
foreach (glob(__DIR__.'/pubsub/src/*.php') as $file) {
$classMap['Nymph\\PubSub\\'.basename($file, '.php')] = $file;
}
foreach (glob(__DIR__.'/tilmeld-server/src/Entities/Mail/*.php') as $file) {
$classMap['Tilmeld\\Entities\\Mail\\'.basename($file, '.php')] = $file;
}
foreach (glob(__DIR__.'/tilmeld-server/src/Entities/*.php') as $file) {
$classMap['Tilmeld\\Entities\\'.basename($file, '.php')] = $file;
}
foreach (glob(__DIR__.'/tilmeld-server/src/Exceptions/*.php') as $file) {
$classMap['Tilmeld\\Exceptions\\'.basename($file, '.php')] = $file;
}
foreach (glob(__DIR__.'/tilmeld-server/src/*.php') as $file) {
$classMap['Tilmeld\\'.basename($file, '.php')] = $file;
}
spl_autoload_register(function ($className) use ($classMap) {
if (isset($classMap[$className]))
include $classMap[$className];
}, true, true);
})();