/
binary-phar-autoload.php.in
55 lines (41 loc) · 1.13 KB
/
binary-phar-autoload.php.in
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
#!/usr/bin/env php
<?php
if (version_compare('7.2.0', PHP_VERSION, '>')) {
fwrite(
STDERR,
sprintf(
'PHPUnit X.Y.Z by Sebastian Bergmann and contributors.' . PHP_EOL . PHP_EOL .
'This version of PHPUnit is supported on PHP 7.2 and PHP 7.3.' . PHP_EOL .
'You are using PHP %s (%s).' . PHP_EOL,
PHP_VERSION,
PHP_BINARY
)
);
die(1);
}
if (__FILE__ === realpath($GLOBALS['_SERVER']['SCRIPT_NAME'])) {
$execute = true;
} else {
$execute = false;
}
$options = getopt('', array('prepend:', 'manifest'));
if (isset($options['prepend'])) {
require $options['prepend'];
}
if (isset($options['manifest'])) {
$printManifest = true;
}
unset($options);
define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', __FILE__));
define('__PHPUNIT_PHAR_ROOT__', 'phar://___PHAR___');
Phar::mapPhar('___PHAR___');
___FILELIST___
if ($execute) {
if (isset($printManifest)) {
print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt');
exit;
}
unset($execute);
PHPUnit\TextUI\Command::main();
}
__HALT_COMPILER();