Skip to content

Only ask PHP for its OS where a Windows path can be needed - #6442

Draft
schlessera wants to merge 1 commit into
mainfrom
perf/launcher-php-probe
Draft

schlessera wants to merge 1 commit into
mainfrom
perf/launcher-php-probe

Conversation

@schlessera

Copy link
Copy Markdown
Member

Addresses wp-cli/wp-cli-tests#389.

The wp launcher starts PHP twice on every invocation: once to run php -r "echo PHP_OS;", and once to run WP-CLI. The first one only matters when a Windows PHP is run from Cygwin or MSYS, where the script path has to be converted with cygpath.

The check now only runs where cygpath is available, so Cygwin and MSYS behave as before, and every other environment saves a PHP process per command. Locally, wp cli version went from about 102 ms to 81 ms. The test suites of the bundled commands make well over 10,000 wp calls per run.

Measurements are recorded on wp-cli/wp-cli-tests#389.

The launcher started an extra PHP process on every invocation to check
whether PHP runs on Windows, which only matters when a Windows PHP is run
from Cygwin or MSYS. Skip the check where cygpath is not available.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant