Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 991 | Zur aktuellen Revision | Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
#!/usr/bin/env php
2
<?php declare(strict_types=1);
3
/*
4
 * This file is part of PHPUnit.
5
 *
6
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
if (!version_compare(PHP_VERSION, PHP_VERSION, '=')) {
13
    fwrite(
14
        STDERR,
15
        sprintf(
16
            '%s declares an invalid value for PHP_VERSION.' . PHP_EOL .
17
            'This breaks fundamental functionality such as version_compare().' . PHP_EOL .
18
            'Please use a different PHP interpreter.' . PHP_EOL,
19
 
20
            PHP_BINARY
21
        )
22
    );
23
 
24
    die(1);
25
}
26
 
27
if (version_compare('7.3.0', PHP_VERSION, '>')) {
28
    fwrite(
29
        STDERR,
30
        sprintf(
31
            'This version of PHPUnit requires PHP >= 7.3.' . PHP_EOL .
32
            'You are using PHP %s (%s).' . PHP_EOL,
33
            PHP_VERSION,
34
            PHP_BINARY
35
        )
36
    );
37
 
38
    die(1);
39
}
40
 
41
foreach (['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'] as $extension) {
42
    if (extension_loaded($extension)) {
43
        continue;
44
    }
45
 
46
    fwrite(
47
        STDERR,
48
        sprintf(
49
            'PHPUnit requires the "%s" extension.' . PHP_EOL,
50
            $extension
51
        )
52
    );
53
 
54
    die(1);
55
}
56
 
57
if (!ini_get('date.timezone')) {
58
    ini_set('date.timezone', 'UTC');
59
}
60
 
61
if (isset($GLOBALS['_composer_autoload_path'])) {
62
    define('PHPUNIT_COMPOSER_INSTALL', $GLOBALS['_composer_autoload_path']);
63
 
64
    unset($GLOBALS['_composer_autoload_path']);
65
} else {
66
    foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
67
        if (file_exists($file)) {
68
            define('PHPUNIT_COMPOSER_INSTALL', $file);
69
 
70
            break;
71
        }
72
    }
73
 
74
    unset($file);
75
}
76
 
77
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
78
    fwrite(
79
        STDERR,
80
        'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
81
        '    composer install' . PHP_EOL . PHP_EOL .
82
        'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
83
    );
84
 
85
    die(1);
86
}
87
 
88
$options = getopt('', array('prepend:'));
89
 
90
if (isset($options['prepend'])) {
91
    require $options['prepend'];
92
}
93
 
94
unset($options);
95
 
96
require PHPUNIT_COMPOSER_INSTALL;
97
 
98
PHPUnit\TextUI\Command::main();