Repository navigation
Leave psr/log out of the Phar - #1220
swissspidy wants to merge 1 commit into
Conversation
wp-cli/wp-cli#6439 requires composer/xdebug-handler, which pulls in psr/log. Its logger is never set, so psr/log isn't needed at runtime. Leaving it and its autoload map entries out means WP-CLI's autoloader never answers for Psr\Log, so plugins can load their own version (see wp-cli/wp-cli#4632 and #5920). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Companion to wp-cli/wp-cli#6439, which restarts PHP with OPcache's file cache via
composer/xdebug-handler. That bringscomposer/pcreandpsr/logback into WP-CLI's runtime dependencies now thatcomposer/composeris gone (wp-cli/package-command#248).A bundled
psr/logv1 is a known source of clashes with plugins that shippsr/logv2/v3 (wp-cli/wp-cli#4632, wp-cli/wp-cli#5920): WP-CLI's autoloader can answer forPsr\Logfirst. xdebug-handler never has a logger set (setLogger()isn't called), sopsr/logisn't needed at runtime.This leaves
vendor/psr/logout of the Phar and strips its entries from the autoload maps, so WP-CLI's autoloader never answers forPsr\Log. Otherpsr/*packages are kept as before.Draft until wp-cli/wp-cli#6439 is merged and the bundle picks up
composer/xdebug-handler. Until then the bundle has nopsr/log, so this changes nothing yet. The autoload strip pattern was checked against sample classmap, PSR-4 and static-loader lines; a full Phar build withpsr/logpresent hasn't been run yet.Generated by Claude Code
Summary by CodeRabbit