diff --git a/bin/terminus.php b/bin/terminus.php index 1b5a18740..211ec107b 100755 --- a/bin/terminus.php +++ b/bin/terminus.php @@ -12,10 +12,15 @@ // Unset memory limit ini_set('memory_limit', -1); -if (version_compare(PHP_VERSION, '8.2.0', '<') === true) { +// Look up minimum PHP version from composer.json. +$composer_json_contents = file_get_contents(dirname(__DIR__) . '/composer.json'); +$composer_json_data = json_decode($composer_json_contents, true); +$min_php_version = $composer_json_data['config']['platform']['php']; + +if (version_compare(PHP_VERSION, $min_php_version, '<') === true) { fwrite(STDERR, "\n"); fwrite(STDERR, 'Sorry, your PHP version (' . PHP_VERSION . ') is no longer supported.' . "\n"); - fwrite(STDERR, 'Upgrade to PHP 8.2 or newer to use Terminus 4. For PHP versions prior to 8.2, downgrade to Terminus 3.x.' . "\n\n"); + fwrite(STDERR, 'Upgrade to PHP ' . $min_php_version . ' or newer to use Terminus 4. For prior PHP versions, downgrade to Terminus 3.x.' . "\n\n"); fwrite(STDERR, 'For more information, see https://pantheon.io/docs/terminus/updates#php-version-compatibility-matrix' . "\n\n"); exit(1); } diff --git a/composer.lock b/composer.lock index bb49e874a..a187dc217 100644 --- a/composer.lock +++ b/composer.lock @@ -3351,22 +3351,23 @@ "packages-dev": [ { "name": "behat/behat", - "version": "v3.16.0", + "version": "v3.17.0", "source": { "type": "git", "url": "https://github.com/Behat/Behat.git", - "reference": "18f5f44c80d1cf5711ec27019afcb26b8bc6c3b0" + "reference": "3eb5ebae08db4e44ca6a458ba0f449dda753c465" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/18f5f44c80d1cf5711ec27019afcb26b8bc6c3b0", - "reference": "18f5f44c80d1cf5711ec27019afcb26b8bc6c3b0", + "url": "https://api.github.com/repos/Behat/Behat/zipball/3eb5ebae08db4e44ca6a458ba0f449dda753c465", + "reference": "3eb5ebae08db4e44ca6a458ba0f449dda753c465", "shasum": "" }, "require": { "behat/gherkin": "^4.10.0", "behat/transliterator": "^1.5", "composer-runtime-api": "^2.2", + "composer/xdebug-handler": "^3.0", "ext-mbstring": "*", "php": "8.1.* || 8.2.* || 8.3.* || 8.4.* ", "psr/container": "^1.0 || ^2.0", @@ -3380,9 +3381,10 @@ "require-dev": { "herrera-io/box": "~1.6.1", "phpunit/phpunit": "^9.6", + "sebastian/diff": "^4.0", "symfony/polyfill-php84": "^1.31", "symfony/process": "^5.4 || ^6.4 || ^7.0", - "vimeo/psalm": "^4.8" + "vimeo/psalm": "^5.0" }, "suggest": { "ext-dom": "Needed to output test results in JUnit format." @@ -3401,7 +3403,9 @@ "Behat\\Hook\\": "src/Behat/Hook/", "Behat\\Step\\": "src/Behat/Step/", "Behat\\Behat\\": "src/Behat/Behat/", - "Behat\\Testwork\\": "src/Behat/Testwork/" + "Behat\\Config\\": "src/Behat/Config/", + "Behat\\Testwork\\": "src/Behat/Testwork/", + "Behat\\Transformation\\": "src/Behat/Transformation/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3433,9 +3437,9 @@ ], "support": { "issues": "https://github.com/Behat/Behat/issues", - "source": "https://github.com/Behat/Behat/tree/v3.16.0" + "source": "https://github.com/Behat/Behat/tree/v3.17.0" }, - "time": "2024-11-08T12:25:17+00:00" + "time": "2024-12-18T10:27:06+00:00" }, { "name": "behat/gherkin",