Skip to content

Commit 9a64214

Browse files
committed
fix: Windows embed SAPI, archive extraction, and libxml2 compat
- Fix php-cs-fixer style issues (single-quote escapes, pre-increment) - Add secur32.lib to LDFLAGS for php8ts.dll (curl SSPI support) - Strip removed libxml2 symbols from .def by scanning headers - Respect #ifdef LIBXML_*_ENABLED guards for disabled features - Two-step archive extraction using Windows native tar
1 parent 0f63cb6 commit 9a64214

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/SPC/builder/windows/WindowsBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function buildEmbed(): void
223223
foreach (['main', 'Zend', 'TSRM', 'sapi', 'ext'] as $dir) {
224224
$src_dir = "{$php_src}\\{$dir}";
225225
if (is_dir($src_dir)) {
226-
cmd()->exec("xcopy /E /I /Y " . escapeshellarg($src_dir . '\\*.h') . ' ' . escapeshellarg($include_dst . '\\' . $dir . '\\'));
226+
cmd()->exec('xcopy /E /I /Y ' . escapeshellarg($src_dir . '\*.h') . ' ' . escapeshellarg($include_dst . '\\' . $dir . '\\'));
227227
}
228228
}
229229
// Copy generated config header

src/SPC/store/FileSystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ private static function extractArchive(string $filename, string $target): void
646646
if (!file_exists($tarFile)) {
647647
$tarFile .= '.tar';
648648
}
649-
$winTar = getenv('SystemRoot') . '\\System32\\tar.exe';
649+
$winTar = getenv('SystemRoot') . '\System32\tar.exe';
650650
f_passthru("\"{$winTar}\" -xf \"{$tarFile}\" -C \"{$target}\" --strip-components 1");
651651
@unlink($tarFile);
652652
})(),

src/SPC/store/SourcePatcher.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,12 @@ public static function patchLibxml2DefForWindows(): void
675675
$trimmed = ltrim($hline);
676676
// Track #ifdef/#ifndef LIBXML_*_ENABLED blocks
677677
if (preg_match('/^#\s*if(?:def|ndef)?\s+.*?(LIBXML_\w+_ENABLED)/', $trimmed, $im)) {
678-
$ifdef_depth++;
678+
++$ifdef_depth;
679679
if (isset($disabled_features[$im[1]])) {
680680
$disabled_depth = $ifdef_depth;
681681
}
682682
} elseif (preg_match('/^#\s*if\b/', $trimmed)) {
683-
$ifdef_depth++;
683+
++$ifdef_depth;
684684
} elseif (preg_match('/^#\s*endif/', $trimmed)) {
685685
if ($ifdef_depth === $disabled_depth) {
686686
$disabled_depth = 0;
@@ -721,7 +721,7 @@ public static function patchLibxml2DefForWindows(): void
721721
if ($sym === '' || $sym === 'EXPORTS' || str_starts_with($sym, ';') || isset($header_symbols[$sym])) {
722722
$filtered[] = $line;
723723
} else {
724-
$removed++;
724+
++$removed;
725725
}
726726
}
727727

0 commit comments

Comments
 (0)