Skip to content

Commit 86da543

Browse files
committed
Fix parsing extension name
1 parent 8d173cc commit 86da543

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

extension/BuildPhpExtension/private/Get-Extension.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ function Get-Extension {
5151
Copy-Item -Path "${subDirectory}\*" -Destination $currentDirectory -Recurse -Force
5252
Remove-Item -Path $subDirectory -Recurse -Force
5353
}
54-
$extensionLine = Get-Content -Path "config.w32" | Select-String -Pattern '\s+(ZEND_)?EXTENSION\(' | Select-Object -First 1
54+
$configW32Content = [string](Get-Content -Path "config.w32")
55+
$extensionLine = $configW32Content | Select-String -Pattern '\s+(ZEND_)?EXTENSION\(' | Select-Object -First 1
5556
if($null -eq $extensionLine) {
5657
throw "No extension found in config.w32"
5758
}
5859
$name = ($extensionLine -replace '.*EXTENSION\(([^,]+),.*', '$1') -replace '["'']', ''
60+
if ($configW32Content -match ($([regex]::Escape($name)) + '\s*=\s*["''](.+?)["'']')) {
61+
$name = $matches[1]
62+
}
5963

6064
# Apply patches only for php/php-windows-builder and shivammathur/php-windows-builder
6165
if($null -ne $env:GITHUB_REPOSITORY) {

0 commit comments

Comments
 (0)