setup-php 2.31.0 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -52
- package/lib/config.js +17 -7
- package/lib/config.js.map +1 -1
- package/lib/coverage.js +17 -7
- package/lib/coverage.js.map +1 -1
- package/lib/extensions.js +19 -9
- package/lib/extensions.js.map +1 -1
- package/lib/fetch.js +17 -7
- package/lib/fetch.js.map +1 -1
- package/lib/install.js +17 -7
- package/lib/install.js.map +1 -1
- package/lib/packagist.js +17 -7
- package/lib/packagist.js.map +1 -1
- package/lib/tools.js +17 -7
- package/lib/tools.js.map +1 -1
- package/lib/utils.js +23 -10
- package/lib/utils.js.map +1 -1
- package/package.json +19 -16
- package/src/configs/php-versions.json +4 -4
- package/src/configs/tools.json +5 -0
- package/src/extensions.ts +4 -4
- package/src/scripts/darwin.sh +9 -7
- package/src/scripts/extensions/add_extensions.ps1 +2 -2
- package/src/scripts/extensions/ioncube.sh +2 -0
- package/src/scripts/linux.sh +5 -4
- package/src/scripts/tools/brew.sh +0 -1
- package/src/scripts/tools/ppa.sh +3 -3
- package/src/scripts/unix.sh +30 -1
- package/src/scripts/win32.ps1 +11 -2
- package/src/utils.ts +8 -3
package/src/scripts/win32.ps1
CHANGED
|
@@ -3,7 +3,7 @@ param (
|
|
|
3
3
|
[ValidateNotNull()]
|
|
4
4
|
[ValidateLength(1, [int]::MaxValue)]
|
|
5
5
|
[string]
|
|
6
|
-
$version = '8.
|
|
6
|
+
$version = '8.4',
|
|
7
7
|
[Parameter(Position = 1, Mandatory = $true)]
|
|
8
8
|
[ValidateNotNull()]
|
|
9
9
|
[ValidateLength(1, [int]::MaxValue)]
|
|
@@ -401,6 +401,15 @@ if (Test-Path -LiteralPath $php_dir -PathType Container) {
|
|
|
401
401
|
}
|
|
402
402
|
$status = "Installed"
|
|
403
403
|
$extra_version = ""
|
|
404
|
+
if($version -eq 'pre') {
|
|
405
|
+
if($null -ne $installed) {
|
|
406
|
+
$version = $installed.MajorMinorVersion
|
|
407
|
+
$env:update = 'false'
|
|
408
|
+
} else {
|
|
409
|
+
Add-Log $cross "PHP" "No pre-installed PHP version found"
|
|
410
|
+
Write-Error "No pre-installed PHP version found" -ErrorAction Stop
|
|
411
|
+
}
|
|
412
|
+
}
|
|
404
413
|
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
|
|
405
414
|
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
|
|
406
415
|
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1
|
|
@@ -434,7 +443,7 @@ if($installed.MajorMinorVersion -ne $version) {
|
|
|
434
443
|
Write-Error "Could not setup PHP $version" -ErrorAction Stop
|
|
435
444
|
}
|
|
436
445
|
if($version -lt "5.5") {
|
|
437
|
-
('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel {
|
|
446
|
+
('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Invoke-WebRequest -Uri "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ >$null 2>&1 }
|
|
438
447
|
} else {
|
|
439
448
|
$enable_extensions += ('opcache')
|
|
440
449
|
}
|
package/src/utils.ts
CHANGED
|
@@ -436,12 +436,17 @@ export async function readPHPVersion(): Promise<string> {
|
|
|
436
436
|
const versionFile =
|
|
437
437
|
(await getInput('php-version-file', false)) || '.php-version';
|
|
438
438
|
if (fs.existsSync(versionFile)) {
|
|
439
|
-
|
|
439
|
+
const contents: string = fs.readFileSync(versionFile, 'utf8');
|
|
440
|
+
const match: RegExpMatchArray | null = contents.match(
|
|
441
|
+
/^(?:php\s)?(\d+\.\d+\.\d+)$/m
|
|
442
|
+
);
|
|
443
|
+
return match ? match[1] : contents.trim();
|
|
440
444
|
} else if (versionFile !== '.php-version') {
|
|
441
445
|
throw new Error(`Could not find '${versionFile}' file.`);
|
|
442
446
|
}
|
|
443
447
|
|
|
444
|
-
const
|
|
448
|
+
const composerProjectDir = await readEnv('COMPOSER_PROJECT_DIR');
|
|
449
|
+
const composerLock = path.join(composerProjectDir, 'composer.lock');
|
|
445
450
|
if (fs.existsSync(composerLock)) {
|
|
446
451
|
const lockFileContents = JSON.parse(fs.readFileSync(composerLock, 'utf8'));
|
|
447
452
|
if (
|
|
@@ -452,7 +457,7 @@ export async function readPHPVersion(): Promise<string> {
|
|
|
452
457
|
}
|
|
453
458
|
}
|
|
454
459
|
|
|
455
|
-
const composerJson = 'composer.json';
|
|
460
|
+
const composerJson = path.join(composerProjectDir, 'composer.json');
|
|
456
461
|
if (fs.existsSync(composerJson)) {
|
|
457
462
|
const composerFileContents = JSON.parse(
|
|
458
463
|
fs.readFileSync(composerJson, 'utf8')
|