Skip to content

Commit 0b14aa6

Browse files
committed
Fix building dependency extensions
1 parent 3c94cc7 commit 0b14aa6

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

extension/BuildPhpExtension/private/Add-Extension.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Function Add-Extension {
2121
begin {
2222
}
2323
process {
24-
# TODO: Replace fetching the extension using the new extension tool
24+
Set-GAGroup start
2525
Invoke-WebRequest -Uri "https://pecl.php.net/get/$Extension" -OutFile "$Extension.tgz"
2626
$currentDirectory = (Get-Location).Path
2727
& tar -xzf "$Extension.tgz" -C $currentDirectory
@@ -38,7 +38,7 @@ Function Add-Extension {
3838
$bat_content = @()
3939
$bat_content += ""
4040
$bat_content += "call phpize 2>&1"
41-
$bat_content += "call configure --with-php-build=`"..\deps`" $($Config.options) --with-prefix=$Prefix 2>&1"
41+
$bat_content += "call configure --with-php-build=`"..\deps`" $($Config.options) --with-mp=`"disable`" --with-prefix=$Prefix 2>&1"
4242
$bat_content += "nmake /nologo 2>&1"
4343
$bat_content += "exit %errorlevel%"
4444
Set-Content -Encoding "ASCII" -Path $Extension-task.bat -Value $bat_content
@@ -52,14 +52,16 @@ Function Add-Extension {
5252
$Config.vs_version,
5353
$Config.arch
5454
) -join "-")
55-
& $builder -c $Config.vs_version -a $Config.Arch -t $task | Tee-Object -FilePath "build-$suffix.txt"
55+
& $builder -c $Config.vs_version -a $Config.Arch -s $Config.vs_toolset -t $task | Tee-Object -FilePath "build-$suffix.txt"
56+
Write-Host (Get-Content "build-$suffix.txt" -Raw)
5657
$includePath = "$currentDirectory\php-dev\include"
5758
New-Item -Path $includePath\ext -Name $Extension -ItemType "directory" | Out-Null
5859
Get-ChildItem -Path (Get-Location).Path -Recurse -Include '*.h', '*.c' | Copy-Item -Destination "$includePath\ext\$Extension"
5960
Copy-Item -Path "$extensionBuildDirectory\*.dll" -Destination "$currentDirectory\php-bin\ext" -Force
6061
Copy-Item -Path "$extensionBuildDirectory\*.lib" -Destination "$currentDirectory\php-dev\lib" -Force
6162
Add-Content -Path "$currentDirectory\php-bin\php.ini" -Value "extension=$Extension"
6263
Set-Location $currentDirectory
64+
Set-GAGroup end
6365
}
6466
end {
6567
}

extension/BuildPhpExtension/private/Get-ExtensionConfig.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ Function Get-ExtensionConfig {
111111
$composerJson."require" | ForEach-Object {
112112
$_.PSObject.Properties | ForEach-Object {
113113
if($_.Name -match "ext-") {
114-
$extension = $_.Name.replace("ext-", "")
114+
$requiredExtension = $_.Name.replace("ext-", "")
115115
if($_.Value -match "\d+\.\d+.*") {
116-
$extension += "-$($_.Value)"
116+
$requiredExtension += "-$($_.Value)"
117117
}
118-
$config.extensions += $extension
118+
$config.extensions += $requiredExtension
119119
} elseif(-not($_.Name -match "php")) {
120120
# If using the stub composer.json
121121
$Libraries += $_.Name

0 commit comments

Comments
 (0)