Skip to content

Windows: Add hardening when renaming Phar during update#6297

Open
swissspidy wants to merge 16 commits intomainfrom
fix/harden-update
Open

Windows: Add hardening when renaming Phar during update#6297
swissspidy wants to merge 16 commits intomainfrom
fix/harden-update

Conversation

@swissspidy
Copy link
Copy Markdown
Member

No description provided.

@swissspidy swissspidy added scope:distribution Related to distribution command:cli-update Related to 'cli update' command os:windows labels Apr 8, 2026
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the bug label Apr 8, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 0% with 54 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
php/commands/src/CLI_Command.php 0.00% 54 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy swissspidy added this to the 3.0.0 milestone Apr 8, 2026
gemini-code-assist[bot]

This comment was marked as resolved.

@swissspidy swissspidy marked this pull request as ready for review April 13, 2026 14:35
@swissspidy swissspidy requested a review from a team as a code owner April 13, 2026 14:35
Copilot AI review requested due to automatic review settings April 13, 2026 14:35

This comment was marked as resolved.

swissspidy and others added 2 commits April 16, 2026 18:14
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

This comment was marked as resolved.

swissspidy and others added 5 commits April 16, 2026 18:26
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

This comment was marked as resolved.

swissspidy and others added 5 commits April 16, 2026 23:26
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@swissspidy
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Phar update process by introducing a replace_current_phar method, which includes specialized logic for Windows to handle file replacement safely via backups and restoration. It also normalizes the temporary file path using realpath. A critical compatibility issue was identified regarding the use of error_clear_last(), which is unavailable in PHP 5.6 and would cause a fatal error on older environments.

Comment thread php/commands/src/CLI_Command.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug command:cli-update Related to 'cli update' command os:windows scope:distribution Related to distribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants