File tree Expand file tree Collapse file tree 3 files changed +40
-7
lines changed
extension/BuildPhpExtension Expand file tree Collapse file tree 3 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 73
73
' Add-OciSdk' ,
74
74
' Add-OdbcCli' ,
75
75
' Add-Package' ,
76
+ ' Add-Patches' ,
76
77
' Add-Path' ,
77
78
' Add-PhpDependencies' ,
78
79
' Add-StepLog' ,
Original file line number Diff line number Diff line change
1
+ Function Add-Patches {
2
+ <#
3
+ . SYNOPSIS
4
+ Add patches to the extension.
5
+ . PARAMETER Extension
6
+ The extension name.
7
+ #>
8
+ [OutputType ()]
9
+ param (
10
+ [Parameter (Mandatory = $true , Position = 0 , HelpMessage = ' Extension' )]
11
+ [ValidateNotNull ()]
12
+ [ValidateLength (1 , [int ]::MaxValue)]
13
+ [string ] $Extension
14
+ )
15
+ begin {
16
+ }
17
+ process {
18
+ # Apply patches only for php/php-windows-builder and shivammathur/php-windows-builder
19
+ if ($null -ne $env: GITHUB_REPOSITORY ) {
20
+ if ($env: GITHUB_REPOSITORY -eq ' php/php-windows-builder' -or $env: GITHUB_REPOSITORY -eq ' shivammathur/php-windows-builder' ) {
21
+ if (Test-Path - PATH $PSScriptRoot \..\patches\$Extension.ps1 ) {
22
+ . $PSScriptRoot \..\patches\$Extension.ps1
23
+ }
24
+ }
25
+ }
26
+ }
27
+ end {
28
+ }
29
+ }
Original file line number Diff line number Diff line change @@ -51,6 +51,14 @@ function Get-Extension {
51
51
}
52
52
}
53
53
54
+ $patches = $False
55
+ if (Test-Path - PATH $PSScriptRoot \..\patches\$extension.ps1 ) {
56
+ if ((Get-Content $PSScriptRoot \..\patches\$extension.ps1 ).Contains(' config.w32' )) {
57
+ Add-Patches $extension
58
+ $patches = $True
59
+ }
60
+ }
61
+
54
62
$configW32 = Get-ChildItem (Get-Location ).Path - Recurse - Filter " config.w32" - ErrorAction SilentlyContinue
55
63
if ($null -eq $configW32 ) {
56
64
throw " No config.w32 found"
@@ -74,13 +82,8 @@ function Get-Extension {
74
82
}
75
83
}
76
84
77
- # Apply patches only for php/php-windows-builder and shivammathur/php-windows-builder
78
- if ($null -ne $env: GITHUB_REPOSITORY ) {
79
- if ($env: GITHUB_REPOSITORY -eq ' php/php-windows-builder' -or $env: GITHUB_REPOSITORY -eq ' shivammathur/php-windows-builder' ) {
80
- if (Test-Path - PATH $PSScriptRoot \..\patches\$name.ps1 ) {
81
- . $PSScriptRoot \..\patches\$name.ps1
82
- }
83
- }
85
+ if (! $patches ) {
86
+ Add-Patches $name
84
87
}
85
88
Add-BuildLog tick $name " Fetched $name extension"
86
89
return $name
You can’t perform that action at this time.
0 commit comments