Skip to content

Commit af0d4b5

Browse files
authored
Update Get-ExtensionConfig.ps1
1 parent 0a7831f commit af0d4b5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

extension/BuildPhpExtension/private/Get-ExtensionConfig.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,15 @@ Function Get-ExtensionConfig {
9191
$composerJson = Get-Content composer.json -Raw | ConvertFrom-Json
9292
}
9393
if($null -ne $composerJson -and $null -ne $composerJson."php-ext" -and $null -ne $composerJson."php-ext"."configure-options") {
94+
$normalizedExtension = $Extension.ToLower().Replace("_", "-")
9495
$composerJson."php-ext"."configure-options" | ForEach-Object {
95-
if($null -ne $_."needs-value" -and $_."needs-value" -eq $true -and $_.name -eq "with-$($Extension.ToLower())") {
96-
$config.options += "--$($_.name)=shared"
97-
} else {
98-
$config.options += "--$( $_.name )"
96+
$normalizedName = $_.name.ToLower().Replace("_", "-")
97+
if($normalizedName -eq "enable-$normalizedExtension" -or $normalizedName -eq "with-$normalizedExtension") {
98+
if($null -ne $_."needs-value" -and $_."needs-value" -eq $true -and $normalizedName -eq "with-$normalizedExtension") {
99+
$config.options += "--$($_.name)=shared"
100+
} else {
101+
$config.options += "--$( $_.name )"
102+
}
99103
}
100104
}
101105
}

0 commit comments

Comments
 (0)