|
127 | 127 | } |
128 | 128 | Write-Verbose ("Downloading PECL package {0} {1} from {2}" -f $peclPackageHandle, $availablePackageVersion.PackageVersion, $availablePackageVersion.PackageArchiveUrl) |
129 | 129 | $downloadedFile, $keepDownloadedFile = Get-FileFromUrlOrCache -Url $availablePackageVersion.PackageArchiveUrl |
| 130 | + $additionalFiles = @() |
130 | 131 | try { |
131 | 132 | if ($remoteFileIsZip) { |
132 | 133 | $tempFolder = New-TempDirectory |
|
142 | 143 | throw ("Multiple PHP DLL found in archive downloaded from {0}" -f $availablePackageVersion.PackageArchiveUrl) |
143 | 144 | } |
144 | 145 | $dllPath = $phpDlls[0].FullName |
| 146 | + switch ($peclPackageHandle) { |
| 147 | + 'yaml' { |
| 148 | + $yamlDll = Join-Path -Path $tempFolder -ChildPath 'yaml.dll' |
| 149 | + if (Test-Path -LiteralPath $yamlDll -PathType Leaf) { |
| 150 | + $additionalFiles += $yamlDll |
| 151 | + } |
| 152 | + } |
| 153 | + } |
145 | 154 | } |
146 | 155 | else { |
147 | 156 | $keepDownloadedFile = $true |
|
179 | 188 | } catch { |
180 | 189 | Write-Debug -Message "Failed to reset the ACL for $($oldExtension.Filename): $($_.Exception.Message)" |
181 | 190 | } |
| 191 | + foreach ($additionalFile in $additionalFiles) { |
| 192 | + $additionalFileDestination = Join-Path -Path $phpVersion.ActualFolder -ChildPath $(Split-Path -Path $additionalFile -Leaf) |
| 193 | + Copy-Item -LiteralPath $additionalFile -Destination $additionalFileDestination -Force |
| 194 | + try { |
| 195 | + Reset-Acl -Path $additionalFileDestination |
| 196 | + } catch { |
| 197 | + Write-Debug -Message "Failed to reset the ACL for $($additionalFileDestination): $($_.Exception.Message)" |
| 198 | + } |
| 199 | + } |
182 | 200 | if ($oldExtension.State -eq $Script:EXTENSIONSTATE_DISABLED -and -Not($DontEnable)) { |
183 | 201 | Enable-PhpExtension -Extension $oldExtension.Name -Path $phpVersion.ExecutablePath |
184 | 202 | } |
|
198 | 216 | } catch { |
199 | 217 | Write-Debug -Message "Failed to reset the ACL for $($newExtensionFilename): $($_.Exception.Message)" |
200 | 218 | } |
| 219 | + foreach ($additionalFile in $additionalFiles) { |
| 220 | + $additionalFileDestination = Join-Path -Path $phpVersion.ActualFolder -ChildPath $(Split-Path -Path $additionalFile -Leaf) |
| 221 | + Copy-Item -LiteralPath $additionalFile -Destination $additionalFileDestination -Force |
| 222 | + try { |
| 223 | + Reset-Acl -Path $additionalFileDestination |
| 224 | + } catch { |
| 225 | + Write-Debug -Message "Failed to reset the ACL for $($additionalFileDestination): $($_.Exception.Message)" |
| 226 | + } |
| 227 | + } |
201 | 228 | if (-Not($DontEnable)) { |
202 | 229 | Write-Verbose "Enabling extension ""$($newExtension.Name)"" for ""$($phpVersion.ExecutablePath)""" |
203 | 230 | Enable-PhpExtension -Extension $newExtension.Name -Path $phpVersion.ExecutablePath |
|
0 commit comments