xref: /dokuwiki/vendor/composer/platform_check.php (revision 8e88a29b81301f78509349ab1152bb09c229123e)
16cb05674SAndreas Gohr<?php
26cb05674SAndreas Gohr
36cb05674SAndreas Gohr// platform_check.php @generated by Composer
46cb05674SAndreas Gohr
56cb05674SAndreas Gohr$issues = array();
66cb05674SAndreas Gohr
7*8e88a29bSAndreas Gohrif (!(PHP_VERSION_ID >= 80200)) {
8*8e88a29bSAndreas Gohr    $issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.';
96cb05674SAndreas Gohr}
106cb05674SAndreas Gohr
116cb05674SAndreas Gohrif ($issues) {
126cb05674SAndreas Gohr    if (!headers_sent()) {
136cb05674SAndreas Gohr        header('HTTP/1.1 500 Internal Server Error');
146cb05674SAndreas Gohr    }
156cb05674SAndreas Gohr    if (!ini_get('display_errors')) {
166cb05674SAndreas Gohr        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
176cb05674SAndreas Gohr            fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
186cb05674SAndreas Gohr        } elseif (!headers_sent()) {
196cb05674SAndreas 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;
206cb05674SAndreas Gohr        }
216cb05674SAndreas Gohr    }
22*8e88a29bSAndreas Gohr    throw new \RuntimeException(
23*8e88a29bSAndreas Gohr        'Composer detected issues in your platform: ' . implode(' ', $issues)
246cb05674SAndreas Gohr    );
256cb05674SAndreas Gohr}
26