setup-php 1.11.2 → 1.11.6

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.
Files changed (80) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +433 -458
  3. package/lib/config.d.ts +3 -0
  4. package/lib/config.js +71 -71
  5. package/lib/config.js.map +1 -1
  6. package/lib/coverage.d.ts +4 -0
  7. package/lib/coverage.js +97 -87
  8. package/lib/coverage.js.map +1 -1
  9. package/lib/extensions.d.ts +4 -0
  10. package/lib/extensions.js +188 -200
  11. package/lib/extensions.js.map +1 -1
  12. package/lib/install.d.ts +2 -0
  13. package/lib/install.js +96 -81
  14. package/lib/install.js.map +1 -1
  15. package/lib/tools.d.ts +18 -0
  16. package/lib/tools.js +306 -386
  17. package/lib/tools.js.map +1 -1
  18. package/lib/utils.d.ts +15 -0
  19. package/lib/utils.js +205 -291
  20. package/lib/utils.js.map +1 -1
  21. package/package.json +66 -56
  22. package/src/config.ts +82 -82
  23. package/src/configs/brew_extensions +28 -0
  24. package/src/configs/php-versions.json +5 -5
  25. package/src/configs/phpunit.json +24 -24
  26. package/src/coverage.ts +146 -146
  27. package/src/extensions.ts +235 -233
  28. package/src/install.ts +104 -104
  29. package/src/scripts/darwin.sh +341 -339
  30. package/src/scripts/ext/gearman.sh +22 -22
  31. package/src/scripts/ext/phalcon.ps1 +55 -55
  32. package/src/scripts/ext/phalcon.sh +70 -70
  33. package/src/scripts/linux.sh +361 -361
  34. package/src/scripts/win32.ps1 +326 -333
  35. package/src/tools.ts +472 -469
  36. package/src/utils.ts +319 -316
  37. package/.eslintrc.json +0 -16
  38. package/.github/CODE_OF_CONDUCT.md +0 -76
  39. package/.github/CONTRIBUTING.md +0 -69
  40. package/.github/FUNDING.yml +0 -7
  41. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -23
  42. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  43. package/.github/PULL_REQUEST_TEMPLATE.md +0 -38
  44. package/.github/SECURITY.md +0 -29
  45. package/.github/workflows/main-workflow.yml +0 -56
  46. package/.github/workflows/node-workflow.yml +0 -47
  47. package/.idea/workspace.xml +0 -113
  48. package/.prettierrc.json +0 -12
  49. package/__tests__/config.test.ts +0 -52
  50. package/__tests__/coverage.test.ts +0 -110
  51. package/__tests__/extensions.test.ts +0 -120
  52. package/__tests__/install.test.ts +0 -181
  53. package/__tests__/tools.test.ts +0 -476
  54. package/__tests__/utils.test.ts +0 -213
  55. package/action.yml +0 -38
  56. package/dist/index.js +0 -2854
  57. package/examples/bedrock.yml +0 -32
  58. package/examples/cakephp-mysql.yml +0 -114
  59. package/examples/cakephp-postgres.yml +0 -112
  60. package/examples/cakephp.yml +0 -92
  61. package/examples/codeigniter.yml +0 -34
  62. package/examples/laravel-mysql.yml +0 -74
  63. package/examples/laravel-postgres.yml +0 -74
  64. package/examples/laravel.yml +0 -42
  65. package/examples/lumen-mysql.yml +0 -74
  66. package/examples/lumen-postgres.yml +0 -74
  67. package/examples/lumen.yml +0 -38
  68. package/examples/phalcon-mysql.yml +0 -74
  69. package/examples/phalcon-postgres.yml +0 -73
  70. package/examples/sage.yml +0 -57
  71. package/examples/slim-framework.yml +0 -34
  72. package/examples/symfony-mysql.yml +0 -56
  73. package/examples/symfony-postgres.yml +0 -54
  74. package/examples/symfony.yml +0 -39
  75. package/examples/yii2-mysql.yml +0 -73
  76. package/examples/yii2-postgres.yml +0 -71
  77. package/examples/zend-framework.yml +0 -36
  78. package/jest.config.js +0 -12
  79. package/lib/sapi.js +0 -64
  80. package/tsconfig.json +0 -18
@@ -1,22 +1,22 @@
1
- # Helper function to add gearman extension.
2
- add_gearman_helper() {
3
- add_ppa ondrej/pkg-gearman
4
- sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y libgearman-dev
5
- enable_extension gearman extension
6
- if ! check_extension gearman; then
7
- status="Installed and enabled"
8
- sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"${version:?}"-gearman || pecl_install gearman
9
- enable_extension gearman extension
10
- fi
11
- }
12
-
13
- # Function to add gearman extension.
14
- add_gearman() {
15
- status="Enabled"
16
- add_gearman_helper >/dev/null 2>&1
17
- if check_extension gearman; then
18
- add_log "${tick:?}" "gearman" "$status"
19
- fi
20
- }
21
-
22
- add_gearman
1
+ # Helper function to add gearman extension.
2
+ add_gearman_helper() {
3
+ add_ppa ondrej/pkg-gearman
4
+ sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y libgearman-dev
5
+ enable_extension gearman extension
6
+ if ! check_extension gearman; then
7
+ status="Installed and enabled"
8
+ sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"${version:?}"-gearman || pecl_install gearman
9
+ enable_extension gearman extension
10
+ fi
11
+ }
12
+
13
+ # Function to add gearman extension.
14
+ add_gearman() {
15
+ status="Enabled"
16
+ add_gearman_helper >/dev/null 2>&1
17
+ if check_extension gearman; then
18
+ add_log "${tick:?}" "gearman" "$status"
19
+ fi
20
+ }
21
+
22
+ add_gearman
@@ -1,56 +1,56 @@
1
- Param (
2
- [Parameter(Position = 0, Mandatory = $true)]
3
- [ValidateNotNull()]
4
- [ValidateSet('phalcon3', 'phalcon4')]
5
- [string]
6
- $extension,
7
- [Parameter(Position = 1, Mandatory = $true)]
8
- [ValidateNotNull()]
9
- [ValidateLength(1, [int]::MaxValue)]
10
- [string]
11
- $version
12
- )
13
-
14
- # Function to install phalcon
15
- Function Install-Phalcon() {
16
- if ($extension_version -eq '4') {
17
- Install-Phpextension phalcon -MinimumStability stable -Path $php_dir
18
- } else {
19
- $installed = Get-Php -Path $php_dir
20
- $nts = if (!$installed.ThreadSafe) { "_nts" } else { "" }
21
- $match = Invoke-WebRequest -UseBasicParsing -Uri "$domain/phalcon/cphalcon/releases/v3.4.5" | Select-String -Pattern "href=`"(.*phalcon_x64_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)`""
22
- $zip_file = $match.Matches[0].Groups[1].Value
23
- Invoke-WebRequest -UseBasicParsing -Uri $domain/$zip_file -OutFile $ENV:RUNNER_TOOL_CACHE\phalcon.zip > $null 2>&1
24
- Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\phalcon.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\phalcon -Force > $null 2>&1
25
- Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\phalcon\php_phalcon.dll" -Destination "$ext_dir\php_phalcon.dll"
26
- Enable-PhpExtension -Extension phalcon -Path $php_dir
27
- }
28
- printf "\033[%s;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "32" $tick $extension "Installed and enabled"
29
- }
30
-
31
- $tick = ([char]8730)
32
- $domain = 'https://github.com'
33
- $php_dir = 'C:\tools\php'
34
- $ext_dir = $php_dir + '\ext'
35
- $extension_version = $extension.substring($extension.Length - 1)
36
-
37
- if($extension_version -eq '4') {
38
- if (Test-Path $ext_dir\php_psr.dll) {
39
- Enable-PhpExtension -Extension psr -Path $php_dir
40
- } else {
41
- Install-Phpextension psr -MinimumStability stable -Path $php_dir
42
- }
43
- }
44
-
45
- if(Test-Path $ext_dir\php_phalcon.dll) {
46
- $phalcon = Get-PhpExtension $ext_dir\php_phalcon.dll
47
- if($phalcon.Version[0] -eq $extension_version) {
48
- Enable-PhpExtension -Extension phalcon -Path $php_dir
49
- printf "\033[%s;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "32" $tick $extension "Enabled"
50
- } else {
51
- Remove-Item $ext_dir\php_phalcon.dll
52
- Install-Phalcon
53
- }
54
- } else {
55
- Install-Phalcon
1
+ Param (
2
+ [Parameter(Position = 0, Mandatory = $true)]
3
+ [ValidateNotNull()]
4
+ [ValidateSet('phalcon3', 'phalcon4')]
5
+ [string]
6
+ $extension,
7
+ [Parameter(Position = 1, Mandatory = $true)]
8
+ [ValidateNotNull()]
9
+ [ValidateLength(1, [int]::MaxValue)]
10
+ [string]
11
+ $version
12
+ )
13
+
14
+ # Function to install phalcon
15
+ Function Install-Phalcon() {
16
+ if ($extension_version -eq '4') {
17
+ Install-Phpextension phalcon -MinimumStability stable -Path $php_dir
18
+ } else {
19
+ $installed = Get-Php -Path $php_dir
20
+ $nts = if (!$installed.ThreadSafe) { "_nts" } else { "" }
21
+ $match = Invoke-WebRequest -UseBasicParsing -Uri "$domain/phalcon/cphalcon/releases/v3.4.5" | Select-String -Pattern "href=`"(.*phalcon_x64_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)`""
22
+ $zip_file = $match.Matches[0].Groups[1].Value
23
+ Invoke-WebRequest -UseBasicParsing -Uri $domain/$zip_file -OutFile $ENV:RUNNER_TOOL_CACHE\phalcon.zip > $null 2>&1
24
+ Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\phalcon.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\phalcon -Force > $null 2>&1
25
+ Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\phalcon\php_phalcon.dll" -Destination "$ext_dir\php_phalcon.dll"
26
+ Enable-PhpExtension -Extension phalcon -Path $php_dir
27
+ }
28
+ printf "\033[%s;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "32" $tick $extension "Installed and enabled"
29
+ }
30
+
31
+ $tick = ([char]8730)
32
+ $domain = 'https://github.com'
33
+ $php_dir = 'C:\tools\php'
34
+ $ext_dir = $php_dir + '\ext'
35
+ $extension_version = $extension.substring($extension.Length - 1)
36
+
37
+ if($extension_version -eq '4') {
38
+ if (Test-Path $ext_dir\php_psr.dll) {
39
+ Enable-PhpExtension -Extension psr -Path $php_dir
40
+ } else {
41
+ Install-Phpextension psr -MinimumStability stable -Path $php_dir
42
+ }
43
+ }
44
+
45
+ if(Test-Path $ext_dir\php_phalcon.dll) {
46
+ $phalcon = Get-PhpExtension $ext_dir\php_phalcon.dll
47
+ if($phalcon.Version[0] -eq $extension_version) {
48
+ Enable-PhpExtension -Extension phalcon -Path $php_dir
49
+ printf "\033[%s;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "32" $tick $extension "Enabled"
50
+ } else {
51
+ Remove-Item $ext_dir\php_phalcon.dll
52
+ Install-Phalcon
53
+ }
54
+ } else {
55
+ Install-Phalcon
56
56
  }
@@ -1,71 +1,71 @@
1
- # Function to log result of a operation
2
- add_log() {
3
- mark=$1
4
- subject=$2
5
- message=$3
6
- if [ "$mark" = "$tick" ]; then
7
- printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
8
- else
9
- printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
10
- fi
11
- }
12
-
13
- # Function to update php ppa
14
- update_ppa() {
15
- if [ "$ppa_updated" = "false" ]; then
16
- find /etc/apt/sources.list.d -type f -name 'ondrej-ubuntu-php*.list' -exec sudo DEBIAN_FRONTEND=noninteractive apt-get update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1
17
- ppa_updated="true"
18
- fi
19
- }
20
-
21
- # Function to install phalcon
22
- install_phalcon() {
23
- extension=$1
24
- version=$2
25
- (update_ppa && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y "php$version-psr" "php$version-$extension" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
26
- add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
27
- }
28
-
29
- ini_file="/etc/php/$2/cli/conf.d/50-phalcon.ini"
30
- ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
31
- semver=$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')
32
- extension_major_version=$(echo "$1" | grep -i -Po '\d')
33
- ppa_updated="false"
34
- tick="✓"
35
- cross="✗"
36
-
37
- if [ "$extension_major_version" = "4" ]; then
38
- if [ -e "$ext_dir/psr.so" ] && ! php -m | grep -i -q -w psr; then
39
- echo "extension=psr.so" | sudo tee -a "$ini_file" >/dev/null 2>&1
40
- fi
41
-
42
- if [ -e "$ext_dir/phalcon.so" ]; then
43
- if php -m | grep -i -q -w psr; then
44
- phalcon_version=$(php -d="extension=phalcon" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
45
- if [ "$phalcon_version" != "$extension_major_version" ]; then
46
- install_phalcon "$1" "$2"
47
- else
48
- echo "extension=phalcon.so" | sudo tee -a "$ini_file" >/dev/null 2>&1
49
- add_log "$tick" "$1" "Enabled"
50
- fi
51
- else
52
- install_phalcon "$1" "$2"
53
- fi
54
- else
55
- install_phalcon "$1" "$2"
56
- fi
57
- fi
58
-
59
- if [ "$extension_major_version" = "3" ]; then
60
- if [ -e "$ext_dir/phalcon.so" ]; then
61
- phalcon_version=$(php -d="extension=phalcon.so" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
62
- if [ "$phalcon_version" != "$extension_major_version" ]; then
63
- install_phalcon "$1" "$2"
64
- else
65
- echo "extension=phalcon.so" | sudo tee -a "$ini_file" >/dev/null 2>&1
66
- add_log "$tick" "$1" "Enabled"
67
- fi
68
- else
69
- install_phalcon "$1" "$2"
70
- fi
1
+ # Function to log result of a operation
2
+ add_log() {
3
+ mark=$1
4
+ subject=$2
5
+ message=$3
6
+ if [ "$mark" = "$tick" ]; then
7
+ printf "\033[32;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
8
+ else
9
+ printf "\033[31;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s\033[0m\n" "$mark" "$subject" "$message"
10
+ fi
11
+ }
12
+
13
+ # Function to update php ppa
14
+ update_ppa() {
15
+ if [ "$ppa_updated" = "false" ]; then
16
+ find /etc/apt/sources.list.d -type f -name 'ondrej-ubuntu-php*.list' -exec sudo DEBIAN_FRONTEND=noninteractive apt-get update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1
17
+ ppa_updated="true"
18
+ fi
19
+ }
20
+
21
+ # Function to install phalcon
22
+ install_phalcon() {
23
+ local extension=$1
24
+ version=$2
25
+ (update_ppa && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y "php$version-psr" "php$version-$extension" >/dev/null 2>&1 && add_log "$tick" "$extension" "Installed and enabled") ||
26
+ add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
27
+ }
28
+
29
+ ini_file="/etc/php/$2/cli/conf.d/50-phalcon.ini"
30
+ ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
31
+ semver=$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')
32
+ extension_major_version=$(echo "$1" | grep -i -Po '\d')
33
+ ppa_updated="false"
34
+ tick="✓"
35
+ cross="✗"
36
+
37
+ if [ "$extension_major_version" = "4" ]; then
38
+ if [ -e "$ext_dir/psr.so" ] && ! php -m | grep -i -q -w psr; then
39
+ echo "extension=psr.so" | sudo tee -a "$ini_file" >/dev/null 2>&1
40
+ fi
41
+
42
+ if [ -e "$ext_dir/phalcon.so" ]; then
43
+ if php -m | grep -i -q -w psr; then
44
+ phalcon_version=$(php -d="extension=phalcon" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
45
+ if [ "$phalcon_version" != "$extension_major_version" ]; then
46
+ install_phalcon "$1" "$2"
47
+ else
48
+ echo "extension=phalcon.so" | sudo tee -a "$ini_file" >/dev/null 2>&1
49
+ add_log "$tick" "$1" "Enabled"
50
+ fi
51
+ else
52
+ install_phalcon "$1" "$2"
53
+ fi
54
+ else
55
+ install_phalcon "$1" "$2"
56
+ fi
57
+ fi
58
+
59
+ if [ "$extension_major_version" = "3" ]; then
60
+ if [ -e "$ext_dir/phalcon.so" ]; then
61
+ phalcon_version=$(php -d="extension=phalcon.so" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
62
+ if [ "$phalcon_version" != "$extension_major_version" ]; then
63
+ install_phalcon "$1" "$2"
64
+ else
65
+ echo "extension=phalcon.so" | sudo tee -a "$ini_file" >/dev/null 2>&1
66
+ add_log "$tick" "$1" "Enabled"
67
+ fi
68
+ else
69
+ install_phalcon "$1" "$2"
70
+ fi
71
71
  fi