File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
extension/BuildPhpExtension/private Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ Function Add-Extension {
26
26
$currentDirectory = (Get-Location ).Path
27
27
& tar - xzf " $Extension .tgz" - C $currentDirectory
28
28
Set-Location " $Extension -*"
29
+ $extensionBuildDirectory = Join-Path - Path (Get-Location ).Path - ChildPath $config.build_directory
29
30
# Apply patches only for php/php-windows-builder and shivammathur/php-windows-builder
30
31
if ($null -ne $env: GITHUB_REPOSITORY ) {
31
32
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 {
55
56
$includePath = " $currentDirectory \php-dev\include"
56
57
New-Item - Path $includePath \ext - Name $Extension - ItemType " directory" | Out-Null
57
58
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 "
58
62
Set-Location $currentDirectory
59
63
}
60
64
end {
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ Function Add-Path {
18
18
$currentUserPath = [System.Environment ]::GetEnvironmentVariable(" PATH" , [System.EnvironmentVariableTarget ]::User)
19
19
$machinePath = [System.Environment ]::GetEnvironmentVariable(" PATH" , [System.EnvironmentVariableTarget ]::Machine)
20
20
$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
23
23
[System.Environment ]::SetEnvironmentVariable(" PATH" , $newUserPath , [System.EnvironmentVariableTarget ]::User)
24
24
$machinePath = [System.Environment ]::GetEnvironmentVariable(" PATH" , [System.EnvironmentVariableTarget ]::Machine)
25
25
$env: PATH = $newUserPath + " ;" + $machinePath
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ function Get-PhpBuild {
53
53
54
54
[System.IO.Compression.ZipFile ]::ExtractToDirectory($binZipFilePath , $binDirectoryPath )
55
55
Add-Path - PathItem $binDirectoryPath
56
+ Add-Content - Path $binDirectoryPath \php.ini - Value " extension_dir=$binDirectoryPath \ext"
56
57
return $binDirectoryPath
57
58
}
58
59
end {
You can’t perform that action at this time.
0 commit comments