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/src/install.ts CHANGED
@@ -1,82 +1,79 @@
1
- import {exec} from '@actions/exec';
2
- import * as core from '@actions/core';
3
- import * as config from './config';
4
- import * as coverage from './coverage';
5
- import * as extensions from './extensions';
6
- import * as tools from './tools';
7
- import * as utils from './utils';
8
-
9
- /**
10
- * Build the script
11
- *
12
- * @param filename
13
- * @param version
14
- * @param os_version
15
- */
16
- export async function getScript(
17
- filename: string,
18
- version: string,
19
- os_version: string
20
- ): Promise<string> {
21
- const name = 'setup-php';
22
- const url = 'https://setup-php.com/support';
23
- // taking inputs
24
- process.env['fail_fast'] = await utils.getInput('fail-fast', false);
25
- const extension_csv: string = await utils.getInput('extensions', false);
26
- const ini_values_csv: string = await utils.getInput('ini-values', false);
27
- const coverage_driver: string = await utils.getInput('coverage', false);
28
- const tools_csv: string = await utils.getInput('tools', false);
29
-
30
- let script: string = await utils.readFile(filename, 'src/scripts');
31
- script += await tools.addTools(tools_csv, version, os_version);
32
-
33
- if (extension_csv) {
34
- script += await extensions.addExtension(extension_csv, version, os_version);
35
- }
36
- if (coverage_driver) {
37
- script += await coverage.addCoverage(coverage_driver, version, os_version);
38
- }
39
- if (ini_values_csv) {
40
- script += await config.addINIValues(ini_values_csv, os_version);
41
- }
42
-
43
- script += '\n' + (await utils.stepLog('Support this project', os_version));
44
- script += '\n' + (await utils.addLog('$tick', name, url, os_version));
45
-
46
- return await utils.writeScript(filename, script);
47
- }
48
-
49
- /**
50
- * Run the script
51
- */
52
- export async function run(): Promise<void> {
53
- try {
54
- if ((await utils.readEnv('ImageOS')) == 'ubuntu16') {
55
- core.setFailed(
56
- 'setup-php is not supported on Ubuntu 16.04. Please upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452'
57
- );
58
- return;
59
- }
60
- const version: string = await utils.parseVersion(
61
- await utils.getInput('php-version', true)
62
- );
63
- if (version) {
64
- const os_version: string = process.platform;
65
- const tool = await utils.scriptTool(os_version);
66
- const script = os_version + (await utils.scriptExtension(os_version));
67
- const location = await getScript(script, version, os_version);
68
- await exec(await utils.joins(tool, location, version, __dirname));
69
- } else {
70
- core.setFailed('Unable to get the PHP version');
71
- }
72
- } catch (error) {
73
- core.setFailed(error.message);
74
- }
75
- }
76
-
77
- // call the run function
78
- (async () => {
79
- await run();
80
- })().catch(error => {
81
- core.setFailed(error.message);
82
- });
1
+ import {exec} from '@actions/exec';
2
+ import * as core from '@actions/core';
3
+ import * as config from './config';
4
+ import * as coverage from './coverage';
5
+ import * as extensions from './extensions';
6
+ import * as tools from './tools';
7
+ import * as utils from './utils';
8
+
9
+ /**
10
+ * Build the script
11
+ *
12
+ * @param filename
13
+ * @param version
14
+ * @param os_version
15
+ */
16
+ export async function getScript(
17
+ filename: string,
18
+ version: string,
19
+ os_version: string
20
+ ): Promise<string> {
21
+ const url = 'https://setup-php.com/sponsor';
22
+ // taking inputs
23
+ process.env['fail_fast'] = await utils.getInput('fail-fast', false);
24
+ const extension_csv: string = await utils.getInput('extensions', false);
25
+ const ini_values_csv: string = await utils.getInput('ini-values', false);
26
+ const coverage_driver: string = await utils.getInput('coverage', false);
27
+ const tools_csv: string = await utils.getInput('tools', false);
28
+
29
+ let script: string = await utils.readFile(filename, 'src/scripts');
30
+ script += await tools.addTools(tools_csv, version, os_version);
31
+ if (extension_csv) {
32
+ script += await extensions.addExtension(extension_csv, version, os_version);
33
+ }
34
+ if (coverage_driver) {
35
+ script += await coverage.addCoverage(coverage_driver, version, os_version);
36
+ }
37
+ if (ini_values_csv) {
38
+ script += await config.addINIValues(ini_values_csv, os_version);
39
+ }
40
+ script += '\n' + (await utils.stepLog(`Sponsor setup-php`, os_version));
41
+ script += '\n' + (await utils.addLog('$tick', 'setup-php', url, os_version));
42
+
43
+ return await utils.writeScript(filename, script);
44
+ }
45
+
46
+ /**
47
+ * Run the script
48
+ */
49
+ export async function run(): Promise<void> {
50
+ try {
51
+ if ((await utils.readEnv('ImageOS')) == 'ubuntu16') {
52
+ core.setFailed(
53
+ 'setup-php is not supported on Ubuntu 16.04. Please upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452'
54
+ );
55
+ return;
56
+ }
57
+ const version: string = await utils.parseVersion(
58
+ await utils.getInput('php-version', true)
59
+ );
60
+ if (version) {
61
+ const os_version: string = process.platform;
62
+ const tool = await utils.scriptTool(os_version);
63
+ const script = os_version + (await utils.scriptExtension(os_version));
64
+ const location = await getScript(script, version, os_version);
65
+ await exec(await utils.joins(tool, location, version, __dirname));
66
+ } else {
67
+ core.setFailed('Unable to get the PHP version');
68
+ }
69
+ } catch (error) {
70
+ core.setFailed((error as Error).message);
71
+ }
72
+ }
73
+
74
+ // call the run function
75
+ (async () => {
76
+ await run();
77
+ })().catch(error => {
78
+ core.setFailed(error.message);
79
+ });