Skip to content

Commit 7f304f8

Browse files
authored
Merge pull request #83 from mlocati/imagick-php8
Fix installation of imagick with PHP 8+
2 parents a9dabc1 + 1e7a435 commit 7f304f8

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

PhpManager/private/Install-ImagickPrerequisite.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
begin {
2323
}
2424
process {
25+
if ($phpVersion.FullVersion -ge [System.Version]'8.0.0') {
26+
return
27+
}
2528
$rxSearch = '/ImageMagick-[\d\.\-]+-(VC|vc|vs)' + $PhpVersion.VCVersion + '-' + $PhpVersion.Architecture + '\.zip$'
2629
$pageUrl = 'https://windows.php.net/downloads/pecl/deps/'
2730
Set-NetSecurityProtocolType

PhpManager/public/Install-PhpExtension.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@
167167
$additionalFiles += $libcouchbaseDll
168168
}
169169
}
170+
'imagick' {
171+
if ($phpVersion.FullVersion -ge [System.Version]'8.0.0') {
172+
$additionalFiles += @(Get-ChildItem -Path $tempFolder\CORE_RL_*.dll -File -Depth 1)
173+
$additionalFiles += @(Get-ChildItem -Path $tempFolder\IM_MOD_RL_*.dll -File -Depth 1)
174+
}
175+
}
170176
'yaml' {
171177
$yamlDll = Join-Path -Path $tempFolder -ChildPath 'yaml.dll'
172178
if (Test-Path -LiteralPath $yamlDll -PathType Leaf) {

test/tests/Install-Get-Update-Uninstall-Php.Tests.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,25 @@
5959
}
6060
}
6161
}
62-
It 'should install/get/update/remove PHP 7.3-dev' {
62+
It 'should install/get/update/remove PHP 7.4-dev' {
6363
if ($isNanoServer) {
6464
Set-ItResult -Skipped -Because 'it does not seems possible to install the Visual C++ 2019 Redistributables on Windows Nano Server'
6565
}
6666
if (Test-Path -LiteralPath $phpPath) {
6767
Remove-Item -LiteralPath $phpPath -Recurse -Force
6868
}
6969
try {
70-
Install-Php -Version 7.3snapshot -Architecture x64 -ThreadSafe $true -Path $phpPath -InstallVC
70+
Install-Php -Version 7.4snapshot -Architecture x64 -ThreadSafe $true -Path $phpPath -InstallVC
7171
$initialPhpVersion = Get-Php -Path $phpPath
7272
$initialPhpVersion | Should -Not -BeNullOrEmpty
7373
$initialPhpVersion.GetType().FullName | Should -BeExactly 'PhpVersionInstalled'
7474
$initialPhpVersion.Version | Should -BeOfType [string]
75-
$initialPhpVersion.Version | Should -MatchExactly '^7\.3\.\d+$'
76-
$initialPhpVersion.MajorMinorVersion | Should -BeExactly '7.3'
75+
$initialPhpVersion.Version | Should -MatchExactly '^7\.4\.\d+$'
76+
$initialPhpVersion.MajorMinorVersion | Should -BeExactly '7.4'
7777
$initialPhpVersion.ComparableVersion | Should -BeOfType [version]
7878
$initialPhpVersion.UnstabilityLevel | Should -BeExactly 'snapshot'
7979
$initialPhpVersion.UnstabilityVersion | Should -BeNullOrEmpty
80-
$initialPhpVersion.FullVersion | Should -MatchExactly '^7\.3\.\d+-dev$'
80+
$initialPhpVersion.FullVersion | Should -MatchExactly '^7\.4\.\d+-dev$'
8181
$initialPhpVersion.Architecture | Should -BeExactly 'x64'
8282
$initialPhpVersion.ThreadSafe | Should -BeExactly $true
8383
$initialPhpVersion.VCVersion | Should -BeOfType [int]
@@ -91,11 +91,11 @@
9191
$updatedPhpVersion | Should -Not -BeNullOrEmpty
9292
$updatedPhpVersion.GetType().FullName | Should -BeExactly 'PhpVersionInstalled'
9393
$updatedPhpVersion.Version | Should -BeOfType [string]
94-
$initialPhpVersion.Version | Should -MatchExactly '^7\.3\.\d+$'
94+
$initialPhpVersion.Version | Should -MatchExactly '^7\.4\.\d+$'
9595
$updatedPhpVersion.ComparableVersion | Should -BeOfType [version]
9696
$initialPhpVersion.UnstabilityLevel | Should -BeExactly 'snapshot'
9797
$updatedPhpVersion.UnstabilityVersion | Should -BeNullOrEmpty
98-
$initialPhpVersion.FullVersion | Should -MatchExactly '^7\.3\.\d+-dev$'
98+
$initialPhpVersion.FullVersion | Should -MatchExactly '^7\.4\.\d+-dev$'
9999
$updatedPhpVersion.Architecture | Should -BeExactly $initialPhpVersion.Architecture
100100
$updatedPhpVersion.ThreadSafe | Should -BeExactly $initialPhpVersion.ThreadSafe
101101
$updatedPhpVersion.VCVersion | Should -BeExactly $initialPhpVersion.VCVersion

0 commit comments

Comments
 (0)