Created
May 21, 2026 22:48
-
-
Save retlehs/1f19f793b1f43348fe619ad9cbd6ba8f to your computer and use it in GitHub Desktop.
WooCommerce Shipping patch to avoid `psr/log` conflicts with Acorn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Detach bundled Psr\Log v1 from woocommerce-shipping. | |
| The plugin's Jetpack autoloader registers its own Psr\Log v1 classes via | |
| jetpack_autoload_classmap.php. When loaded before Acorn's vendor | |
| autoload, the v1 LoggerInterface wins and Monolog v3 (shipped by Acorn) | |
| fatals on the signature mismatch: | |
| Declaration of Monolog\Logger::emergency(Stringable|string $message, ...) | |
| must be compatible with Psr\Log\LoggerInterface::emergency($message, ...) | |
| Comment out the Psr\Log entries so the Jetpack autoloader skips them and | |
| Acorn's Psr\Log v3 is the only one autoloaded. The plugin's own logging | |
| uses WooCommerce's WC_Logger, which doesn't depend on these classes. | |
| --- a/vendor/composer/jetpack_autoload_classmap.php | |
| +++ b/vendor/composer/jetpack_autoload_classmap.php | |
| @@ -1150,50 +1150,50 @@ | |
| 'version' => '5.0.15', | |
| 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugins-handler.php' | |
| ), | |
| - 'Psr\\Log\\AbstractLogger' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php' | |
| - ), | |
| - 'Psr\\Log\\InvalidArgumentException' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php' | |
| - ), | |
| - 'Psr\\Log\\LogLevel' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php' | |
| - ), | |
| - 'Psr\\Log\\LoggerAwareInterface' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php' | |
| - ), | |
| - 'Psr\\Log\\LoggerAwareTrait' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php' | |
| - ), | |
| - 'Psr\\Log\\LoggerInterface' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php' | |
| - ), | |
| - 'Psr\\Log\\LoggerTrait' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php' | |
| - ), | |
| - 'Psr\\Log\\NullLogger' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php' | |
| - ), | |
| - 'Psr\\Log\\Test\\DummyTest' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php' | |
| - ), | |
| - 'Psr\\Log\\Test\\LoggerInterfaceTest' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php' | |
| - ), | |
| - 'Psr\\Log\\Test\\TestLogger' => array( | |
| - 'version' => '1.1.4.0', | |
| - 'path' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php' | |
| - ), | |
| + // 'Psr\\Log\\AbstractLogger' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php' | |
| + // ), | |
| + // 'Psr\\Log\\InvalidArgumentException' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php' | |
| + // ), | |
| + // 'Psr\\Log\\LogLevel' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php' | |
| + // ), | |
| + // 'Psr\\Log\\LoggerAwareInterface' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php' | |
| + // ), | |
| + // 'Psr\\Log\\LoggerAwareTrait' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php' | |
| + // ), | |
| + // 'Psr\\Log\\LoggerInterface' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php' | |
| + // ), | |
| + // 'Psr\\Log\\LoggerTrait' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php' | |
| + // ), | |
| + // 'Psr\\Log\\NullLogger' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php' | |
| + // ), | |
| + // 'Psr\\Log\\Test\\DummyTest' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php' | |
| + // ), | |
| + // 'Psr\\Log\\Test\\LoggerInterfaceTest' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php' | |
| + // ), | |
| + // 'Psr\\Log\\Test\\TestLogger' => array( | |
| + // 'version' => '1.1.4.0', | |
| + // 'path' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php' | |
| + // ), | |
| 'ShipmentFromLabelGeneratorTest' => array( | |
| 'version' => 'dev-trunk', | |
| 'path' => $baseDir . '/tests/php/Shipment/ShipmentFromLabelGeneratorTest.php' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment