From 75a7b21a6ff15ccbbe3dea5abf43af141f25dc59 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 12 Apr 2026 16:05:20 +0800 Subject: [PATCH] Add patch to ensure ext/json MINIT runs before ext/decimal on Windows static builds --- src/Package/Extension/decimal.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Package/Extension/decimal.php b/src/Package/Extension/decimal.php index 147f7388..c5059e2e 100644 --- a/src/Package/Extension/decimal.php +++ b/src/Package/Extension/decimal.php @@ -26,4 +26,16 @@ class decimal extends PhpExtensionPackage 'zend_module_entry php_decimal_module_entry' ); } + + #[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-decimal')] + #[PatchDescription('Ensure ext/json MINIT runs before ext/decimal on Windows static builds')] + public function patchConfigW32(): void + { + FileSystem::replaceFileStr( + $this->getSourceDir() . '/config.w32', + 'ARG_WITH("decimal", "for decimal support", "no");', + 'ARG_WITH("decimal", "for decimal support", "no");' . "\n" . + 'ADD_EXTENSION_DEP("decimal", "json");' + ); + } }