forked from pagekit/pagekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoload.php
33 lines (25 loc) · 962 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
31
32
33
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = require __DIR__ . '/app/vendor/autoload.php';
if (file_exists(__DIR__ . '/packages/autoload.php')) {
$map = require __DIR__ . '/packages/composer/autoload_namespaces.php';
foreach ($map as $namespace => $p) {
$loader->set($namespace, $p);
}
$map = require __DIR__ . '/packages/composer/autoload_psr4.php';
foreach ($map as $namespace => $p) {
$loader->setPsr4($namespace, $p);
}
$classMap = require __DIR__ . '/packages/composer/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
if (file_exists(__DIR__ . '/packages/composer/autoload_files.php')) {
$includeFiles = require __DIR__ . '/packages/composer/autoload_files.php';
foreach ($includeFiles as $file) {
require $file;
}
}
}
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;