setup-php 2.13.0 → 2.17.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.
Files changed (134) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +990 -922
  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 +5 -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 +214 -200
  11. package/lib/extensions.js.map +1 -1
  12. package/lib/fetch.d.ts +1 -0
  13. package/lib/fetch.js +63 -0
  14. package/lib/fetch.js.map +1 -0
  15. package/lib/install.d.ts +2 -0
  16. package/lib/install.js +75 -81
  17. package/lib/install.js.map +1 -1
  18. package/lib/tools.d.ts +23 -0
  19. package/lib/tools.js +367 -386
  20. package/lib/tools.js.map +1 -1
  21. package/lib/utils.d.ts +21 -0
  22. package/lib/utils.js +261 -291
  23. package/lib/utils.js.map +1 -1
  24. package/package.json +67 -56
  25. package/src/config.ts +82 -82
  26. package/src/configs/brew_extensions +31 -0
  27. package/src/configs/composer.env +2 -0
  28. package/src/configs/ini/jit.ini +3 -0
  29. package/src/configs/ini/php.ini +2 -0
  30. package/src/configs/ini/xdebug.ini +1 -0
  31. package/src/configs/os_releases.csv +19 -17
  32. package/src/configs/php-versions.json +6 -5
  33. package/src/configs/php_packages +12 -0
  34. package/src/configs/{php.json → pm/php.json} +29 -29
  35. package/src/configs/{phpunit.json → pm/phpunit.json} +24 -24
  36. package/src/configs/tools.json +278 -235
  37. package/src/configs/tools_schema.json +125 -114
  38. package/src/coverage.ts +144 -142
  39. package/src/extensions.ts +367 -349
  40. package/src/fetch.ts +54 -0
  41. package/src/install.ts +66 -82
  42. package/src/scripts/darwin.sh +285 -249
  43. package/src/scripts/extensions/add_extensions.ps1 +194 -0
  44. package/src/scripts/extensions/add_extensions.sh +184 -0
  45. package/src/scripts/{ext → extensions}/blackfire.ps1 +32 -32
  46. package/src/scripts/{ext → extensions}/blackfire.sh +22 -21
  47. package/src/scripts/{ext → extensions}/couchbase.sh +43 -43
  48. package/src/scripts/{ext → extensions}/cubrid.sh +60 -60
  49. package/src/scripts/extensions/extension_map.php +132 -0
  50. package/src/scripts/{ext → extensions}/firebird.ps1 +19 -19
  51. package/src/scripts/{ext → extensions}/firebird.sh +39 -35
  52. package/src/scripts/{ext → extensions}/gearman.sh +22 -22
  53. package/src/scripts/{ext → extensions}/geos.sh +17 -17
  54. package/src/scripts/{ext → extensions}/http.ps1 +54 -54
  55. package/src/scripts/{ext → extensions}/http.sh +109 -120
  56. package/src/scripts/{ext → extensions}/intl.sh +23 -23
  57. package/src/scripts/{ext → extensions}/ioncube.ps1 +33 -32
  58. package/src/scripts/{ext → extensions}/ioncube.sh +21 -19
  59. package/src/scripts/{ext → extensions}/oci.ps1 +85 -60
  60. package/src/scripts/{ext → extensions}/oci.sh +65 -63
  61. package/src/scripts/{ext → extensions}/patches/firebird.sh +11 -11
  62. package/src/scripts/{ext → extensions}/patches/geos.sh +7 -7
  63. package/src/scripts/{ext → extensions}/patches/http.sh +11 -11
  64. package/src/scripts/{ext → extensions}/patches/pdo_oci.sh +6 -6
  65. package/src/scripts/{ext → extensions}/patches/phpize.sh +26 -26
  66. package/src/scripts/{ext → extensions}/patches/protobuf.sh +4 -4
  67. package/src/scripts/{ext → extensions}/phalcon.ps1 +54 -54
  68. package/src/scripts/{ext → extensions}/phalcon.sh +58 -58
  69. package/src/scripts/{ext → extensions}/source.sh +145 -144
  70. package/src/scripts/extensions/sqlsrv.sh +15 -0
  71. package/src/scripts/linux.sh +269 -256
  72. package/src/scripts/tools/add_tools.ps1 +239 -26
  73. package/src/scripts/tools/add_tools.sh +175 -20
  74. package/src/scripts/tools/blackfire.ps1 +19 -19
  75. package/src/scripts/tools/blackfire.sh +40 -39
  76. package/src/scripts/tools/grpc_php_plugin.ps1 +21 -21
  77. package/src/scripts/tools/grpc_php_plugin.sh +58 -58
  78. package/src/scripts/tools/ppa.sh +192 -151
  79. package/src/scripts/tools/protoc.ps1 +38 -38
  80. package/src/scripts/tools/protoc.sh +28 -28
  81. package/src/scripts/tools/symfony.ps1 +14 -0
  82. package/src/scripts/tools/symfony.sh +13 -0
  83. package/src/scripts/unix.sh +186 -0
  84. package/src/scripts/win32.ps1 +352 -494
  85. package/src/tools.ts +512 -538
  86. package/src/utils.ts +415 -500
  87. package/.eslintrc.json +0 -16
  88. package/.github/CODE_OF_CONDUCT.md +0 -76
  89. package/.github/CONTRIBUTING.md +0 -70
  90. package/.github/FUNDING.yml +0 -7
  91. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
  92. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
  93. package/.github/PULL_REQUEST_TEMPLATE.md +0 -37
  94. package/.github/SECURITY.md +0 -29
  95. package/.github/workflows/docs.yml +0 -77
  96. package/.github/workflows/node-workflow.yml +0 -51
  97. package/.github/workflows/workflow.yml +0 -78
  98. package/.idea/workspace.xml +0 -113
  99. package/.prettierrc.json +0 -12
  100. package/__tests__/config.test.ts +0 -52
  101. package/__tests__/coverage.test.ts +0 -110
  102. package/__tests__/extensions.test.ts +0 -263
  103. package/__tests__/install.test.ts +0 -175
  104. package/__tests__/tools.test.ts +0 -524
  105. package/__tests__/utils.test.ts +0 -307
  106. package/action.yml +0 -29
  107. package/dist/index.js +0 -3051
  108. package/examples/bedrock.yml +0 -32
  109. package/examples/blackfire-player.yml +0 -31
  110. package/examples/blackfire.yml +0 -31
  111. package/examples/cakephp-mysql.yml +0 -114
  112. package/examples/cakephp-postgres.yml +0 -112
  113. package/examples/cakephp.yml +0 -92
  114. package/examples/codeigniter.yml +0 -34
  115. package/examples/laravel-mysql.yml +0 -74
  116. package/examples/laravel-postgres.yml +0 -74
  117. package/examples/laravel.yml +0 -42
  118. package/examples/lumen-mysql.yml +0 -74
  119. package/examples/lumen-postgres.yml +0 -74
  120. package/examples/lumen.yml +0 -38
  121. package/examples/phalcon-mysql.yml +0 -74
  122. package/examples/phalcon-postgres.yml +0 -73
  123. package/examples/sage.yml +0 -57
  124. package/examples/slim-framework.yml +0 -34
  125. package/examples/symfony-mysql.yml +0 -57
  126. package/examples/symfony-postgres.yml +0 -55
  127. package/examples/symfony.yml +0 -39
  128. package/examples/yii2-mysql.yml +0 -73
  129. package/examples/yii2-postgres.yml +0 -71
  130. package/examples/zend-framework.yml +0 -36
  131. package/jest.config.js +0 -12
  132. package/lib/sapi.js +0 -64
  133. package/src/scripts/common.sh +0 -314
  134. package/tsconfig.json +0 -18
package/package.json CHANGED
@@ -1,56 +1,67 @@
1
- {
2
- "name": "setup-php",
3
- "version": "2.13.0",
4
- "private": false,
5
- "description": "Setup PHP for use with GitHub Actions",
6
- "main": "lib/install.js",
7
- "scripts": {
8
- "build": "tsc",
9
- "lint": "eslint **/*.ts --cache --fix",
10
- "format": "prettier --write **/*.ts && git add .",
11
- "format-check": "prettier --check **/*.ts",
12
- "release": "ncc build -o dist && git add -f dist/",
13
- "test": "jest"
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "git+https://github.com/shivammathur/setup-php.git"
18
- },
19
- "keywords": [
20
- "actions",
21
- "php",
22
- "setup"
23
- ],
24
- "author": "shivammathur",
25
- "license": "MIT",
26
- "dependencies": {
27
- "@actions/core": "^1.5.0",
28
- "@actions/exec": "^1.1.0",
29
- "@actions/io": "^1.1.1",
30
- "fs": "0.0.1-security"
31
- },
32
- "devDependencies": {
33
- "@types/jest": "^27.0.1",
34
- "@types/node": "^16.7.1",
35
- "@typescript-eslint/eslint-plugin": "^4.29.2",
36
- "@typescript-eslint/parser": "^4.29.2",
37
- "@vercel/ncc": "^0.29.2",
38
- "eslint": "^7.32.0",
39
- "eslint-config-prettier": "^8.3.0",
40
- "eslint-plugin-import": "^2.24.1",
41
- "eslint-plugin-jest": "^24.4.0",
42
- "eslint-plugin-prettier": "^3.4.1",
43
- "husky": "^4.3.8",
44
- "jest": "^27.0.6",
45
- "jest-circus": "^27.0.6",
46
- "prettier": "^2.3.2",
47
- "ts-jest": "^27.0.5",
48
- "typescript": "^4.3.5"
49
- },
50
- "husky": {
51
- "skipCI": true,
52
- "hooks": {
53
- "pre-commit": "npm run format && npm run lint && npm run test && npm run build && npm run release"
54
- }
55
- }
56
- }
1
+ {
2
+ "name": "setup-php",
3
+ "version": "2.17.0",
4
+ "private": false,
5
+ "description": "Setup PHP for use with GitHub Actions",
6
+ "main": "lib/install.js",
7
+ "types": "lib/install.d.ts",
8
+ "directories": {
9
+ "lib": "lib",
10
+ "test": "__tests__",
11
+ "src": "src"
12
+ },
13
+ "files": [
14
+ "lib",
15
+ "src"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "lint": "eslint **/src/*.ts **/__tests__/*.ts --cache --fix",
20
+ "format": "prettier --write **/src/*.ts **/__tests__/*.ts && git add -f src/",
21
+ "format-check": "prettier --check **/src/*.ts **/__tests__/*.ts",
22
+ "release": "ncc build -o dist && git add -f dist/",
23
+ "test": "jest"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/shivammathur/setup-php.git"
28
+ },
29
+ "keywords": [
30
+ "actions",
31
+ "php",
32
+ "setup"
33
+ ],
34
+ "author": "shivammathur",
35
+ "license": "MIT",
36
+ "dependencies": {
37
+ "@actions/core": "^1.6.0",
38
+ "@actions/exec": "^1.1.0",
39
+ "@actions/io": "^1.1.1",
40
+ "fs": "0.0.1-security"
41
+ },
42
+ "devDependencies": {
43
+ "@types/jest": "^27.4.0",
44
+ "@types/node": "^17.0.16",
45
+ "@typescript-eslint/eslint-plugin": "^5.11.0",
46
+ "@typescript-eslint/parser": "^5.11.0",
47
+ "@vercel/ncc": "^0.33.1",
48
+ "eslint": "^8.8.0",
49
+ "eslint-config-prettier": "^8.3.0",
50
+ "eslint-plugin-import": "^2.25.4",
51
+ "eslint-plugin-jest": "^26.1.0",
52
+ "eslint-plugin-prettier": "^4.0.0",
53
+ "jest": "^27.5.1",
54
+ "jest-circus": "^27.5.1",
55
+ "nock": "^13.2.4",
56
+ "prettier": "^2.5.1",
57
+ "simple-git-hooks": "^2.7.0",
58
+ "ts-jest": "^27.1.3",
59
+ "typescript": "^4.5.5"
60
+ },
61
+ "bugs": {
62
+ "url": "https://github.com/shivammathur/setup-php/issues"
63
+ },
64
+ "simple-git-hooks": {
65
+ "pre-commit": "npm run format && npm run lint && npm run test && npm run build && npm run release"
66
+ }
67
+ }
package/src/config.ts CHANGED
@@ -1,82 +1,82 @@
1
- import * as utils from './utils';
2
-
3
- /**
4
- * Add script to set custom ini values for unix
5
- *
6
- * @param ini_values_csv
7
- */
8
- export async function addINIValuesUnix(
9
- ini_values_csv: string
10
- ): Promise<string> {
11
- const ini_values: Array<string> = await utils.CSVArray(ini_values_csv);
12
- let script = '';
13
- await utils.asyncForEach(ini_values, async function (line: string) {
14
- script +=
15
- '\n' + (await utils.addLog('$tick', line, 'Added to php.ini', 'linux'));
16
- });
17
- return (
18
- 'echo "' +
19
- ini_values.join('\n') +
20
- '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' +
21
- script
22
- );
23
- }
24
-
25
- /**
26
- * Add script to set custom ini values for windows
27
- *
28
- * @param ini_values_csv
29
- */
30
- export async function addINIValuesWindows(
31
- ini_values_csv: string
32
- ): Promise<string> {
33
- const ini_values: Array<string> = await utils.CSVArray(ini_values_csv);
34
- let script = '\n';
35
- await utils.asyncForEach(ini_values, async function (line: string) {
36
- script +=
37
- (await utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n';
38
- });
39
- return (
40
- 'Add-Content "$php_dir\\php.ini" "' + ini_values.join('\n') + '"' + script
41
- );
42
- }
43
-
44
- /**
45
- * Function to add custom ini values
46
- *
47
- * @param ini_values_csv
48
- * @param os_version
49
- * @param no_step
50
- */
51
- export async function addINIValues(
52
- ini_values_csv: string,
53
- os_version: string,
54
- no_step = false
55
- ): Promise<string> {
56
- let script = '\n';
57
- switch (no_step) {
58
- case true:
59
- script +=
60
- (await utils.stepLog('Add php.ini values', os_version)) +
61
- (await utils.suppressOutput(os_version)) +
62
- '\n';
63
- break;
64
- case false:
65
- default:
66
- script += (await utils.stepLog('Add php.ini values', os_version)) + '\n';
67
- break;
68
- }
69
- switch (os_version) {
70
- case 'win32':
71
- return script + (await addINIValuesWindows(ini_values_csv));
72
- case 'darwin':
73
- case 'linux':
74
- return script + (await addINIValuesUnix(ini_values_csv));
75
- default:
76
- return await utils.log(
77
- 'Platform ' + os_version + ' is not supported',
78
- os_version,
79
- 'error'
80
- );
81
- }
82
- }
1
+ import * as utils from './utils';
2
+
3
+ /**
4
+ * Add script to set custom ini values for unix
5
+ *
6
+ * @param ini_values_csv
7
+ */
8
+ export async function addINIValuesUnix(
9
+ ini_values_csv: string
10
+ ): Promise<string> {
11
+ const ini_values: Array<string> = await utils.CSVArray(ini_values_csv);
12
+ let script = '';
13
+ await utils.asyncForEach(ini_values, async function (line: string) {
14
+ script +=
15
+ '\n' + (await utils.addLog('$tick', line, 'Added to php.ini', 'linux'));
16
+ });
17
+ return (
18
+ 'echo "' +
19
+ ini_values.join('\n') +
20
+ '" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' +
21
+ script
22
+ );
23
+ }
24
+
25
+ /**
26
+ * Add script to set custom ini values for windows
27
+ *
28
+ * @param ini_values_csv
29
+ */
30
+ export async function addINIValuesWindows(
31
+ ini_values_csv: string
32
+ ): Promise<string> {
33
+ const ini_values: Array<string> = await utils.CSVArray(ini_values_csv);
34
+ let script = '\n';
35
+ await utils.asyncForEach(ini_values, async function (line: string) {
36
+ script +=
37
+ (await utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n';
38
+ });
39
+ return (
40
+ 'Add-Content "$php_dir\\php.ini" "' + ini_values.join('\n') + '"' + script
41
+ );
42
+ }
43
+
44
+ /**
45
+ * Function to add custom ini values
46
+ *
47
+ * @param ini_values_csv
48
+ * @param os
49
+ * @param no_step
50
+ */
51
+ export async function addINIValues(
52
+ ini_values_csv: string,
53
+ os: string,
54
+ no_step = false
55
+ ): Promise<string> {
56
+ let script = '\n';
57
+ switch (no_step) {
58
+ case true:
59
+ script +=
60
+ (await utils.stepLog('Add php.ini values', os)) +
61
+ (await utils.suppressOutput(os)) +
62
+ '\n';
63
+ break;
64
+ case false:
65
+ default:
66
+ script += (await utils.stepLog('Add php.ini values', os)) + '\n';
67
+ break;
68
+ }
69
+ switch (os) {
70
+ case 'win32':
71
+ return script + (await addINIValuesWindows(ini_values_csv));
72
+ case 'darwin':
73
+ case 'linux':
74
+ return script + (await addINIValuesUnix(ini_values_csv));
75
+ default:
76
+ return await utils.log(
77
+ 'Platform ' + os + ' is not supported',
78
+ os,
79
+ 'error'
80
+ );
81
+ }
82
+ }
@@ -0,0 +1,31 @@
1
+ amqp=amqp
2
+ apcu=apcu
3
+ expect=expect
4
+ gnupg=gnupg
5
+ grpc=grpc
6
+ igbinary=igbinary
7
+ imagick=imagick
8
+ imap=imap
9
+ mailparse=mailparse
10
+ memcache=memcache
11
+ memcached=memcached
12
+ mongodb=mongodb
13
+ msgpack=msgpack
14
+ pcov=pcov
15
+ pecl_http=http
16
+ phalcon3=phalcon
17
+ phalcon4=phalcon
18
+ propro=propro
19
+ protobuf=protobuf
20
+ psr=psr
21
+ raphf=raphf
22
+ rdkafka=rdkafka
23
+ redis=redis
24
+ ssh2=ssh2
25
+ swoole=swoole
26
+ vips=vips
27
+ xdebug=xdebug
28
+ xdebug2=xdebug
29
+ xlswriter=xlswriter
30
+ yaml=yaml
31
+ zmq=zmq
@@ -0,0 +1,2 @@
1
+ COMPOSER_PROCESS_TIMEOUT=0
2
+ COMPOSER_NO_INTERACTION=1
@@ -0,0 +1,3 @@
1
+ opcache.enable=1
2
+ opcache.jit_buffer_size=256M
3
+ opcache.jit=1235
@@ -0,0 +1,2 @@
1
+ date.timezone=UTC
2
+ memory_limit=-1
@@ -0,0 +1 @@
1
+ xdebug.mode=coverage
@@ -1,17 +1,19 @@
1
- 8,jessie
2
- 9,stretch
3
- 10,buster
4
- 11,bullseye
5
- 12,bookworm
6
- 16.04 LTS,xenial
7
- 16.10,yakkety
8
- 17.04,zesty
9
- 17.10,artful
10
- 18.04 LTS,bionic
11
- 18.10,cosmic
12
- 19.04,disco
13
- 19.10,eoan
14
- 20.04 LTS,focal
15
- 20.10,groovy
16
- 21.04,hirsute
17
- 21.10,impish
1
+ 8,jessie
2
+ 9,stretch
3
+ 10,buster
4
+ 11,bullseye
5
+ 12,bookworm
6
+ 13,trixie
7
+ 16.04 LTS,xenial
8
+ 16.10,yakkety
9
+ 17.04,zesty
10
+ 17.10,artful
11
+ 18.04 LTS,bionic
12
+ 18.10,cosmic
13
+ 19.04,disco
14
+ 19.10,eoan
15
+ 20.04 LTS,focal
16
+ 20.10,groovy
17
+ 21.04,hirsute
18
+ 21.10,impish
19
+ 22.04,jammy
@@ -1,6 +1,7 @@
1
- {
2
- "latest": "8.0",
3
- "5.x": "5.6",
4
- "7.x": "7.4",
5
- "8.x": "8.0"
1
+ {
2
+ "latest": "8.1",
3
+ "nightly": "8.2",
4
+ "5.x": "5.6",
5
+ "7.x": "7.4",
6
+ "8.x": "8.1"
6
7
  }
@@ -0,0 +1,12 @@
1
+ cgi
2
+ cli
3
+ curl
4
+ dev
5
+ fpm
6
+ intl
7
+ mbstring
8
+ mysql
9
+ opcache
10
+ pgsql
11
+ xml
12
+ zip
@@ -1,29 +1,29 @@
1
- {
2
- "problemMatcher": [
3
- {
4
- "owner": "php_native_error",
5
- "severity": "error",
6
- "pattern": [
7
- {
8
- "regexp": "^(.*error):\\s+\\s+(.+) in (.+) on line (\\d+)$",
9
- "code": 1,
10
- "message": 2,
11
- "file": 3,
12
- "line": 4
13
- }
14
- ]
15
- }, {
16
- "owner": "php_native_warning",
17
- "severity": "warning",
18
- "pattern": [
19
- {
20
- "regexp": "^(.*Warning|.*Deprecated|.*Notice):\\s+\\s+(.+) in (.+) on line (\\d+)$",
21
- "code": 1,
22
- "message": 2,
23
- "file": 3,
24
- "line": 4
25
- }
26
- ]
27
- }
28
- ]
29
- }
1
+ {
2
+ "problemMatcher": [
3
+ {
4
+ "owner": "php_native_error",
5
+ "severity": "error",
6
+ "pattern": [
7
+ {
8
+ "regexp": "^(.*error):\\s+\\s+(.+) in (.+) on line (\\d+)$",
9
+ "code": 1,
10
+ "message": 2,
11
+ "file": 3,
12
+ "line": 4
13
+ }
14
+ ]
15
+ }, {
16
+ "owner": "php_native_warning",
17
+ "severity": "warning",
18
+ "pattern": [
19
+ {
20
+ "regexp": "^(.*Warning|.*Deprecated|.*Notice):\\s+\\s+(.+) in (.+) on line (\\d+)$",
21
+ "code": 1,
22
+ "message": 2,
23
+ "file": 3,
24
+ "line": 4
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ }
@@ -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
+ }