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.
- package/LICENSE +21 -21
- package/README.md +990 -922
- package/lib/config.d.ts +3 -0
- package/lib/config.js +71 -71
- package/lib/config.js.map +1 -1
- package/lib/coverage.d.ts +5 -0
- package/lib/coverage.js +97 -87
- package/lib/coverage.js.map +1 -1
- package/lib/extensions.d.ts +4 -0
- package/lib/extensions.js +214 -200
- package/lib/extensions.js.map +1 -1
- package/lib/fetch.d.ts +1 -0
- package/lib/fetch.js +63 -0
- package/lib/fetch.js.map +1 -0
- package/lib/install.d.ts +2 -0
- package/lib/install.js +75 -81
- package/lib/install.js.map +1 -1
- package/lib/tools.d.ts +23 -0
- package/lib/tools.js +367 -386
- package/lib/tools.js.map +1 -1
- package/lib/utils.d.ts +21 -0
- package/lib/utils.js +261 -291
- package/lib/utils.js.map +1 -1
- package/package.json +67 -56
- package/src/config.ts +82 -82
- package/src/configs/brew_extensions +31 -0
- package/src/configs/composer.env +2 -0
- package/src/configs/ini/jit.ini +3 -0
- package/src/configs/ini/php.ini +2 -0
- package/src/configs/ini/xdebug.ini +1 -0
- package/src/configs/os_releases.csv +19 -17
- package/src/configs/php-versions.json +6 -5
- package/src/configs/php_packages +12 -0
- package/src/configs/{php.json → pm/php.json} +29 -29
- package/src/configs/{phpunit.json → pm/phpunit.json} +24 -24
- package/src/configs/tools.json +278 -235
- package/src/configs/tools_schema.json +125 -114
- package/src/coverage.ts +144 -142
- package/src/extensions.ts +367 -349
- package/src/fetch.ts +54 -0
- package/src/install.ts +66 -82
- package/src/scripts/darwin.sh +285 -249
- package/src/scripts/extensions/add_extensions.ps1 +194 -0
- package/src/scripts/extensions/add_extensions.sh +184 -0
- package/src/scripts/{ext → extensions}/blackfire.ps1 +32 -32
- package/src/scripts/{ext → extensions}/blackfire.sh +22 -21
- package/src/scripts/{ext → extensions}/couchbase.sh +43 -43
- package/src/scripts/{ext → extensions}/cubrid.sh +60 -60
- package/src/scripts/extensions/extension_map.php +132 -0
- package/src/scripts/{ext → extensions}/firebird.ps1 +19 -19
- package/src/scripts/{ext → extensions}/firebird.sh +39 -35
- package/src/scripts/{ext → extensions}/gearman.sh +22 -22
- package/src/scripts/{ext → extensions}/geos.sh +17 -17
- package/src/scripts/{ext → extensions}/http.ps1 +54 -54
- package/src/scripts/{ext → extensions}/http.sh +109 -120
- package/src/scripts/{ext → extensions}/intl.sh +23 -23
- package/src/scripts/{ext → extensions}/ioncube.ps1 +33 -32
- package/src/scripts/{ext → extensions}/ioncube.sh +21 -19
- package/src/scripts/{ext → extensions}/oci.ps1 +85 -60
- package/src/scripts/{ext → extensions}/oci.sh +65 -63
- package/src/scripts/{ext → extensions}/patches/firebird.sh +11 -11
- package/src/scripts/{ext → extensions}/patches/geos.sh +7 -7
- package/src/scripts/{ext → extensions}/patches/http.sh +11 -11
- package/src/scripts/{ext → extensions}/patches/pdo_oci.sh +6 -6
- package/src/scripts/{ext → extensions}/patches/phpize.sh +26 -26
- package/src/scripts/{ext → extensions}/patches/protobuf.sh +4 -4
- package/src/scripts/{ext → extensions}/phalcon.ps1 +54 -54
- package/src/scripts/{ext → extensions}/phalcon.sh +58 -58
- package/src/scripts/{ext → extensions}/source.sh +145 -144
- package/src/scripts/extensions/sqlsrv.sh +15 -0
- package/src/scripts/linux.sh +269 -256
- package/src/scripts/tools/add_tools.ps1 +239 -26
- package/src/scripts/tools/add_tools.sh +175 -20
- package/src/scripts/tools/blackfire.ps1 +19 -19
- package/src/scripts/tools/blackfire.sh +40 -39
- package/src/scripts/tools/grpc_php_plugin.ps1 +21 -21
- package/src/scripts/tools/grpc_php_plugin.sh +58 -58
- package/src/scripts/tools/ppa.sh +192 -151
- package/src/scripts/tools/protoc.ps1 +38 -38
- package/src/scripts/tools/protoc.sh +28 -28
- package/src/scripts/tools/symfony.ps1 +14 -0
- package/src/scripts/tools/symfony.sh +13 -0
- package/src/scripts/unix.sh +186 -0
- package/src/scripts/win32.ps1 +352 -494
- package/src/tools.ts +512 -538
- package/src/utils.ts +415 -500
- package/.eslintrc.json +0 -16
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/CONTRIBUTING.md +0 -70
- package/.github/FUNDING.yml +0 -7
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -37
- package/.github/SECURITY.md +0 -29
- package/.github/workflows/docs.yml +0 -77
- package/.github/workflows/node-workflow.yml +0 -51
- package/.github/workflows/workflow.yml +0 -78
- package/.idea/workspace.xml +0 -113
- package/.prettierrc.json +0 -12
- package/__tests__/config.test.ts +0 -52
- package/__tests__/coverage.test.ts +0 -110
- package/__tests__/extensions.test.ts +0 -263
- package/__tests__/install.test.ts +0 -175
- package/__tests__/tools.test.ts +0 -524
- package/__tests__/utils.test.ts +0 -307
- package/action.yml +0 -29
- package/dist/index.js +0 -3051
- package/examples/bedrock.yml +0 -32
- package/examples/blackfire-player.yml +0 -31
- package/examples/blackfire.yml +0 -31
- package/examples/cakephp-mysql.yml +0 -114
- package/examples/cakephp-postgres.yml +0 -112
- package/examples/cakephp.yml +0 -92
- package/examples/codeigniter.yml +0 -34
- package/examples/laravel-mysql.yml +0 -74
- package/examples/laravel-postgres.yml +0 -74
- package/examples/laravel.yml +0 -42
- package/examples/lumen-mysql.yml +0 -74
- package/examples/lumen-postgres.yml +0 -74
- package/examples/lumen.yml +0 -38
- package/examples/phalcon-mysql.yml +0 -74
- package/examples/phalcon-postgres.yml +0 -73
- package/examples/sage.yml +0 -57
- package/examples/slim-framework.yml +0 -34
- package/examples/symfony-mysql.yml +0 -57
- package/examples/symfony-postgres.yml +0 -55
- package/examples/symfony.yml +0 -39
- package/examples/yii2-mysql.yml +0 -73
- package/examples/yii2-postgres.yml +0 -71
- package/examples/zend-framework.yml +0 -36
- package/jest.config.js +0 -12
- package/lib/sapi.js +0 -64
- package/src/scripts/common.sh +0 -314
- package/tsconfig.json +0 -18
|
@@ -1,115 +1,126 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/tools_schema.json",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"title": "Tools",
|
|
6
|
-
"default": {},
|
|
7
|
-
"examples": [
|
|
8
|
-
{
|
|
9
|
-
"tool": {
|
|
10
|
-
"alias": "tool_alias",
|
|
11
|
-
"domain": "https://example.com",
|
|
12
|
-
"extension": ".ext",
|
|
13
|
-
"fetch_latest": "true",
|
|
14
|
-
"function": "function_name",
|
|
15
|
-
"repository": "user/tool",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/tools_schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"title": "Tools",
|
|
6
|
+
"default": {},
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"tool": {
|
|
10
|
+
"alias": "tool_alias",
|
|
11
|
+
"domain": "https://example.com",
|
|
12
|
+
"extension": ".ext",
|
|
13
|
+
"fetch_latest": "true",
|
|
14
|
+
"function": "function_name",
|
|
15
|
+
"repository": "user/tool",
|
|
16
|
+
"scope": "global, scoped",
|
|
17
|
+
"type": "phar, composer, custom-package or custom-function",
|
|
18
|
+
"version_parameter": "--version",
|
|
19
|
+
"version_prefix": "v"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"items": {
|
|
24
|
+
"properties": {
|
|
25
|
+
"alias": {
|
|
26
|
+
"$id": "#/items/properties/alias",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"title": "The alias schema",
|
|
29
|
+
"description": "Alias for a tool.",
|
|
30
|
+
"examples": [
|
|
31
|
+
"tool_alias"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"domain": {
|
|
35
|
+
"$id": "#/items/properties/domain",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"title": "The domain schema",
|
|
38
|
+
"description": "Domain URL of the tool.",
|
|
39
|
+
"examples": [
|
|
40
|
+
"https://example.com"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"extension": {
|
|
44
|
+
"$id": "#/items/properties/extension",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"title": "The extension schema",
|
|
47
|
+
"description": "File extension of the tool.",
|
|
48
|
+
"examples": [
|
|
49
|
+
".ext"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"fetch_latest": {
|
|
53
|
+
"$id": "#/items/properties/fetch_latest",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"title": "The fetch_latest schema",
|
|
56
|
+
"description": "Fetch the latest version from GitHub releases.",
|
|
57
|
+
"enum": [
|
|
58
|
+
"true",
|
|
59
|
+
"false"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"function": {
|
|
63
|
+
"$id": "#/items/properties/function",
|
|
64
|
+
"type": "string",
|
|
65
|
+
"title": "The function schema",
|
|
66
|
+
"description": "Function name in tools.ts which returns the script to setup the tool.",
|
|
67
|
+
"examples": [
|
|
68
|
+
"function_name"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"repository": {
|
|
72
|
+
"$id": "#/items/properties/repository",
|
|
73
|
+
"type": "string",
|
|
74
|
+
"title": "The repository schema",
|
|
75
|
+
"description": "GitHub repository of the tool.",
|
|
76
|
+
"examples": [
|
|
77
|
+
"user/tool"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"scope": {
|
|
81
|
+
"$id": "#/items/properties/scope",
|
|
82
|
+
"type": "string",
|
|
83
|
+
"title": "The scope schema",
|
|
84
|
+
"description": "Scope of tool installation: global or scoped",
|
|
85
|
+
"enum": [
|
|
86
|
+
"global",
|
|
87
|
+
"scoped"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"type": {
|
|
91
|
+
"$id": "#/items/properties/type",
|
|
92
|
+
"type": "string",
|
|
93
|
+
"title": "The type schema",
|
|
94
|
+
"description": "Type of tool: phar, composer, custom-package or custom-function.",
|
|
95
|
+
"enum": [
|
|
96
|
+
"phar",
|
|
97
|
+
"composer",
|
|
98
|
+
"custom-package",
|
|
99
|
+
"custom-function"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"version_parameter": {
|
|
103
|
+
"$id": "#/items/properties/version_parameter",
|
|
104
|
+
"type": "string",
|
|
105
|
+
"title": "The version_parameter schema",
|
|
106
|
+
"description": "Parameter to get the tool version.",
|
|
107
|
+
"examples": [
|
|
108
|
+
"--version"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"version_prefix": {
|
|
112
|
+
"$id": "#/items/properties/version_prefix",
|
|
113
|
+
"type": "string",
|
|
114
|
+
"title": "The version_prefix schema",
|
|
115
|
+
"description": "Prefix of the version in the download URL.",
|
|
116
|
+
"examples": [
|
|
117
|
+
"v"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"required": [
|
|
122
|
+
"type"
|
|
123
|
+
],
|
|
124
|
+
"additionalProperties": true
|
|
125
|
+
}
|
|
115
126
|
}
|
package/src/coverage.ts
CHANGED
|
@@ -1,142 +1,144 @@
|
|
|
1
|
-
import * as utils from './utils';
|
|
2
|
-
import * as extensions from './extensions';
|
|
3
|
-
import * as config from './config';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
'
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
);
|
|
133
|
-
case '
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return
|
|
141
|
-
|
|
142
|
-
|
|
1
|
+
import * as utils from './utils';
|
|
2
|
+
import * as extensions from './extensions';
|
|
3
|
+
import * as config from './config';
|
|
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
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Function to setup Xdebug
|
|
20
|
+
*
|
|
21
|
+
* @param extension
|
|
22
|
+
* @param version
|
|
23
|
+
* @param os
|
|
24
|
+
* @param pipe
|
|
25
|
+
*/
|
|
26
|
+
export async function addCoverageXdebug(
|
|
27
|
+
extension: string,
|
|
28
|
+
version: string,
|
|
29
|
+
os: string,
|
|
30
|
+
pipe: string
|
|
31
|
+
): Promise<string> {
|
|
32
|
+
let script = '\n';
|
|
33
|
+
let message: string = await checkXdebugError(extension, version);
|
|
34
|
+
let status = '$cross';
|
|
35
|
+
if (!message) {
|
|
36
|
+
script +=
|
|
37
|
+
(await extensions.addExtension(':pcov:false', version, os, true)) + pipe;
|
|
38
|
+
extension = extension == 'xdebug3' ? 'xdebug' : extension;
|
|
39
|
+
script +=
|
|
40
|
+
(await extensions.addExtension(extension, version, os, true)) + pipe;
|
|
41
|
+
message = 'Xdebug enabled as coverage driver';
|
|
42
|
+
status = '$tick';
|
|
43
|
+
}
|
|
44
|
+
script += await utils.addLog(status, extension, message, os);
|
|
45
|
+
return script;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Function to setup PCOV
|
|
50
|
+
*
|
|
51
|
+
* @param version
|
|
52
|
+
* @param os
|
|
53
|
+
* @param pipe
|
|
54
|
+
*/
|
|
55
|
+
export async function addCoveragePCOV(
|
|
56
|
+
version: string,
|
|
57
|
+
os: string,
|
|
58
|
+
pipe: string
|
|
59
|
+
): Promise<string> {
|
|
60
|
+
let script = '\n';
|
|
61
|
+
switch (true) {
|
|
62
|
+
default:
|
|
63
|
+
script +=
|
|
64
|
+
(await extensions.addExtension(':xdebug:false', version, os, true)) +
|
|
65
|
+
pipe;
|
|
66
|
+
script +=
|
|
67
|
+
(await extensions.addExtension('pcov', version, os, true)) + pipe;
|
|
68
|
+
script += (await config.addINIValues('pcov.enabled=1', os, true)) + '\n';
|
|
69
|
+
|
|
70
|
+
// success
|
|
71
|
+
script += await utils.addLog(
|
|
72
|
+
'$tick',
|
|
73
|
+
'coverage: pcov',
|
|
74
|
+
'PCOV enabled as coverage driver',
|
|
75
|
+
os
|
|
76
|
+
);
|
|
77
|
+
// version is not supported
|
|
78
|
+
break;
|
|
79
|
+
|
|
80
|
+
case /5\.[3-6]|7\.0/.test(version):
|
|
81
|
+
script += await utils.addLog(
|
|
82
|
+
'$cross',
|
|
83
|
+
'pcov',
|
|
84
|
+
'PHP 7.1 or newer is required',
|
|
85
|
+
os
|
|
86
|
+
);
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return script;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Function to disable Xdebug and PCOV
|
|
95
|
+
*
|
|
96
|
+
* @param version
|
|
97
|
+
* @param os
|
|
98
|
+
* @param pipe
|
|
99
|
+
*/
|
|
100
|
+
export async function disableCoverage(
|
|
101
|
+
version: string,
|
|
102
|
+
os: string,
|
|
103
|
+
pipe: string
|
|
104
|
+
): Promise<string> {
|
|
105
|
+
let script = '\n';
|
|
106
|
+
script +=
|
|
107
|
+
(await extensions.addExtension(':pcov:false', version, os, true)) + pipe;
|
|
108
|
+
script +=
|
|
109
|
+
(await extensions.addExtension(':xdebug:false', version, os, true)) + pipe;
|
|
110
|
+
script += await utils.addLog('$tick', 'none', 'Disabled Xdebug and PCOV', os);
|
|
111
|
+
|
|
112
|
+
return script;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Function to set coverage driver
|
|
117
|
+
*
|
|
118
|
+
* @param coverage_driver
|
|
119
|
+
* @param version
|
|
120
|
+
* @param os
|
|
121
|
+
*/
|
|
122
|
+
export async function addCoverage(
|
|
123
|
+
coverage_driver: string,
|
|
124
|
+
version: string,
|
|
125
|
+
os: string
|
|
126
|
+
): Promise<string> {
|
|
127
|
+
coverage_driver = coverage_driver.toLowerCase();
|
|
128
|
+
const script: string = '\n' + (await utils.stepLog('Setup Coverage', os));
|
|
129
|
+
const pipe: string = (await utils.suppressOutput(os)) + '\n';
|
|
130
|
+
switch (coverage_driver) {
|
|
131
|
+
case 'pcov':
|
|
132
|
+
return script + (await addCoveragePCOV(version, os, pipe));
|
|
133
|
+
case 'xdebug':
|
|
134
|
+
case 'xdebug2':
|
|
135
|
+
case 'xdebug3':
|
|
136
|
+
return (
|
|
137
|
+
script + (await addCoverageXdebug(coverage_driver, version, os, pipe))
|
|
138
|
+
);
|
|
139
|
+
case 'none':
|
|
140
|
+
return script + (await disableCoverage(version, os, pipe));
|
|
141
|
+
default:
|
|
142
|
+
return '';
|
|
143
|
+
}
|
|
144
|
+
}
|