-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoload.php
executable file
·69 lines (53 loc) · 1.79 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
declare(strict_types=1);
// ----------------------------------------------------------------------------
// PHP version
// ----------------------------------------------------------------------------
if (! version_compare(PHP_VERSION, PHP_VERSION, '=')) {
fwrite(STDERR, "
" . PHP_BINARY . " declares an invalid value for PHP_VERSION.
This breaks fundamental functionality such as version_compare().
Please use a different PHP interpreter.
\r");
die(1);
}
if (version_compare('8.1.0', PHP_VERSION, '>')) {
fwrite(STDERR, "
This version of PHPUnit requires PHP >= 8.1.
You are using PHP " . PHP_VERSION . " (" . PHP_BINARY . ").
\r");
die(1);
}
// ----------------------------------------------------------------------------
// Timezone
// ----------------------------------------------------------------------------
if (! ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}
// ----------------------------------------------------------------------------
// Autoload
// ----------------------------------------------------------------------------
if (isset($GLOBALS['_composer_autoload_path'])) {
define('CROSS_AUTOLOAD_PATH', $GLOBALS['_composer_autoload_path']);
} else {
$files = [
__DIR__ . '/../../autoload.php',
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/vendor/autoload.php',
];
foreach ($files as $file) {
if (file_exists($file)) {
define('CROSS_AUTOLOAD_PATH', $file);
break;
}
}
}
if (! defined('CROSS_AUTOLOAD_PATH')) {
fwrite(STDERR, "
You need to set up the project dependencies using Composer:
composer install
You can learn all about Composer on https://getcomposer.org/.
\r");
die(1);
}
require CROSS_AUTOLOAD_PATH;