Skip to content

Commit 37b4df9

Browse files
committed
Fix Add-Extension
1 parent c55a37e commit 37b4df9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

extension/BuildPhpExtension/private/Add-Extension.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@ Function Add-Extension {
2424
# TODO: Replace fetching the extension using the new extension tool
2525
Invoke-WebRequest -Uri "https://pecl.php.net/get/$Extension" -OutFile "$Extension.tgz"
2626
$currentDirectory = (Get-Location).Path
27-
Expand-Archive "$Extension.tgz" -DestinationPath $currentDirectory
27+
& tar -xzf "$Extension.tgz" -C $currentDirectory
2828
Set-Location "$Extension-*"
29-
& phpize
30-
.\configure.bat --with-php-build=..\..\deps $Config.options --with-prefix=$Prefix
31-
& nmake
32-
& nmake install
29+
$bat_content = @()
30+
$bat_content += ""
31+
$bat_content += "call phpize 2>&1"
32+
$bat_content += "call configure --with-php-build=`"..\deps`" $($Config.options) --with-prefix=$Prefix 2>&1"
33+
$bat_content += "nmake /nologo 2>&1"
34+
$bat_content += "exit %errorlevel%"
35+
Set-Content -Encoding "ASCII" -Path $Extension-task.bat -Value $bat_content
36+
$builder = "$currentDirectory\php-sdk\phpsdk-$($Config.vs_version)-$($Config.Arch).bat"
37+
$task = (Get-Item -Path "." -Verbose).FullName + "\$Extension-task.bat"
38+
& $builder -t $task
3339
Set-Location $currentDirectory
3440
}
3541
end {

0 commit comments

Comments
 (0)