forked from Codeception/Codeception
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoload.php
40 lines (32 loc) · 1.01 KB
/
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
34
35
36
37
38
39
<?php
require_once __DIR__ .'/vendor/UniversalClassLoader.php';
// for PHAR/PEAR/Git
if (file_exists(__DIR__.'/vendor/autoload.php')) {
$namespaceMap = require_once __DIR__.'/vendor/composer/autoload_namespaces.php';
$classesMap = require_once __DIR__.'/vendor/composer/autoload_classmap.php';
$loader = new UniversalClassLoader();
$loader->registerNamespaces(
array(
'Codeception' => __DIR__ . '/src'
)
);
$loader->registerNamespaces($namespaceMap);
$loader->register(true);
spl_autoload_register(
function ($class) use ($classesMap) {
if (isset($classesMap[$class])) {
require $classesMap[$class];
}
},
true
);
// for Composer
} elseif (stream_resolve_include_path(__DIR__.'/../../autoload.php')) {
require_once __DIR__ . '/../../autoload.php';
}
/** spike-fix for PHP 5.3 */
if (! interface_exists('JsonSerializable')) {
interface JsonSerializable {
function jsonSerialize();
}
}