xref: /plugin/statistics/vendor/composer/platform_check.php (revision d5ef99ddb7dfb0cfae33e9257bd1d788f682c50f) !
1*d5ef99ddSAndreas Gohr<?php
2*d5ef99ddSAndreas Gohr
3*d5ef99ddSAndreas Gohr// platform_check.php @generated by Composer
4*d5ef99ddSAndreas Gohr
5*d5ef99ddSAndreas Gohr$issues = array();
6*d5ef99ddSAndreas Gohr
7*d5ef99ddSAndreas Gohrif (!(PHP_VERSION_ID >= 70200)) {
8*d5ef99ddSAndreas Gohr    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.';
9*d5ef99ddSAndreas Gohr}
10*d5ef99ddSAndreas Gohr
11*d5ef99ddSAndreas Gohrif ($issues) {
12*d5ef99ddSAndreas Gohr    if (!headers_sent()) {
13*d5ef99ddSAndreas Gohr        header('HTTP/1.1 500 Internal Server Error');
14*d5ef99ddSAndreas Gohr    }
15*d5ef99ddSAndreas Gohr    if (!ini_get('display_errors')) {
16*d5ef99ddSAndreas Gohr        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
17*d5ef99ddSAndreas Gohr            fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
18*d5ef99ddSAndreas Gohr        } elseif (!headers_sent()) {
19*d5ef99ddSAndreas Gohr            echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
20*d5ef99ddSAndreas Gohr        }
21*d5ef99ddSAndreas Gohr    }
22*d5ef99ddSAndreas Gohr    trigger_error(
23*d5ef99ddSAndreas Gohr        'Composer detected issues in your platform: ' . implode(' ', $issues),
24*d5ef99ddSAndreas Gohr        E_USER_ERROR
25*d5ef99ddSAndreas Gohr    );
26*d5ef99ddSAndreas Gohr}
27