| @@ -1,12 +1,21 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // platform_check.php @generated by Composer |
| 4 | +// Modified for Charitable plugin to conditionally apply PHP requirements | |
| 4 | 5 | |
| 6 | +// Define a constant that can be checked elsewhere | |
| 7 | +if (!defined('CHARITABLE_SQUARE_AVAILABLE')) { | |
| 8 | + define('CHARITABLE_SQUARE_AVAILABLE', PHP_VERSION_ID >= 80100); | |
| 9 | +} | |
| 10 | + | |
| 11 | +// Only enforce PHP version requirement if Square is being used | |
| 12 | +$skipVersionCheck = !CHARITABLE_SQUARE_AVAILABLE; | |
| 13 | + | |
| 5 | 14 | $issues = array(); |
| 6 | 15 | |
| 7 | -if (!(PHP_VERSION_ID >= 50600)) { | |
| 8 | - $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.'; | |
| 16 | +if (!$skipVersionCheck && !(PHP_VERSION_ID >= 80100)) { | |
| 17 | + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; | |
| 9 | 18 | } |
| 10 | 19 | |
| 11 | 20 | if ($issues) { |
| 12 | 21 | if (!headers_sent()) { |