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