setup-php 2.15.0 → 2.16.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 CHANGED
@@ -10,7 +10,8 @@
10
10
  <a href="https://github.com/shivammathur/setup-php" title="GitHub action to setup PHP"><img alt="GitHub Actions status" src="https://github.com/shivammathur/setup-php/workflows/Main%20workflow/badge.svg"></a>
11
11
  <a href="https://codecov.io/gh/shivammathur/setup-php" title="Code coverage"><img alt="Codecov Code Coverage" src="https://img.shields.io/codecov/c/github/shivammathur/setup-php?logo=codecov"></a>
12
12
  <a href="https://github.com/shivammathur/setup-php/blob/master/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
13
- <a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.2-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
13
+ <a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.2-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
14
+ <a href="https://beta.stepsecurity.io/npm/setup-php"><img alt="release verified" src="https://img.shields.io/endpoint?url=https://beta.api.stepsecurity.io/v1/npm/setup-php/badge?q=1"></a>
14
15
  </p>
15
16
  <p align="center">
16
17
  <a href="https://reddit.com/r/setup_php" title="setup-php reddit"><img alt="setup-php reddit" src="https://img.shields.io/badge/reddit-join-FF5700?logo=reddit&logoColor=FF5700&labelColor=555555"></a>
@@ -112,11 +113,11 @@ On all supported OS/Platforms the following PHP versions are supported as per th
112
113
  |`7.3`|`Stable`|`Security fixes only`|`GitHub-hosted`, `self-hosted`|
113
114
  |`7.4`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
114
115
  |`8.0`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
115
- |`8.1`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`|
116
+ |`8.1`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
116
117
  |`8.2`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`|
117
118
 
118
119
  **Notes:**
119
- - Specifying `8.1` and `8.2` in `php-version` input installs a nightly build of `PHP 8.1.0-dev` and `PHP 8.2.0-dev` respectively. See [nightly build setup](#nightly-build-setup) for more information.
120
+ - Specifying `8.2` in `php-version` input installs a nightly build of `PHP 8.2.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
120
121
  - To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
121
122
 
122
123
  ## :heavy_plus_sign: PHP Extension Support
@@ -505,7 +506,7 @@ jobs:
505
506
 
506
507
  ### Nightly Build Setup
507
508
 
508
- > Setup a nightly build of `PHP 8.1` or `PHP 8.2`.
509
+ > Setup a nightly build of `PHP 8.2`.
509
510
 
510
511
  - This version is currently in development.
511
512
  - Some user space extensions might not support this version currently.
@@ -515,7 +516,7 @@ steps:
515
516
  - name: Setup nightly PHP
516
517
  uses: shivammathur/setup-php@v2
517
518
  with:
518
- php-version: '8.1'
519
+ php-version: '8.2'
519
520
  extensions: mbstring
520
521
  ini-values: post_max_size=256M, max_execution_time=180
521
522
  coverage: xdebug
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "setup-php",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "private": false,
5
5
  "description": "Setup PHP for use with GitHub Actions",
6
6
  "main": "lib/install.js",
@@ -34,28 +34,28 @@
34
34
  "author": "shivammathur",
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "@actions/core": "^1.5.0",
37
+ "@actions/core": "^1.6.0",
38
38
  "@actions/exec": "^1.1.0",
39
39
  "@actions/io": "^1.1.1",
40
40
  "fs": "0.0.1-security"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/jest": "^27.0.2",
44
- "@types/node": "^16.10.1",
45
- "@typescript-eslint/eslint-plugin": "^4.32.0",
46
- "@typescript-eslint/parser": "^4.32.0",
47
- "@vercel/ncc": "^0.31.1",
48
- "eslint": "^7.32.0",
43
+ "@types/jest": "^27.0.3",
44
+ "@types/node": "^16.11.10",
45
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
46
+ "@typescript-eslint/parser": "^5.4.0",
47
+ "@vercel/ncc": "^0.32.0",
48
+ "eslint": "^8.3.0",
49
49
  "eslint-config-prettier": "^8.3.0",
50
- "eslint-plugin-import": "^2.24.2",
51
- "eslint-plugin-jest": "^24.4.2",
50
+ "eslint-plugin-import": "^2.25.3",
51
+ "eslint-plugin-jest": "^25.3.0",
52
52
  "eslint-plugin-prettier": "^4.0.0",
53
- "jest": "^27.2.2",
54
- "jest-circus": "^27.2.2",
55
- "prettier": "^2.4.1",
56
- "simple-git-hooks": "^2.6.1",
57
- "ts-jest": "^27.0.5",
58
- "typescript": "^4.4.3"
53
+ "jest": "^27.3.1",
54
+ "jest-circus": "^27.3.1",
55
+ "prettier": "^2.5.0",
56
+ "simple-git-hooks": "^2.7.0",
57
+ "ts-jest": "^27.0.7",
58
+ "typescript": "^4.5.2"
59
59
  },
60
60
  "bugs": {
61
61
  "url": "https://github.com/shivammathur/setup-php/issues"
@@ -5,6 +5,7 @@ grpc=grpc
5
5
  igbinary=igbinary
6
6
  imagick=imagick
7
7
  imap=imap
8
+ mailparse=mailparse
8
9
  memcache=memcache
9
10
  memcached=memcached
10
11
  mongodb=mongodb
@@ -1,7 +1,7 @@
1
1
  {
2
- "latest": "8.0",
2
+ "latest": "8.1",
3
3
  "nightly": "8.2",
4
4
  "5.x": "5.6",
5
5
  "7.x": "7.4",
6
- "8.x": "8.0"
6
+ "8.x": "8.1"
7
7
  }
File without changes
@@ -1,24 +1,24 @@
1
- {
2
- "problemMatcher": [
3
- {
4
- "owner": "phpunit",
5
- "pattern": [
6
- {
7
- "regexp": "^\\d+\\)\\s.*$"
8
- },
9
- {
10
- "regexp": "^(.*Failed\\sasserting\\sthat.*)$",
11
- "message": 1
12
- },
13
- {
14
- "regexp": "^\\s*$"
15
- },
16
- {
17
- "regexp": "^(.*):(\\d+)$",
18
- "file": 1,
19
- "line": 2
20
- }
21
- ]
22
- }
23
- ]
24
- }
1
+ {
2
+ "problemMatcher": [
3
+ {
4
+ "owner": "phpunit",
5
+ "pattern": [
6
+ {
7
+ "regexp": "^\\d+\\)\\s.*$"
8
+ },
9
+ {
10
+ "regexp": "^(.*Failed\\sasserting\\sthat.*)$",
11
+ "message": 1
12
+ },
13
+ {
14
+ "regexp": "^\\s*$"
15
+ },
16
+ {
17
+ "regexp": "^(.*):(\\d+)$",
18
+ "file": 1,
19
+ "line": 2
20
+ }
21
+ ]
22
+ }
23
+ ]
24
+ }
package/src/coverage.ts CHANGED
@@ -2,6 +2,19 @@ import * as utils from './utils';
2
2
  import * as extensions from './extensions';
3
3
  import * as config from './config';
4
4
 
5
+ export async function checkXdebugError(
6
+ extension: string,
7
+ version: string
8
+ ): Promise<string> {
9
+ if (
10
+ (/^5\.[3-6]$|^7\.[0-1]$/.test(version) && extension == 'xdebug3') ||
11
+ (/^8\.[0-9]$/.test(version) && extension == 'xdebug2')
12
+ ) {
13
+ return extension + ' is not supported on PHP ' + version;
14
+ }
15
+ return '';
16
+ }
17
+
5
18
  /**
6
19
  * Function to setup Xdebug
7
20
  *
@@ -17,18 +30,24 @@ export async function addCoverageXdebug(
17
30
  pipe: string
18
31
  ): Promise<string> {
19
32
  let script = '\n';
20
- script +=
21
- (await extensions.addExtension(':pcov:false', version, os_version, true)) +
22
- pipe;
23
- script +=
24
- (await extensions.addExtension(extension, version, os_version, true)) +
25
- pipe;
26
- script += await utils.addLog(
27
- '$tick',
28
- extension,
29
- 'Xdebug enabled as coverage driver',
30
- os_version
31
- );
33
+ let message: string = await checkXdebugError(extension, version);
34
+ let status = '$cross';
35
+ if (!message) {
36
+ script +=
37
+ (await extensions.addExtension(
38
+ ':pcov:false',
39
+ version,
40
+ os_version,
41
+ true
42
+ )) + pipe;
43
+ extension = extension == 'xdebug3' ? 'xdebug' : extension;
44
+ script +=
45
+ (await extensions.addExtension(extension, version, os_version, true)) +
46
+ pipe;
47
+ message = 'Xdebug enabled as coverage driver';
48
+ status = '$tick';
49
+ }
50
+ script += await utils.addLog(status, extension, message, os_version);
32
51
  return script;
33
52
  }
34
53
 
@@ -136,13 +155,11 @@ export async function addCoverage(
136
155
  case 'pcov':
137
156
  return script + (await addCoveragePCOV(version, os_version, pipe));
138
157
  case 'xdebug':
139
- case 'xdebug3':
140
- return (
141
- script + (await addCoverageXdebug('xdebug', version, os_version, pipe))
142
- );
143
158
  case 'xdebug2':
159
+ case 'xdebug3':
144
160
  return (
145
- script + (await addCoverageXdebug('xdebug2', version, os_version, pipe))
161
+ script +
162
+ (await addCoverageXdebug(coverage_driver, version, os_version, pipe))
146
163
  );
147
164
  case 'none':
148
165
  return script + (await disableCoverage(version, os_version, pipe));
package/src/extensions.ts CHANGED
@@ -77,7 +77,7 @@ export async function addExtensionDarwin(
77
77
  // match 7.1 and newer - pcov
78
78
  // match 5.6 to 7.4 - propro
79
79
  // match 7.0 and newer - vips, xlswriter
80
- case /(?<!5\.[3-5])(amqp|apcu|expect|grpc|igbinary|imagick|imap|memcache|memcached|mongodb|msgpack|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(
80
+ case /(?<!5\.[3-5])(amqp|apcu|expect|grpc|igbinary|imagick|imap|mailparse|memcache|memcached|mongodb|msgpack|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(
81
81
  version_extension
82
82
  ):
83
83
  case /(5\.6|7\.[0-4])propro/.test(version_extension):
@@ -69,7 +69,7 @@ add_brew_extension() {
69
69
  else
70
70
  add_brew_tap "$php_tap"
71
71
  add_brew_tap "$ext_tap"
72
- sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "$tap_dir/homebrew/homebrew-core/Formula/" 2>/dev/null || true
72
+ sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "$core_repo/Formula/" 2>/dev/null || true
73
73
  update_dependencies >/dev/null 2>&1
74
74
  disable_dependency_extensions "$extension" >/dev/null 2>&1
75
75
  brew install -f "$formula@$version" >/dev/null 2>&1
@@ -132,19 +132,23 @@ patch_brew() {
132
132
  # Helper function to update the dependencies.
133
133
  update_dependencies_helper() {
134
134
  dependency=$1
135
- get -q -n "$tap_dir/homebrew/homebrew-core/Formula/$dependency.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$dependency.rb"
135
+ get -q -n "$core_repo/Formula/$dependency.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$dependency.rb"
136
136
  link_libraries "$dependency"
137
137
  }
138
138
 
139
139
  # Function to update dependencies.
140
140
  update_dependencies() {
141
- if ! [ -e /tmp/update_dependencies ] && [ "${runner:?}" != "self-hosted" ] && [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
142
- patch_brew
143
- while read -r dependency; do
144
- update_dependencies_helper "$dependency" &
145
- to_wait+=($!)
146
- done <"$tap_dir/$php_tap/.github/deps/${ImageOS:?}_${ImageVersion:?}"
147
- wait "${to_wait[@]}"
141
+ if ! [ -e /tmp/update_dependencies ]; then
142
+ if [ "${runner:?}" != "self-hosted" ] && [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
143
+ patch_brew
144
+ while read -r dependency; do
145
+ update_dependencies_helper "$dependency" &
146
+ to_wait+=($!)
147
+ done <"$tap_dir/$php_tap/.github/deps/${ImageOS:?}_${ImageVersion:?}"
148
+ wait "${to_wait[@]}"
149
+ else
150
+ git -C "$core_repo" fetch origin master && git -C "$core_repo" reset --hard origin/master
151
+ fi
148
152
  echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1
149
153
  fi
150
154
  }
@@ -222,7 +226,7 @@ setup_php() {
222
226
  exit 1
223
227
  fi
224
228
 
225
- sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
229
+ sudo cp "$dist"/../src/configs/pm/*.json "$RUNNER_TOOL_CACHE/"
226
230
  echo "::set-output name=php-version::$semver"
227
231
  add_log "$tick" "PHP" "$status PHP $semver$extra_version"
228
232
  }
@@ -234,6 +238,7 @@ php_formula=shivammathur/php/php@"$version"
234
238
  brew_prefix="$(brew --prefix)"
235
239
  brew_repo="$(brew --repository)"
236
240
  tap_dir="$brew_repo"/Library/Taps
241
+ core_repo="$tap_dir"/homebrew/homebrew-core
237
242
  scripts="${dist}"/../src/scripts
238
243
  ext_tap=shivammathur/homebrew-extensions
239
244
  php_tap=shivammathur/homebrew-php
@@ -128,7 +128,7 @@ switch_version() {
128
128
  add_packaged_php() {
129
129
  if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
130
130
  add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
131
- IFS=' ' read -r -a packages <<<"$(echo "cli curl mbstring xml intl" | sed "s/[^ ]*/php$version-&/g")"
131
+ IFS=' ' read -r -a packages <<<"$(echo "cli curl dev mbstring xml intl" | sed "s/[^ ]*/php$version-&/g")"
132
132
  install_packages "${packages[@]}"
133
133
  else
134
134
  run_script "php-ubuntu" "$version"
@@ -137,13 +137,13 @@ add_packaged_php() {
137
137
 
138
138
  # Function to update PHP.
139
139
  update_php() {
140
- initial_version=$(php_semver)
141
- add_packaged_php
142
- updated_version=$(php_semver)
140
+ initial_version="$(php_semver)$(php_extra_version)"
141
+ add_php
142
+ updated_version="$(php_semver)$(php_extra_version)"
143
143
  if [ "$updated_version" != "$initial_version" ]; then
144
144
  status="Updated to"
145
145
  else
146
- status="Switched to"
146
+ status="Found"
147
147
  fi
148
148
  }
149
149
 
@@ -155,6 +155,7 @@ add_php() {
155
155
  setup_old_versions
156
156
  else
157
157
  add_packaged_php
158
+ switch_version >/dev/null 2>&1
158
159
  fi
159
160
  status="Installed"
160
161
  }
@@ -183,15 +184,15 @@ setup_php() {
183
184
  if [ ! -e "/usr/bin/php$version" ]; then
184
185
  add_php >/dev/null 2>&1
185
186
  else
187
+ if ! [[ "$version" =~ ${old_versions:?} ]]; then
188
+ switch_version >/dev/null 2>&1
189
+ fi
186
190
  if [ "${update:?}" = "true" ]; then
187
191
  update_php >/dev/null 2>&1
188
192
  else
189
193
  status="Switched to"
190
194
  fi
191
195
  fi
192
- if ! [[ "$version" =~ ${old_versions:?}|${nightly_versions:?} ]]; then
193
- switch_version >/dev/null 2>&1
194
- fi
195
196
  else
196
197
  if [ "$update" = "true" ]; then
197
198
  update_php >/dev/null 2>&1
@@ -215,7 +216,7 @@ setup_php() {
215
216
  configure_php
216
217
  sudo rm -rf /usr/local/bin/phpunit >/dev/null 2>&1
217
218
  sudo chmod 777 "${ini_file[@]}" "$pecl_file" "${tool_path_dir:?}"
218
- sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
219
+ sudo cp "$dist"/../src/configs/pm/*.json "$RUNNER_TOOL_CACHE/"
219
220
  echo "::set-output name=php-version::$semver"
220
221
  add_log "${tick:?}" "PHP" "$status PHP $semver$extra_version"
221
222
  }
@@ -18,7 +18,11 @@ add_tools_helper() {
18
18
  add_extension fileinfo extension >/dev/null 2>&1
19
19
  sudo ln -s "${tool_path:?}" "${tool_path_dir:?}"/phpdocumentor 2>/dev/null || true
20
20
  sudo ln -s "${tool_path:?}" "${tool_path_dir:?}"/phpdoc
21
+ elif [[ "$tool" =~ phpunit(-polyfills)?$ ]]; then
22
+ if [ -e "${tool_path_dir:?}"/phpunit ]; then
23
+ sudo cp "${tool_path_dir:?}"/phpunit "${composer_bin:?}"
24
+ fi
21
25
  elif [[ "$tool" =~ (symfony|vapor|wp)-cli ]]; then
22
- sudo ln -s "${tool_path:?}" "${tool_path_dir:?}"/${tool%-*}
26
+ sudo ln -s "${tool_path:?}" "${tool_path_dir:?}"/"${tool%-*}"
23
27
  fi
24
28
  }
@@ -1,7 +1,8 @@
1
1
  add_blackfire_linux() {
2
- sudo mkdir -p /var/run/blackfire
2
+ sudo mkdir -p /var/run/blackfire /etc/blackfire
3
3
  add_list debian/blackfire http://packages.blackfire.io/debian https://packages.blackfire.io/gpg.key any main
4
4
  install_packages blackfire
5
+ sudo chmod 777 /etc/blackfire/agent
5
6
  }
6
7
 
7
8
  add_blackfire_darwin() {
@@ -3,7 +3,7 @@ param (
3
3
  [ValidateNotNull()]
4
4
  [ValidateLength(1, [int]::MaxValue)]
5
5
  [string]
6
- $version = '8.0',
6
+ $version = '8.1',
7
7
  [Parameter(Position = 1, Mandatory = $true)]
8
8
  [ValidateNotNull()]
9
9
  [ValidateLength(1, [int]::MaxValue)]
@@ -141,26 +141,6 @@ Function Set-ExtensionPrerequisites
141
141
  }
142
142
  }
143
143
 
144
- # Function to get extension pre-requisites.
145
- # https://windows.php.net/downloads/pecl/deps
146
- # Currently only imagick is supported using this Cmdlet.
147
- Function Get-ExtensionPrerequisites{
148
- Param (
149
- [Parameter(Position = 0, Mandatory = $true)]
150
- [ValidateNotNull()]
151
- [ValidateLength(1, [int]::MaxValue)]
152
- [string]
153
- $extension
154
- )
155
- $deps_dir = "$ext_dir\$extension-vc$($installed.VCVersion)-$arch"
156
- $extensions_with_dependencies = ('imagick')
157
- New-Item $deps_dir -Type Directory -Force > $null 2>&1
158
- if($extensions_with_dependencies.Contains($extension)) {
159
- Install-PhpExtensionPrerequisite -Extension $extension -InstallPath $deps_dir -PhpPath $php_dir
160
- }
161
- return $deps_dir
162
- }
163
-
164
144
  # Function to add CA certificates to PHP.
165
145
  Function Add-PhpCAInfo {
166
146
  try {
@@ -192,6 +172,8 @@ Function Add-Extension {
192
172
  )
193
173
  try {
194
174
  $extension_info = Get-PhpExtension -Path $php_dir | Where-Object { $_.Name -eq $extension -or $_.Handle -eq $extension }
175
+ $deps_dir = "$ext_dir\$extension-vc$($installed.VCVersion)-$arch"
176
+ New-Item $deps_dir -Type Directory -Force > $null 2>&1
195
177
  if ($null -ne $extension_info) {
196
178
  switch ($extension_info.State) {
197
179
  'Builtin' {
@@ -201,7 +183,6 @@ Function Add-Extension {
201
183
  Add-Log $tick $extension "Enabled"
202
184
  }
203
185
  default {
204
- $deps_dir = Get-ExtensionPrerequisites $extension
205
186
  Enable-ExtensionDependencies $extension
206
187
  Enable-PhpExtension -Extension $extension_info.Handle -Path $php_dir
207
188
  Set-ExtensionPrerequisites $deps_dir
@@ -210,7 +191,6 @@ Function Add-Extension {
210
191
  }
211
192
  }
212
193
  else {
213
- $deps_dir = Get-ExtensionPrerequisites $extension
214
194
  $params = @{ Extension = $extension; MinimumStability = $stability; MaximumStability = $stability; Path = $php_dir; AdditionalFilesPath = $deps_dir; NoDependencies = $true }
215
195
  if($extension_version -ne '') {
216
196
  $params["Version"] = $extension_version
@@ -528,7 +508,13 @@ Step-Log "Setup PHP"
528
508
  $installed = $null
529
509
  if (Test-Path -LiteralPath $php_dir -PathType Container) {
530
510
  try {
531
- $installed = Get-Php -Path $php_dir
511
+ if(Test-Path $php_dir\php.ini) {
512
+ Rename-Item -Path $php_dir\php.ini -NewName 'php.ini.bak'
513
+ }
514
+ $installed = Get-Php -Path $php_dir -ErrorAction SilentlyContinue 2>$null 3>$null
515
+ if(Test-Path $php_dir\php.ini.bak) {
516
+ Rename-Item -Path $php_dir\php.ini.bak -NewName 'php.ini'
517
+ }
532
518
  } catch { }
533
519
  }
534
520
  $status = "Installed"
@@ -541,7 +527,9 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
541
527
  if ($version -match $nightly_versions) {
542
528
  Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
543
529
  & $php_dir\Get-PhpNightly.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir -Version $version > $null 2>&1
544
- $extra_version = " ($(Get-Content $php_dir\COMMIT))"
530
+ if(Test-Path $php_dir\COMMIT) {
531
+ $extra_version = " ($( Get-Content $php_dir\COMMIT ))"
532
+ }
545
533
  } else {
546
534
  Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force > $null 2>&1
547
535
  }
@@ -572,7 +560,7 @@ if($version -lt "5.5") {
572
560
  }
573
561
  Enable-PhpExtension -Extension $enable_extensions -Path $php_dir
574
562
  Add-PhpCAInfo
575
- Copy-Item -Path $dist\..\src\configs\*.json -Destination $env:RUNNER_TOOL_CACHE
563
+ Copy-Item -Path $dist\..\src\configs\pm\*.json -Destination $env:RUNNER_TOOL_CACHE
576
564
  New-Item -ItemType Directory -Path $composer_bin -Force > $null 2>&1
577
565
  Write-Output "::set-output name=php-version::$($installed.FullVersion)"
578
566
  Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)$extra_version"
package/lib/config.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export declare function addINIValuesUnix(ini_values_csv: string): Promise<string>;
2
- export declare function addINIValuesWindows(ini_values_csv: string): Promise<string>;
3
- export declare function addINIValues(ini_values_csv: string, os_version: string, no_step?: boolean): Promise<string>;
package/lib/config.js DELETED
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.addINIValues = exports.addINIValuesWindows = exports.addINIValuesUnix = void 0;
23
- const utils = __importStar(require("./utils"));
24
- async function addINIValuesUnix(ini_values_csv) {
25
- const ini_values = await utils.CSVArray(ini_values_csv);
26
- let script = '';
27
- await utils.asyncForEach(ini_values, async function (line) {
28
- script +=
29
- '\n' + (await utils.addLog('$tick', line, 'Added to php.ini', 'linux'));
30
- });
31
- return ('echo "' +
32
- ini_values.join('\n') +
33
- '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' +
34
- script);
35
- }
36
- exports.addINIValuesUnix = addINIValuesUnix;
37
- async function addINIValuesWindows(ini_values_csv) {
38
- const ini_values = await utils.CSVArray(ini_values_csv);
39
- let script = '\n';
40
- await utils.asyncForEach(ini_values, async function (line) {
41
- script +=
42
- (await utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n';
43
- });
44
- return ('Add-Content "$php_dir\\php.ini" "' + ini_values.join('\n') + '"' + script);
45
- }
46
- exports.addINIValuesWindows = addINIValuesWindows;
47
- async function addINIValues(ini_values_csv, os_version, no_step = false) {
48
- let script = '\n';
49
- switch (no_step) {
50
- case true:
51
- script +=
52
- (await utils.stepLog('Add php.ini values', os_version)) +
53
- (await utils.suppressOutput(os_version)) +
54
- '\n';
55
- break;
56
- case false:
57
- default:
58
- script += (await utils.stepLog('Add php.ini values', os_version)) + '\n';
59
- break;
60
- }
61
- switch (os_version) {
62
- case 'win32':
63
- return script + (await addINIValuesWindows(ini_values_csv));
64
- case 'darwin':
65
- case 'linux':
66
- return script + (await addINIValuesUnix(ini_values_csv));
67
- default:
68
- return await utils.log('Platform ' + os_version + ' is not supported', os_version, 'error');
69
- }
70
- }
71
- exports.addINIValues = addINIValues;
72
- //# sourceMappingURL=config.js.map
package/lib/config.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAO1B,KAAK,UAAU,gBAAgB,CACpC,cAAsB;IAEtB,MAAM,UAAU,GAAkB,MAAM,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvE,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,WAAW,IAAY;QAC/D,MAAM;YACJ,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IACH,OAAO,CACL,QAAQ;QACR,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;QACrB,gEAAgE;QAChE,MAAM,CACP,CAAC;AACJ,CAAC;AAfD,4CAeC;AAOM,KAAK,UAAU,mBAAmB,CACvC,cAAsB;IAEtB,MAAM,UAAU,GAAkB,MAAM,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvE,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,MAAM,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,WAAW,IAAY;QAC/D,MAAM;YACJ,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAC5E,CAAC,CAAC,CAAC;IACH,OAAO,CACL,mCAAmC,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,MAAM,CAC3E,CAAC;AACJ,CAAC;AAZD,kDAYC;AASM,KAAK,UAAU,YAAY,CAChC,cAAsB,EACtB,UAAkB,EAClB,OAAO,GAAG,KAAK;IAEf,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,OAAO,EAAE;QACf,KAAK,IAAI;YACP,MAAM;gBACJ,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;oBACvD,CAAC,MAAM,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;oBACxC,IAAI,CAAC;YACP,MAAM;QACR,KAAK,KAAK,CAAC;QACX;YACE,MAAM,IAAI,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC;YACzE,MAAM;KACT;IACD,QAAQ,UAAU,EAAE;QAClB,KAAK,OAAO;YACV,OAAO,MAAM,GAAG,CAAC,MAAM,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC;QAC9D,KAAK,QAAQ,CAAC;QACd,KAAK,OAAO;YACV,OAAO,MAAM,GAAG,CAAC,MAAM,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3D;YACE,OAAO,MAAM,KAAK,CAAC,GAAG,CACpB,WAAW,GAAG,UAAU,GAAG,mBAAmB,EAC9C,UAAU,EACV,OAAO,CACR,CAAC;KACL;AACH,CAAC;AA/BD,oCA+BC"}
package/lib/coverage.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export declare function addCoverageXdebug(extension: string, version: string, os_version: string, pipe: string): Promise<string>;
2
- export declare function addCoveragePCOV(version: string, os_version: string, pipe: string): Promise<string>;
3
- export declare function disableCoverage(version: string, os_version: string, pipe: string): Promise<string>;
4
- export declare function addCoverage(coverage_driver: string, version: string, os_version: string): Promise<string>;