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.
- package/LICENSE +21 -21
- package/README.md +433 -458
- 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 +4 -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 +188 -200
- package/lib/extensions.js.map +1 -1
- package/lib/install.d.ts +2 -0
- package/lib/install.js +96 -81
- package/lib/install.js.map +1 -1
- package/lib/tools.d.ts +18 -0
- package/lib/tools.js +306 -386
- package/lib/tools.js.map +1 -1
- package/lib/utils.d.ts +15 -0
- package/lib/utils.js +205 -291
- package/lib/utils.js.map +1 -1
- package/package.json +66 -56
- package/src/config.ts +82 -82
- package/src/configs/brew_extensions +28 -0
- package/src/configs/php-versions.json +5 -5
- package/src/configs/phpunit.json +24 -24
- package/src/coverage.ts +146 -146
- package/src/extensions.ts +235 -233
- package/src/install.ts +104 -104
- package/src/scripts/darwin.sh +341 -339
- package/src/scripts/ext/gearman.sh +22 -22
- package/src/scripts/ext/phalcon.ps1 +55 -55
- package/src/scripts/ext/phalcon.sh +70 -70
- package/src/scripts/linux.sh +361 -361
- package/src/scripts/win32.ps1 +326 -333
- package/src/tools.ts +472 -469
- package/src/utils.ts +319 -316
- package/.eslintrc.json +0 -16
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/CONTRIBUTING.md +0 -69
- package/.github/FUNDING.yml +0 -7
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -23
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -38
- package/.github/SECURITY.md +0 -29
- package/.github/workflows/main-workflow.yml +0 -56
- package/.github/workflows/node-workflow.yml +0 -47
- 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 -120
- package/__tests__/install.test.ts +0 -181
- package/__tests__/tools.test.ts +0 -476
- package/__tests__/utils.test.ts +0 -213
- package/action.yml +0 -38
- package/dist/index.js +0 -2854
- package/examples/bedrock.yml +0 -32
- 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 -56
- package/examples/symfony-postgres.yml +0 -54
- 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/tsconfig.json +0 -18
package/src/utils.ts
CHANGED
|
@@ -1,316 +1,319 @@
|
|
|
1
|
-
import {IncomingMessage} from 'http';
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import * as https from 'https';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import * as core from '@actions/core';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Function to read environment variable and return a string value.
|
|
9
|
-
*
|
|
10
|
-
* @param property
|
|
11
|
-
*/
|
|
12
|
-
export async function readEnv(property: string): Promise<string> {
|
|
13
|
-
const
|
|
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
|
-
res.
|
|
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
|
-
case '
|
|
116
|
-
return '
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
*
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
case '
|
|
168
|
-
return '
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
*
|
|
183
|
-
* @param
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
case '
|
|
196
|
-
return '
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
*
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
*
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
case '
|
|
308
|
-
return '
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
1
|
+
import {IncomingMessage} from 'http';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as https from 'https';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import * as core from '@actions/core';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Function to read environment variable and return a string value.
|
|
9
|
+
*
|
|
10
|
+
* @param property
|
|
11
|
+
*/
|
|
12
|
+
export async function readEnv(property: string): Promise<string> {
|
|
13
|
+
const property_lc: string = property.toLowerCase();
|
|
14
|
+
const property_uc: string = property.toUpperCase();
|
|
15
|
+
return (
|
|
16
|
+
process.env[property] ||
|
|
17
|
+
process.env[property_lc] ||
|
|
18
|
+
process.env[property_uc] ||
|
|
19
|
+
process.env[property_lc.replace('_', '-')] ||
|
|
20
|
+
process.env[property_uc.replace('_', '-')] ||
|
|
21
|
+
''
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Function to get inputs from both with and env annotations.
|
|
27
|
+
*
|
|
28
|
+
* @param name
|
|
29
|
+
* @param mandatory
|
|
30
|
+
*/
|
|
31
|
+
export async function getInput(
|
|
32
|
+
name: string,
|
|
33
|
+
mandatory: boolean
|
|
34
|
+
): Promise<string> {
|
|
35
|
+
const input = core.getInput(name);
|
|
36
|
+
const env_input = await readEnv(name);
|
|
37
|
+
switch (true) {
|
|
38
|
+
case input != '':
|
|
39
|
+
return input;
|
|
40
|
+
case input == '' && env_input != '':
|
|
41
|
+
return env_input;
|
|
42
|
+
case input == '' && env_input == '' && mandatory:
|
|
43
|
+
throw new Error(`Input required and not supplied: ${name}`);
|
|
44
|
+
default:
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Function to fetch an URL
|
|
51
|
+
*
|
|
52
|
+
* @param url
|
|
53
|
+
*/
|
|
54
|
+
export async function fetch(url: string): Promise<string> {
|
|
55
|
+
const fetch_promise: Promise<string> = new Promise(resolve => {
|
|
56
|
+
const req = https.get(url, (res: IncomingMessage) => {
|
|
57
|
+
res.setEncoding('utf8');
|
|
58
|
+
let body = '';
|
|
59
|
+
res.on('data', chunk => (body += chunk));
|
|
60
|
+
res.on('end', () => resolve(body));
|
|
61
|
+
});
|
|
62
|
+
req.end();
|
|
63
|
+
});
|
|
64
|
+
return await fetch_promise;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Function to parse PHP version.
|
|
69
|
+
*
|
|
70
|
+
* @param version
|
|
71
|
+
*/
|
|
72
|
+
export async function parseVersion(version: string): Promise<string> {
|
|
73
|
+
const manifest =
|
|
74
|
+
'https://raw.githubusercontent.com/shivammathur/setup-php/releases/v1/src/configs/php-versions.json';
|
|
75
|
+
switch (true) {
|
|
76
|
+
case /^(latest|\d+\.x)$/.test(version):
|
|
77
|
+
return JSON.parse(await fetch(manifest))[version];
|
|
78
|
+
default:
|
|
79
|
+
switch (true) {
|
|
80
|
+
case version.length > 1:
|
|
81
|
+
return version.slice(0, 3);
|
|
82
|
+
default:
|
|
83
|
+
return version + '.0';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Async foreach loop
|
|
90
|
+
*
|
|
91
|
+
* @author https://github.com/Atinux
|
|
92
|
+
* @param array
|
|
93
|
+
* @param callback
|
|
94
|
+
*/
|
|
95
|
+
export async function asyncForEach(
|
|
96
|
+
array: Array<string>,
|
|
97
|
+
callback: (
|
|
98
|
+
element: string,
|
|
99
|
+
index: number,
|
|
100
|
+
array: Array<string>
|
|
101
|
+
) => Promise<void>
|
|
102
|
+
): Promise<void> {
|
|
103
|
+
for (let index = 0; index < array.length; index++) {
|
|
104
|
+
await callback(array[index], index, array);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Get color index
|
|
110
|
+
*
|
|
111
|
+
* @param type
|
|
112
|
+
*/
|
|
113
|
+
export async function color(type: string): Promise<string> {
|
|
114
|
+
switch (type) {
|
|
115
|
+
case 'error':
|
|
116
|
+
return '31';
|
|
117
|
+
default:
|
|
118
|
+
case 'success':
|
|
119
|
+
return '32';
|
|
120
|
+
case 'warning':
|
|
121
|
+
return '33';
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Log to console
|
|
127
|
+
*
|
|
128
|
+
* @param message
|
|
129
|
+
* @param os_version
|
|
130
|
+
* @param log_type
|
|
131
|
+
*/
|
|
132
|
+
export async function log(
|
|
133
|
+
message: string,
|
|
134
|
+
os_version: string,
|
|
135
|
+
log_type: string
|
|
136
|
+
): Promise<string> {
|
|
137
|
+
switch (os_version) {
|
|
138
|
+
case 'win32':
|
|
139
|
+
return (
|
|
140
|
+
'printf "\\033[' +
|
|
141
|
+
(await color(log_type)) +
|
|
142
|
+
';1m' +
|
|
143
|
+
message +
|
|
144
|
+
' \\033[0m"'
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
case 'linux':
|
|
148
|
+
case 'darwin':
|
|
149
|
+
default:
|
|
150
|
+
return (
|
|
151
|
+
'echo "\\033[' + (await color(log_type)) + ';1m' + message + '\\033[0m"'
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Function to log a step
|
|
158
|
+
*
|
|
159
|
+
* @param message
|
|
160
|
+
* @param os_version
|
|
161
|
+
*/
|
|
162
|
+
export async function stepLog(
|
|
163
|
+
message: string,
|
|
164
|
+
os_version: string
|
|
165
|
+
): Promise<string> {
|
|
166
|
+
switch (os_version) {
|
|
167
|
+
case 'win32':
|
|
168
|
+
return 'Step-Log "' + message + '"';
|
|
169
|
+
case 'linux':
|
|
170
|
+
case 'darwin':
|
|
171
|
+
return 'step_log "' + message + '"';
|
|
172
|
+
default:
|
|
173
|
+
return await log(
|
|
174
|
+
'Platform ' + os_version + ' is not supported',
|
|
175
|
+
os_version,
|
|
176
|
+
'error'
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Function to log a result
|
|
183
|
+
* @param mark
|
|
184
|
+
* @param subject
|
|
185
|
+
* @param message
|
|
186
|
+
* @param os_version
|
|
187
|
+
*/
|
|
188
|
+
export async function addLog(
|
|
189
|
+
mark: string,
|
|
190
|
+
subject: string,
|
|
191
|
+
message: string,
|
|
192
|
+
os_version: string
|
|
193
|
+
): Promise<string> {
|
|
194
|
+
switch (os_version) {
|
|
195
|
+
case 'win32':
|
|
196
|
+
return 'Add-Log "' + mark + '" "' + subject + '" "' + message + '"';
|
|
197
|
+
case 'linux':
|
|
198
|
+
case 'darwin':
|
|
199
|
+
return 'add_log "' + mark + '" "' + subject + '" "' + message + '"';
|
|
200
|
+
default:
|
|
201
|
+
return await log(
|
|
202
|
+
'Platform ' + os_version + ' is not supported',
|
|
203
|
+
os_version,
|
|
204
|
+
'error'
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Read the scripts
|
|
211
|
+
*
|
|
212
|
+
* @param filename
|
|
213
|
+
*/
|
|
214
|
+
export async function readScript(filename: string): Promise<string> {
|
|
215
|
+
return fs.readFileSync(
|
|
216
|
+
path.join(__dirname, '../src/scripts/' + filename),
|
|
217
|
+
'utf8'
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Write final script which runs
|
|
223
|
+
*
|
|
224
|
+
* @param filename
|
|
225
|
+
* @param script
|
|
226
|
+
*/
|
|
227
|
+
export async function writeScript(
|
|
228
|
+
filename: string,
|
|
229
|
+
script: string
|
|
230
|
+
): Promise<string> {
|
|
231
|
+
const runner_dir: string = await getInput('RUNNER_TOOL_CACHE', false);
|
|
232
|
+
const script_path: string = path.join(runner_dir, filename);
|
|
233
|
+
fs.writeFileSync(script_path, script, {mode: 0o755});
|
|
234
|
+
return script_path;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Function to break extension csv into an array
|
|
239
|
+
*
|
|
240
|
+
* @param extension_csv
|
|
241
|
+
*/
|
|
242
|
+
export async function extensionArray(
|
|
243
|
+
extension_csv: string
|
|
244
|
+
): Promise<Array<string>> {
|
|
245
|
+
switch (extension_csv) {
|
|
246
|
+
case '':
|
|
247
|
+
case ' ':
|
|
248
|
+
return [];
|
|
249
|
+
default:
|
|
250
|
+
return extension_csv
|
|
251
|
+
.split(',')
|
|
252
|
+
.map(function (extension: string) {
|
|
253
|
+
return extension
|
|
254
|
+
.trim()
|
|
255
|
+
.toLowerCase()
|
|
256
|
+
.replace(/^php[-_]/, '');
|
|
257
|
+
})
|
|
258
|
+
.filter(Boolean);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Function to break csv into an array
|
|
264
|
+
*
|
|
265
|
+
* @param values_csv
|
|
266
|
+
* @constructor
|
|
267
|
+
*/
|
|
268
|
+
export async function CSVArray(values_csv: string): Promise<Array<string>> {
|
|
269
|
+
switch (values_csv) {
|
|
270
|
+
case '':
|
|
271
|
+
case ' ':
|
|
272
|
+
return [];
|
|
273
|
+
default:
|
|
274
|
+
return values_csv
|
|
275
|
+
.split(/,(?=(?:(?:[^"']*["']){2})*[^"']*$)/)
|
|
276
|
+
.map(function (value) {
|
|
277
|
+
return value
|
|
278
|
+
.trim()
|
|
279
|
+
.replace(/^["']|["']$|(?<==)["']/g, '')
|
|
280
|
+
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'");
|
|
281
|
+
})
|
|
282
|
+
.filter(Boolean);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Function to get prefix required to load an extension.
|
|
288
|
+
*
|
|
289
|
+
* @param extension
|
|
290
|
+
*/
|
|
291
|
+
export async function getExtensionPrefix(extension: string): Promise<string> {
|
|
292
|
+
switch (true) {
|
|
293
|
+
default:
|
|
294
|
+
return 'extension';
|
|
295
|
+
case /xdebug([2-3])?$|opcache|ioncube|eaccelerator/.test(extension):
|
|
296
|
+
return 'zend_extension';
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Function to get the suffix to suppress console output
|
|
302
|
+
*
|
|
303
|
+
* @param os_version
|
|
304
|
+
*/
|
|
305
|
+
export async function suppressOutput(os_version: string): Promise<string> {
|
|
306
|
+
switch (os_version) {
|
|
307
|
+
case 'win32':
|
|
308
|
+
return ' >$null 2>&1';
|
|
309
|
+
case 'linux':
|
|
310
|
+
case 'darwin':
|
|
311
|
+
return ' >/dev/null 2>&1';
|
|
312
|
+
default:
|
|
313
|
+
return await log(
|
|
314
|
+
'Platform ' + os_version + ' is not supported',
|
|
315
|
+
os_version,
|
|
316
|
+
'error'
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
}
|
package/.eslintrc.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": { "node": true, "jest": true },
|
|
3
|
-
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"parserOptions": { "ecmaVersion": 2019, "sourceType": "module" },
|
|
5
|
-
"extends": [
|
|
6
|
-
"eslint:recommended",
|
|
7
|
-
"plugin:@typescript-eslint/eslint-recommended",
|
|
8
|
-
"plugin:@typescript-eslint/recommended",
|
|
9
|
-
"plugin:import/errors",
|
|
10
|
-
"plugin:import/warnings",
|
|
11
|
-
"plugin:import/typescript",
|
|
12
|
-
"plugin:prettier/recommended",
|
|
13
|
-
"prettier"
|
|
14
|
-
],
|
|
15
|
-
"plugins": ["@typescript-eslint", "jest"]
|
|
16
|
-
}
|