Skip to content

Commit 174713c

Browse files
committed
Fix extension dependency
1 parent 5544977 commit 174713c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

extension/BuildPhpExtension/private/Add-Extension.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Function Add-Extension {
2626
$currentDirectory = (Get-Location).Path
2727
& tar -xzf "$Extension.tgz" -C $currentDirectory
2828
Set-Location "$Extension-*"
29+
$extensionBuildDirectory = Join-Path -Path (Get-Location).Path -ChildPath $config.build_directory
2930
# Apply patches only for php/php-windows-builder and shivammathur/php-windows-builder
3031
if($null -ne $env:GITHUB_REPOSITORY) {
3132
if($env:GITHUB_REPOSITORY -eq 'php/php-windows-builder' -or $env:GITHUB_REPOSITORY -eq 'shivammathur/php-windows-builder') {
@@ -55,6 +56,9 @@ Function Add-Extension {
5556
$includePath = "$currentDirectory\php-dev\include"
5657
New-Item -Path $includePath\ext -Name $Extension -ItemType "directory" | Out-Null
5758
Get-ChildItem -Path (Get-Location).Path -Recurse -Include '*.h', '*.c' | Copy-Item -Destination "$includePath\ext\$Extension"
59+
Copy-Item -Path "$extensionBuildDirectory\*.dll" -Destination "$currentDirectory\php-bin\ext" -Force
60+
Copy-Item -Path "$extensionBuildDirectory\*.lib" -Destination "$currentDirectory\php-dev\lib" -Force
61+
Add-Content -Path "$currentDirectory\php-bin\php.ini" -Value "extension=$Extension"
5862
Set-Location $currentDirectory
5963
}
6064
end {

extension/BuildPhpExtension/private/Add-Path.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Function Add-Path {
1818
$currentUserPath = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User)
1919
$machinePath = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::Machine)
2020
$currentPath = $currentUserPath + ";" + $machinePath
21-
if (-not($currentPath.Split(';').Contains($PathItem))) {
22-
$newUserPath = $currentUserPath + ";" + $PathItem
21+
if (-not($currentPath.Split(';').Contains(($PathItem + ";")))) {
22+
$newUserPath = $PathItem + ";" + $currentUserPath
2323
[System.Environment]::SetEnvironmentVariable("PATH", $newUserPath, [System.EnvironmentVariableTarget]::User)
2424
$machinePath = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::Machine)
2525
$env:PATH = $newUserPath + ";" + $machinePath

extension/BuildPhpExtension/private/Get-PhpBuild.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function Get-PhpBuild {
5353

5454
[System.IO.Compression.ZipFile]::ExtractToDirectory($binZipFilePath, $binDirectoryPath)
5555
Add-Path -PathItem $binDirectoryPath
56+
Add-Content -Path $binDirectoryPath\php.ini -Value "extension_dir=$binDirectoryPath\ext"
5657
return $binDirectoryPath
5758
}
5859
end {

0 commit comments

Comments
 (0)