setup-php 2.12.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.
Files changed (113) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +977 -936
  3. package/package.json +66 -56
  4. package/src/config.ts +82 -82
  5. package/src/configs/brew_extensions +30 -0
  6. package/src/configs/os_releases.csv +17 -0
  7. package/src/configs/php-versions.json +6 -5
  8. package/src/configs/{php.json → pm/php.json} +29 -29
  9. package/src/configs/{phpunit.json → pm/phpunit.json} +24 -24
  10. package/src/configs/tools.json +256 -234
  11. package/src/configs/tools_schema.json +114 -103
  12. package/src/coverage.ts +169 -142
  13. package/src/extensions.ts +363 -349
  14. package/src/install.ts +79 -82
  15. package/src/scripts/common.sh +366 -314
  16. package/src/scripts/darwin.sh +257 -248
  17. package/src/scripts/ext/blackfire.ps1 +32 -32
  18. package/src/scripts/ext/blackfire.sh +22 -21
  19. package/src/scripts/ext/couchbase.sh +43 -43
  20. package/src/scripts/ext/cubrid.sh +60 -60
  21. package/src/scripts/ext/extension_map.php +109 -0
  22. package/src/scripts/ext/firebird.ps1 +19 -19
  23. package/src/scripts/ext/firebird.sh +39 -35
  24. package/src/scripts/ext/gearman.sh +22 -22
  25. package/src/scripts/ext/geos.sh +17 -17
  26. package/src/scripts/ext/http.ps1 +54 -54
  27. package/src/scripts/ext/http.sh +120 -120
  28. package/src/scripts/ext/intl.sh +23 -23
  29. package/src/scripts/ext/ioncube.ps1 +33 -32
  30. package/src/scripts/ext/ioncube.sh +21 -19
  31. package/src/scripts/ext/oci.ps1 +60 -60
  32. package/src/scripts/ext/oci.sh +65 -63
  33. package/src/scripts/ext/patches/firebird.sh +11 -11
  34. package/src/scripts/ext/patches/geos.sh +7 -7
  35. package/src/scripts/ext/patches/http.sh +11 -11
  36. package/src/scripts/ext/patches/pdo_oci.sh +6 -6
  37. package/src/scripts/ext/patches/phpize.sh +26 -26
  38. package/src/scripts/ext/patches/protobuf.sh +4 -4
  39. package/src/scripts/ext/phalcon.ps1 +54 -55
  40. package/src/scripts/ext/phalcon.sh +59 -59
  41. package/src/scripts/ext/source.sh +144 -144
  42. package/src/scripts/linux.sh +239 -280
  43. package/src/scripts/tools/add_tools.ps1 +28 -25
  44. package/src/scripts/tools/add_tools.sh +27 -19
  45. package/src/scripts/tools/blackfire.ps1 +19 -21
  46. package/src/scripts/tools/blackfire.sh +40 -35
  47. package/src/scripts/tools/grpc_php_plugin.ps1 +21 -21
  48. package/src/scripts/tools/grpc_php_plugin.sh +58 -61
  49. package/src/scripts/tools/ppa.sh +189 -0
  50. package/src/scripts/tools/protoc.ps1 +38 -38
  51. package/src/scripts/tools/protoc.sh +28 -28
  52. package/src/scripts/win32.ps1 +566 -471
  53. package/src/tools.ts +538 -509
  54. package/src/utils.ts +503 -497
  55. package/.eslintrc.json +0 -16
  56. package/.github/CODE_OF_CONDUCT.md +0 -76
  57. package/.github/CONTRIBUTING.md +0 -70
  58. package/.github/FUNDING.yml +0 -7
  59. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
  60. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
  61. package/.github/PULL_REQUEST_TEMPLATE.md +0 -37
  62. package/.github/SECURITY.md +0 -29
  63. package/.github/workflows/docs.yml +0 -77
  64. package/.github/workflows/node-workflow.yml +0 -51
  65. package/.github/workflows/workflow.yml +0 -78
  66. package/.idea/workspace.xml +0 -113
  67. package/.prettierrc.json +0 -12
  68. package/__tests__/config.test.ts +0 -52
  69. package/__tests__/coverage.test.ts +0 -110
  70. package/__tests__/extensions.test.ts +0 -261
  71. package/__tests__/install.test.ts +0 -175
  72. package/__tests__/tools.test.ts +0 -490
  73. package/__tests__/utils.test.ts +0 -303
  74. package/action.yml +0 -29
  75. package/dist/index.js +0 -3001
  76. package/examples/bedrock.yml +0 -32
  77. package/examples/blackfire-player.yml +0 -31
  78. package/examples/blackfire.yml +0 -31
  79. package/examples/cakephp-mysql.yml +0 -114
  80. package/examples/cakephp-postgres.yml +0 -112
  81. package/examples/cakephp.yml +0 -92
  82. package/examples/codeigniter.yml +0 -34
  83. package/examples/laravel-mysql.yml +0 -74
  84. package/examples/laravel-postgres.yml +0 -74
  85. package/examples/laravel.yml +0 -42
  86. package/examples/lumen-mysql.yml +0 -74
  87. package/examples/lumen-postgres.yml +0 -74
  88. package/examples/lumen.yml +0 -38
  89. package/examples/phalcon-mysql.yml +0 -74
  90. package/examples/phalcon-postgres.yml +0 -73
  91. package/examples/sage.yml +0 -57
  92. package/examples/slim-framework.yml +0 -34
  93. package/examples/symfony-mysql.yml +0 -57
  94. package/examples/symfony-postgres.yml +0 -55
  95. package/examples/symfony.yml +0 -39
  96. package/examples/yii2-mysql.yml +0 -73
  97. package/examples/yii2-postgres.yml +0 -71
  98. package/examples/zend-framework.yml +0 -36
  99. package/jest.config.js +0 -12
  100. package/lib/config.js +0 -72
  101. package/lib/config.js.map +0 -1
  102. package/lib/coverage.js +0 -88
  103. package/lib/coverage.js.map +0 -1
  104. package/lib/extensions.js +0 -201
  105. package/lib/extensions.js.map +0 -1
  106. package/lib/install.js +0 -82
  107. package/lib/install.js.map +0 -1
  108. package/lib/sapi.js +0 -64
  109. package/lib/tools.js +0 -387
  110. package/lib/tools.js.map +0 -1
  111. package/lib/utils.js +0 -292
  112. package/lib/utils.js.map +0 -1
  113. package/tsconfig.json +0 -18
package/package.json CHANGED
@@ -1,56 +1,66 @@
1
- {
2
- "name": "setup-php",
3
- "version": "2.12.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.4.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": "^26.0.24",
34
- "@types/node": "^16.3.2",
35
- "@typescript-eslint/eslint-plugin": "^4.28.3",
36
- "@typescript-eslint/parser": "^4.28.3",
37
- "@vercel/ncc": "^0.28.6",
38
- "eslint": "^7.30.0",
39
- "eslint-config-prettier": "^8.3.0",
40
- "eslint-plugin-import": "^2.23.4",
41
- "eslint-plugin-jest": "^24.3.6",
42
- "eslint-plugin-prettier": "^3.4.0",
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.3",
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.16.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 --cache --fix",
20
+ "format": "prettier --write **/src/*.ts && git add -f src/",
21
+ "format-check": "prettier --check **/src/*.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.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
+ "eslint-config-prettier": "^8.3.0",
50
+ "eslint-plugin-import": "^2.25.3",
51
+ "eslint-plugin-jest": "^25.3.0",
52
+ "eslint-plugin-prettier": "^4.0.0",
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
+ },
60
+ "bugs": {
61
+ "url": "https://github.com/shivammathur/setup-php/issues"
62
+ },
63
+ "simple-git-hooks": {
64
+ "pre-commit": "npm run format && npm run lint && npm run test && npm run build && npm run release"
65
+ }
66
+ }
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_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
+ }
@@ -0,0 +1,30 @@
1
+ amqp=amqp
2
+ apcu=apcu
3
+ expect=expect
4
+ grpc=grpc
5
+ igbinary=igbinary
6
+ imagick=imagick
7
+ imap=imap
8
+ mailparse=mailparse
9
+ memcache=memcache
10
+ memcached=memcached
11
+ mongodb=mongodb
12
+ msgpack=msgpack
13
+ pcov=pcov
14
+ pecl_http=http
15
+ phalcon3=phalcon
16
+ phalcon4=phalcon
17
+ propro=propro
18
+ protobuf=protobuf
19
+ psr=psr
20
+ raphf=raphf
21
+ rdkafka=rdkafka
22
+ redis=redis
23
+ ssh2=ssh2
24
+ swoole=swoole
25
+ vips=vips
26
+ xdebug=xdebug
27
+ xdebug2=xdebug
28
+ xlswriter=xlswriter
29
+ yaml=yaml
30
+ zmq=zmq
@@ -0,0 +1,17 @@
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,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
  }
@@ -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
+ }