Add minimum PHP guard to Phar bootstrap#1089
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PHAR bootstrap now rejects PHP versions below 7.2.24, and CI verifies this behavior on PHP 5.6 and 7.1 by checking stdout and stderr output. ChangesMinimum PHP version guard
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant CI as minimum-php-guard
participant PHP as PHP runtime
participant Boot as php/boot-phar.php
participant Files as stdout.txt/stderr.txt
CI->>PHP: Run PHP 5.6 or 7.1
PHP->>Boot: Execute bootstrap
Boot->>Boot: Check PHP_VERSION < 7.2.24
Boot->>Files: Write error to stderr.txt
Boot-->>PHP: Exit with status -1
CI->>Files: Compare captured output with expected.txt
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8).github/workflows/testing.ymlTraceback (most recent call last): Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/testing.yml:
- Around line 25-26: Update the actions/checkout step in the testing workflow to
set persist-credentials to false, ensuring the checkout action does not retain
the GITHUB_TOKEN for subsequent PR-controlled job steps.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3797408a-812d-4c70-a5cd-4b8f0ef5a58e
📒 Files selected for processing (2)
.github/workflows/testing.ymlphp/boot-phar.php
Context
The filesystem bootstrap (
php/boot-fs.php) rejects PHP versions older than 7.2.24, but that file is not loaded by the Phar. The generated stub includesphp/boot-phar.php, which loadsphp/wp-cli.phpdirectly.boot-fs.phpis only present in the archive because the framework package is bundled.This initially looked like a release-critical safety gap for already shipped 2.x self-updaters. A deeper check showed that:
platform_check.php, which enforces that requirement.--infoand only replaces the existing Phar when that command succeeds.The explicit guard is therefore defense-in-depth and a clearer diagnostic, rather than the only barrier preventing an unsupported update.
Changes
boot-phar.phpbefore loading the framework.Testing
composer lintcomposer phpcscomposer phpstancomposer phpunitcomposer behat(53 scenarios,600 steps)Summary by CodeRabbit