mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-04-06 11:19:26 +07:00
Compare commits
465 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
42a9487ddd | ||
![]() |
f5d98d1683 | ||
![]() |
1a94db50cb | ||
![]() |
1489f576c9 | ||
![]() |
f25b1cfdcc | ||
![]() |
3209251719 | ||
![]() |
8ad85316fe | ||
![]() |
297b3cde3c | ||
![]() |
4eb1919d22 | ||
![]() |
d8af2f43ce | ||
![]() |
d3fead0baf | ||
![]() |
6cd838e903 | ||
![]() |
3bfebc13bc | ||
![]() |
89a5bffb0b | ||
![]() |
260b35cca0 | ||
![]() |
f902cc7bd9 | ||
![]() |
ad03a92562 | ||
![]() |
a99dd2408e | ||
![]() |
a7d262f1d8 | ||
![]() |
c1750d382b | ||
![]() |
6516e9cb24 | ||
![]() |
783c77d669 | ||
![]() |
b0064cd05b | ||
![]() |
fd913ba092 | ||
![]() |
21e092a3e0 | ||
![]() |
64652c947d | ||
![]() |
9e72090525 | ||
![]() |
34b79cab10 | ||
![]() |
e5af5d68b4 | ||
![]() |
ba21a89e0b | ||
![]() |
12b88cf3e2 | ||
![]() |
cffd8ca58a | ||
![]() |
85ed51cf85 | ||
![]() |
5bb2eed0aa | ||
![]() |
96fb539134 | ||
![]() |
775fa76ea4 | ||
![]() |
da729085ef | ||
![]() |
b6d8115f12 | ||
![]() |
84f76b1fc9 | ||
![]() |
cdfde5ebec | ||
![]() |
7e98140142 | ||
![]() |
85a8dfd0c7 | ||
![]() |
7ee42db5db | ||
![]() |
cdbb89961e | ||
![]() |
19ba822314 | ||
![]() |
fb9c2a9f77 | ||
![]() |
e7453ef93f | ||
![]() |
efd3a13445 | ||
![]() |
981ce2a75a | ||
![]() |
d97b3754a8 | ||
![]() |
edf0223f7d | ||
![]() |
516490f3d1 | ||
![]() |
e77cdb393f | ||
![]() |
944fb41c67 | ||
![]() |
0830e5d434 | ||
![]() |
ae95648cfc | ||
![]() |
a75ffb672b | ||
![]() |
80075aeba5 | ||
![]() |
449afbcaec | ||
![]() |
ce2f681d22 | ||
![]() |
cb0fc744e6 | ||
![]() |
58a6e6fb4b | ||
![]() |
bf9d25532d | ||
![]() |
4662a3d03c | ||
![]() |
e4fb5432c7 | ||
![]() |
7f1cfc01ec | ||
![]() |
371ee9d086 | ||
![]() |
51383ecefe | ||
![]() |
cf36231a82 | ||
![]() |
9f51892bda | ||
![]() |
53f82379e8 | ||
![]() |
24eff50574 | ||
![]() |
15b611248c | ||
![]() |
6e5c13cd3c | ||
![]() |
e07eecf7a4 | ||
![]() |
57a6e91640 | ||
![]() |
c541c155ee | ||
![]() |
afff805ea3 | ||
![]() |
594bd591ec | ||
![]() |
2e947f1f69 | ||
![]() |
2a5212466c | ||
![]() |
9c28f9ba58 | ||
![]() |
b9f1db485f | ||
![]() |
588b5da142 | ||
![]() |
a0edbac27b | ||
![]() |
606ac25b84 | ||
![]() |
ea566b68c0 | ||
![]() |
4f124b97f7 | ||
![]() |
8fe6ba1e38 | ||
![]() |
193510cd90 | ||
![]() |
b5f04d97d9 | ||
![]() |
4b56933e00 | ||
![]() |
fc14643b0a | ||
![]() |
fdb0d9d1a7 | ||
![]() |
622cada40f | ||
![]() |
2a620039e8 | ||
![]() |
376a964e21 | ||
![]() |
d6560b1fbb | ||
![]() |
868f02c3ff | ||
![]() |
18975ec414 | ||
![]() |
c49792fb59 | ||
![]() |
806c3cc058 | ||
![]() |
c665c7a15b | ||
![]() |
b30e4bc764 | ||
![]() |
436881d084 | ||
![]() |
14d9660823 | ||
![]() |
efffd0e4f2 | ||
![]() |
d802457674 | ||
![]() |
8872c784b0 | ||
![]() |
b203b24815 | ||
![]() |
116fe4df69 | ||
![]() |
73963f5001 | ||
![]() |
f4fb0af4d5 | ||
![]() |
eb73c01f76 | ||
![]() |
3d8c10397e | ||
![]() |
db8db3c7c7 | ||
![]() |
31bfabaf56 | ||
![]() |
21eeae309a | ||
![]() |
48e0de2ea6 | ||
![]() |
88841d1465 | ||
![]() |
a4e22b60bb | ||
![]() |
4f6ab99328 | ||
![]() |
a870b0a9be | ||
![]() |
67271131b1 | ||
![]() |
a6ce3f5633 | ||
![]() |
1a5ac4aa9a | ||
![]() |
765279d5ef | ||
![]() |
d71d15b3b3 | ||
![]() |
ad24e86677 | ||
![]() |
73dfd2f824 | ||
![]() |
6d7209f44a | ||
![]() |
2ee6851e7b | ||
![]() |
353ba41d44 | ||
![]() |
5c424d6c81 | ||
![]() |
e927136b25 | ||
![]() |
35557a3770 | ||
![]() |
43e870b2d0 | ||
![]() |
dc1a77b457 | ||
![]() |
812360879e | ||
![]() |
201dd6c1db | ||
![]() |
97e0a9729a | ||
![]() |
5a2bd88cb3 | ||
![]() |
7ba520ae30 | ||
![]() |
f47a6e7ca3 | ||
![]() |
e1c6cff579 | ||
![]() |
6e825ca69e | ||
![]() |
7b1eaadfbb | ||
![]() |
5b709ff10e | ||
![]() |
ed98159fe9 | ||
![]() |
58f08c5f7c | ||
![]() |
9e24ffafe7 | ||
![]() |
5eca5d1c47 | ||
![]() |
c085ca391e | ||
![]() |
93745da978 | ||
![]() |
c088c0cfeb | ||
![]() |
86b90110cb | ||
![]() |
1a102bc9f2 | ||
![]() |
131ba03b0d | ||
![]() |
e8cd65f444 | ||
![]() |
2810265746 | ||
![]() |
dab726e922 | ||
![]() |
e6f75134d3 | ||
![]() |
1874353919 | ||
![]() |
eea39ea741 | ||
![]() |
bac56c8d91 | ||
![]() |
124d256c78 | ||
![]() |
eeddcfe955 | ||
![]() |
de2903ad82 | ||
![]() |
bbe1204148 | ||
![]() |
99a92d54d5 | ||
![]() |
7c6c249257 | ||
![]() |
e6d44f159a | ||
![]() |
dc513528da | ||
![]() |
bfbd3882c0 | ||
![]() |
3c525df325 | ||
![]() |
a36e1e52ff | ||
![]() |
04ff9b08a2 | ||
![]() |
65fad67e88 | ||
![]() |
6668249e24 | ||
![]() |
81c255f988 | ||
![]() |
81cd5ae092 | ||
![]() |
29a9813921 | ||
![]() |
f60e7de98e | ||
![]() |
b5efb21934 | ||
![]() |
26e6a92f3b | ||
![]() |
28b68529b5 | ||
![]() |
4e4861ec30 | ||
![]() |
70169700c3 | ||
![]() |
f4e27c9ead | ||
![]() |
9855c76987 | ||
![]() |
546935924a | ||
![]() |
491e9de600 | ||
![]() |
e3bda5bed8 | ||
![]() |
e70f6d9e7c | ||
![]() |
92e992b198 | ||
![]() |
99680be1df | ||
![]() |
e83e329355 | ||
![]() |
10c12b9377 | ||
![]() |
91026460e4 | ||
![]() |
7fdd3ece87 | ||
![]() |
0de5aa9140 | ||
![]() |
a6e0b1404f | ||
![]() |
5d259c66b1 | ||
![]() |
6207829361 | ||
![]() |
319feb83c2 | ||
![]() |
661ad4bf75 | ||
![]() |
04c15e2314 | ||
![]() |
5aa416d77b | ||
![]() |
a9a661ccd4 | ||
![]() |
321f8d7d9a | ||
![]() |
7af6c0fe6f | ||
![]() |
36e04fc85c | ||
![]() |
95916a72b1 | ||
![]() |
a5fb328c6a | ||
![]() |
72ae4ccbe5 | ||
![]() |
5b2015e8fe | ||
![]() |
9c77701ae5 | ||
![]() |
394503cb8a | ||
![]() |
f1cc14e3d5 | ||
![]() |
9d529a72e0 | ||
![]() |
c63f07d82e | ||
![]() |
e40aa32c04 | ||
![]() |
a683e80307 | ||
![]() |
7ce22e0264 | ||
![]() |
4bd44f22a9 | ||
![]() |
d2f333de6f | ||
![]() |
948bd8df3c | ||
![]() |
8cac79fdb1 | ||
![]() |
6cc8b47c6f | ||
![]() |
0be6fa1958 | ||
![]() |
22d9c80367 | ||
![]() |
4630172078 | ||
![]() |
1b02c009e7 | ||
![]() |
12282c9597 | ||
![]() |
592bbc7716 | ||
![]() |
fb5054b163 | ||
![]() |
3f2a402846 | ||
![]() |
c5fc0d8281 | ||
![]() |
48037d201f | ||
![]() |
71b43c4f65 | ||
![]() |
3818224063 | ||
![]() |
5b29e8a454 | ||
![]() |
2a798336a0 | ||
![]() |
cb8f453143 | ||
![]() |
19323ea920 | ||
![]() |
b951cf1d99 | ||
![]() |
1fdc5e773b | ||
![]() |
1474d67903 | ||
![]() |
1afae1868c | ||
![]() |
36e33e130a | ||
![]() |
3d794ddd93 | ||
![]() |
c61bd0e074 | ||
![]() |
1f8252a3ed | ||
![]() |
3e2462a699 | ||
![]() |
e513384a65 | ||
![]() |
6483a6ea70 | ||
![]() |
ca308a6886 | ||
![]() |
035ef490b9 | ||
![]() |
6bf279d08a | ||
![]() |
bb16550379 | ||
![]() |
7d999d501a | ||
![]() |
7f8b1e5773 | ||
![]() |
6461006ceb | ||
![]() |
5f422817a1 | ||
![]() |
1b08836381 | ||
![]() |
ae98bca05f | ||
![]() |
fb1ad7fc84 | ||
![]() |
0d60024683 | ||
![]() |
1224b29111 | ||
![]() |
2f306f9d25 | ||
![]() |
39b4e4a983 | ||
![]() |
7e46297c8d | ||
![]() |
f9390a5478 | ||
![]() |
f42145a164 | ||
![]() |
755bbb1cc0 | ||
![]() |
a36edd3ca4 | ||
![]() |
f2018b2189 | ||
![]() |
9c411b6e2b | ||
![]() |
e8d8aa3403 | ||
![]() |
686e8dfff9 | ||
![]() |
b46c8e2a8c | ||
![]() |
2d47531473 | ||
![]() |
fd03521cb4 | ||
![]() |
f03add0b41 | ||
![]() |
baf9535ba5 | ||
![]() |
cc0e576689 | ||
![]() |
d30ad8b184 | ||
![]() |
0f765070fa | ||
![]() |
313d0cfdbf | ||
![]() |
cf767706fe | ||
![]() |
1267cf80a1 | ||
![]() |
7abee8e28c | ||
![]() |
dd0115673c | ||
![]() |
bbc65d999a | ||
![]() |
6db1a06425 | ||
![]() |
52eb86c60c | ||
![]() |
2b77dd6b79 | ||
![]() |
224f9ddef5 | ||
![]() |
7f5c8b51ba | ||
![]() |
bd5c747191 | ||
![]() |
40846b27d0 | ||
![]() |
8e2ac35f63 | ||
![]() |
a1e6789a94 | ||
![]() |
9114b007ae | ||
![]() |
cb0c293f02 | ||
![]() |
387ec95b46 | ||
![]() |
3514d30f93 | ||
![]() |
e186e47261 | ||
![]() |
e51e662ef0 | ||
![]() |
5afd8a1842 | ||
![]() |
1a42045d48 | ||
![]() |
b3a12ce01e | ||
![]() |
04b2ed5b3e | ||
![]() |
189e8e6ec0 | ||
![]() |
3407e6019c | ||
![]() |
f20012026f | ||
![]() |
7743b7976f | ||
![]() |
b7b50ce742 | ||
![]() |
aa9b80f158 | ||
![]() |
53adb47562 | ||
![]() |
f7d3c00320 | ||
![]() |
b359d922e7 | ||
![]() |
01aa440f0b | ||
![]() |
51f83e019c | ||
![]() |
173ca15c9b | ||
![]() |
4704ad638a | ||
![]() |
1a18b2267f | ||
![]() |
e9704839e9 | ||
![]() |
5178fac634 | ||
![]() |
388883d4bf | ||
![]() |
cae6d06e69 | ||
![]() |
89f4f7e8be | ||
![]() |
d2efbcd126 | ||
![]() |
98e3af0bff | ||
![]() |
e8836c6d46 | ||
![]() |
9068f2e46f | ||
![]() |
5bbbd3fdf6 | ||
![]() |
7622357ff1 | ||
![]() |
6652a09da6 | ||
![]() |
48fb8e1194 | ||
![]() |
bbc6e9069b | ||
![]() |
37dcd1cf8c | ||
![]() |
12b1efad4b | ||
![]() |
0575a32108 | ||
![]() |
71b0e09dbc | ||
![]() |
edff21f0a6 | ||
![]() |
22035eb75b | ||
![]() |
b556cf7292 | ||
![]() |
f99a9d4624 | ||
![]() |
a49dfe8457 | ||
![]() |
7ff9ac44b4 | ||
![]() |
7aff4d7a22 | ||
![]() |
633321754d | ||
![]() |
40a4cb064f | ||
![]() |
45410ae8f0 | ||
![]() |
56ad5977ba | ||
![]() |
6353d20df2 | ||
![]() |
e04e1d97f0 | ||
![]() |
52685a348b | ||
![]() |
44d81f9830 | ||
![]() |
401bdecb71 | ||
![]() |
aa82ffc68f | ||
![]() |
7e03c76ef2 | ||
![]() |
16011a795d | ||
![]() |
66f24470dc | ||
![]() |
e57ea715eb | ||
![]() |
e8ba27f3d2 | ||
![]() |
945c34c175 | ||
![]() |
c8c64c6cf9 | ||
![]() |
0d3f92f127 | ||
![]() |
4979d5b484 | ||
![]() |
0d9a1ba5ae | ||
![]() |
3ede7656cb | ||
![]() |
f3cdc074ce | ||
![]() |
109db648f1 | ||
![]() |
3ccc00eece | ||
![]() |
0f688a10cb | ||
![]() |
3312ea6101 | ||
![]() |
ce49f82dd8 | ||
![]() |
cf5cd90b4c | ||
![]() |
cdb037c2a4 | ||
![]() |
261f13a7c5 | ||
![]() |
9eaa66d89b | ||
![]() |
da9dfe4a71 | ||
![]() |
a863ab6d3d | ||
![]() |
050cb8061b | ||
![]() |
3fda17f3fa | ||
![]() |
1a2cb4f872 | ||
![]() |
4969814b69 | ||
![]() |
07f2ea7d02 | ||
![]() |
a1c17b4b18 | ||
![]() |
3eda583472 | ||
![]() |
74d43be8a3 | ||
![]() |
aa1fe473f9 | ||
![]() |
a92acf13e4 | ||
![]() |
0533892eb4 | ||
![]() |
43fb4ad30e | ||
![]() |
b88a8c89d1 | ||
![]() |
36d7f6c7c5 | ||
![]() |
a1a52db9f3 | ||
![]() |
88e54b10ca | ||
![]() |
203099e007 | ||
![]() |
4e9ea33f8d | ||
![]() |
68ba5ba947 | ||
![]() |
99af32331c | ||
![]() |
810a92a9b0 | ||
![]() |
9c760dd6e2 | ||
![]() |
dea233d702 | ||
![]() |
787285e08a | ||
![]() |
ee065c5938 | ||
![]() |
dbc8ba0844 | ||
![]() |
fe9e23a16a | ||
![]() |
16de39288a | ||
![]() |
67ff09364d | ||
![]() |
1dfe0dc4a4 | ||
![]() |
6f83b63bf5 | ||
![]() |
f0db57dcab | ||
![]() |
6cba851606 | ||
![]() |
209324abab | ||
![]() |
846135c190 | ||
![]() |
32d20248ae | ||
![]() |
ba8485d89f | ||
![]() |
97721a77b9 | ||
![]() |
7dfee150df | ||
![]() |
251330ef7f | ||
![]() |
448bd61c6f | ||
![]() |
657e0936e8 | ||
![]() |
36d70683e9 | ||
![]() |
7a9bf9ecf6 | ||
![]() |
5210dd20ed | ||
![]() |
e83d1a7f9e | ||
![]() |
6ae3564af4 | ||
![]() |
9e33c7b24e | ||
![]() |
d37cc30485 | ||
![]() |
412722b7c7 | ||
![]() |
c19f6bbdcd | ||
![]() |
dfd2c8da97 | ||
![]() |
27eef9a04c | ||
![]() |
f172a4dc76 | ||
![]() |
c88ece8451 | ||
![]() |
33ad931dbb | ||
![]() |
4e4b26a024 | ||
![]() |
228bfba836 | ||
![]() |
34c35ecdad | ||
![]() |
1828f05f7a | ||
![]() |
927419e77f | ||
![]() |
e29242d481 | ||
![]() |
035c0a8550 | ||
![]() |
e9884d0d9a | ||
![]() |
02131e37d9 | ||
![]() |
341d29a88f | ||
![]() |
5e3bc57de0 | ||
![]() |
a826799c7c | ||
![]() |
62bd8f3ca4 | ||
![]() |
4056d3f353 | ||
![]() |
ddf8825c2f | ||
![]() |
4678e809c3 | ||
![]() |
b75c104ca8 | ||
![]() |
94c859a50e | ||
![]() |
293da043d1 | ||
![]() |
808396c4e6 | ||
![]() |
7205f47330 | ||
![]() |
7ad352e12a | ||
![]() |
5bf95cd61f | ||
![]() |
18f3abac75 |
.eslintrc.json
.github
LICENSEREADME.md__tests__
coverage.test.tsextensions.test.tsfetch.test.tsinstall.test.tspackagist.test.tstools.test.tsutils.test.ts
action.ymldist
eslint.config.mjsexamples
bedrock.ymlblackfire-player.ymlblackfire.ymlcakephp-mysql.ymlcakephp-postgres.ymlcakephp.ymlcodeigniter.ymllaminas-mvc.ymllaravel-mysql.ymllaravel-postgres.ymllaravel.ymllumen-mysql.ymllumen-postgres.ymllumen.ymlphalcon-mysql.ymlphalcon-postgres.ymlsage.ymlslim-framework.ymlsymfony-mysql.ymlsymfony-postgres.ymlsymfony.ymlyii2-mysql.ymlyii2-postgres.yml
package-lock.jsonpackage.jsonsrc
configs
brew_extensionscomposer.envmod_priorityos_releases.csvphp-versions.jsonphp_debug_packagestools.jsontools_schema.jsonwindows_extensions
coverage.tsextensions.tsfetch.tsinstall.tspackagist.tsscripts
@ -1,16 +0,0 @@
|
||||
{
|
||||
"env": { "node": true, "jest": true },
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": { "ecmaVersion": 2019, "sourceType": "module" },
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/errors",
|
||||
"plugin:import/warnings",
|
||||
"plugin:import/typescript",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"plugins": ["@typescript-eslint", "jest"]
|
||||
}
|
1
.github/CONTRIBUTING.md
vendored
1
.github/CONTRIBUTING.md
vendored
@ -71,6 +71,7 @@ npm test
|
||||
Creating a release means compiling all the TypeScript code to a single file which `setup-php` can run. Run this, before you push your changes.
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
npm run release
|
||||
```
|
||||
|
||||
|
42
.github/ISSUE_TEMPLATE/bug.md
vendored
42
.github/ISSUE_TEMPLATE/bug.md
vendored
@ -1,42 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Nice, you found a bug!
|
||||
title: ''
|
||||
labels: 'bug'
|
||||
assignees: 'shivammathur'
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
<!-- Please describe the bug concisely. -->
|
||||
|
||||
**Version**
|
||||
- [ ] I have checked releases, and the bug exists in the latest patch version of `v1` or `v2`.
|
||||
- [ ] `v2`
|
||||
- [ ] `v1`
|
||||
|
||||
**Runners**
|
||||
<!-- Please mark the GitHub Action runner your workflow uses. -->
|
||||
- [ ] GitHub Hosted
|
||||
- [ ] Self Hosted
|
||||
|
||||
**Operating systems**
|
||||
<!-- Please mention the operating systems your workflow uses. -->
|
||||
|
||||
**PHP versions**
|
||||
<!-- Please mention the PHP versions your workflow uses. -->
|
||||
|
||||
**To Reproduce**
|
||||
<!-- Please provide the relevant steps of your workflow `.yml` file. -->
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Screenshots/Logs**
|
||||
<!-- If applicable, add screenshots or logs to help explain your problem. -->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context about the problem here. -->
|
||||
|
||||
**Are you willing to submit a PR?**
|
||||
<!-- We accept pull requests targeting the develop branch. -->
|
94
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
94
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
name: Bug report
|
||||
description: Nice, you found a bug!
|
||||
title: "Bug: "
|
||||
labels: ["bug"]
|
||||
assignees: ["shivammathur"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Please fill out the sections below to help us address your issue."
|
||||
|
||||
- type: textarea
|
||||
id: bug-description
|
||||
attributes:
|
||||
label: "Describe the bug"
|
||||
placeholder: "Please describe the bug concisely."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: version
|
||||
attributes:
|
||||
label: "Version"
|
||||
description: "I have checked releases, and the bug exists in the latest patch version of `v1` or `v2`."
|
||||
options:
|
||||
- label: "v2"
|
||||
- label: "v1"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: runners
|
||||
attributes:
|
||||
label: "Runners"
|
||||
description: "Please choose the GitHub Action runner your workflow uses."
|
||||
options:
|
||||
- "GitHub Hosted"
|
||||
- "Self Hosted"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: operating-systems
|
||||
attributes:
|
||||
label: "Operating systems"
|
||||
placeholder: "e.g., Ubuntu 20.04, Windows Server 2019, etc."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: php-versions
|
||||
attributes:
|
||||
label: "PHP versions"
|
||||
placeholder: "e.g., PHP 7.4, PHP 8.0, etc."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: steps-to-reproduce
|
||||
attributes:
|
||||
label: "To Reproduce"
|
||||
placeholder: "Please provide the relevant steps of your workflow `.yml` file."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected-behavior
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
placeholder: "A clear and concise description of what you expected to happen."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: screenshots-logs
|
||||
attributes:
|
||||
label: "Screenshots/Logs"
|
||||
placeholder: "Drag and drop images or paste logs here..."
|
||||
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: "Additional context"
|
||||
placeholder: "Add any other context about the problem here."
|
||||
|
||||
- type: dropdown
|
||||
id: willing-to-submit-pr
|
||||
attributes:
|
||||
label: "Are you willing to submit a PR?"
|
||||
description: "We accept pull requests targeting the develop branch."
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
26
.github/ISSUE_TEMPLATE/feature.md
vendored
26
.github/ISSUE_TEMPLATE/feature.md
vendored
@ -1,26 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature
|
||||
title: ''
|
||||
labels: 'enhancement'
|
||||
assignees: 'shivammathur'
|
||||
|
||||
---
|
||||
|
||||
**Describe the feature**
|
||||
<!-- Please describe concisely the feature you want to add. -->
|
||||
|
||||
**Version**
|
||||
- [ ] I have checked releases, and the feature is missing in the latest patch version of `v2`.
|
||||
|
||||
**Underlying issue**
|
||||
<!-- Please describe the issue this would solve. -->
|
||||
|
||||
**Describe alternatives**
|
||||
<!-- Please mention any alternative solutions you've considered. -->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context or screenshots about the feature request here. -->
|
||||
|
||||
**Are you willing to submit a PR?**
|
||||
<!-- We accept pull requests targeting the develop branch. -->
|
58
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
58
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
name: Feature request
|
||||
description: Suggest a new feature
|
||||
title: "Feature: "
|
||||
labels: ["enhancement"]
|
||||
assignees: ["shivammathur"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Please fill out the sections below to help us understand your new feature proposal."
|
||||
|
||||
- type: textarea
|
||||
id: feature-description
|
||||
attributes:
|
||||
label: "Describe the feature"
|
||||
placeholder: "A clear and concise description of what you want and why."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: version-check
|
||||
attributes:
|
||||
label: "Please check the latest release"
|
||||
options:
|
||||
- label: "I have checked releases, and the feature is missing in the latest patch version of `v2`."
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: underlying-issue
|
||||
attributes:
|
||||
label: "Underlying issue"
|
||||
placeholder: "Please describe the issue this would solve."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: "Describe alternatives"
|
||||
placeholder: "Please mention any alternative solutions you've considered."
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: "Additional context"
|
||||
placeholder: "Drag and drop images or paste any additional information here..."
|
||||
|
||||
- type: dropdown
|
||||
id: willing-to-submit-pr
|
||||
attributes:
|
||||
label: "Are you willing to submit a PR?"
|
||||
description: "We accept pull requests targeting the develop branch."
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
3
.github/SECURITY.md
vendored
3
.github/SECURITY.md
vendored
@ -10,10 +10,9 @@ This security policy only applies to the latest patches of the following PHP ver
|
||||
|
||||
| Version | Supported |
|
||||
|---------|--------------------|
|
||||
| 7.4 | :white_check_mark: |
|
||||
| 8.0 | :white_check_mark: |
|
||||
| 8.1 | :white_check_mark: |
|
||||
| 8.2 | :white_check_mark: |
|
||||
| 8.3 | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
|
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
target-branch: "develop"
|
||||
schedule:
|
||||
interval: "weekly"
|
15
.github/workflows/codeql.yml
vendored
15
.github/workflows/codeql.yml
vendored
@ -3,23 +3,30 @@ on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 15 * * 6'
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
codeql:
|
||||
permissions:
|
||||
actions: read # for github/codeql-action/init to get workflow details
|
||||
contents: read # for actions/checkout to fetch code
|
||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
config-file: ./.github/codeql/codeql-configuration.yml
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: github/codeql-action/analyze@v3
|
||||
|
83
.github/workflows/docs.yml
vendored
83
.github/workflows/docs.yml
vendored
@ -3,21 +3,47 @@ on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 15 * * 6'
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
create:
|
||||
permissions:
|
||||
contents: none
|
||||
name: Create
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-20.04, ubuntu-18.04, windows-2022, macos-11]
|
||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
|
||||
operating-system: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, macos-13]
|
||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
- name: Create for Linux and macOS
|
||||
tools: none
|
||||
- name: Create file with all extensions for Linux and macOS
|
||||
env:
|
||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
version: ${{ matrix.php-versions }}
|
||||
if: matrix.operating-system != 'windows-2022'
|
||||
run: |
|
||||
php -m >> "$file.all"
|
||||
- name: Create file with all extensions for Windows
|
||||
env:
|
||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
version: ${{ matrix.php-versions }}
|
||||
if: matrix.operating-system == 'windows-2022'
|
||||
run: |
|
||||
php -m | Out-File -FilePath "$env:file.all" -Append
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: none
|
||||
tools: none
|
||||
- name: Create final file for Linux and macOS
|
||||
env:
|
||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
version: ${{ matrix.php-versions }}
|
||||
@ -26,10 +52,20 @@ jobs:
|
||||
echo "## PHP $version" >> "$file"
|
||||
printf "\n" >> "$file"
|
||||
echo "\`\`\`" >> "$file"
|
||||
php -m >> "$file"
|
||||
php -m >> "$file.builtin"
|
||||
while IFS= read -r line; do
|
||||
if [[ $line == [* || -z "${line// }" ]]; then
|
||||
echo "$line" >> "$file"
|
||||
elif grep -q "^$line" "$file.builtin"; then
|
||||
echo "$line (builtin)" >> "$file"
|
||||
else
|
||||
echo "$line (shared)" >> "$file"
|
||||
fi
|
||||
done < "$file.all"
|
||||
echo "\`\`\`" >> "$file"
|
||||
printf "\n" >> "$file"
|
||||
- name: Create for Windows
|
||||
rm "$file.all" "$file.builtin"
|
||||
- name: Create final file for Windows
|
||||
env:
|
||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
version: ${{ matrix.php-versions }}
|
||||
@ -37,38 +73,53 @@ jobs:
|
||||
run: |
|
||||
Write-Output "## PHP ${{ matrix.php-versions }}`n" | Out-File -FilePath "$env:file"
|
||||
Write-Output "``````" | Out-File -FilePath "$env:file" -Append
|
||||
php -m | Out-File -FilePath "$env:file" -Append
|
||||
php -m | Out-File -FilePath "$env:file.builtin" -Append
|
||||
Get-Content "$env:file.all" | ForEach-Object {
|
||||
if ($_.startsWith('[') -or -not $_.trim()) {
|
||||
Write-Output "$_" | Out-File -FilePath "$env:file" -Append
|
||||
} elseif ($_ -in (Get-Content "$env:file.builtin")) {
|
||||
Write-Output "$_ (builtin)" | Out-File -FilePath "$env:file" -Append
|
||||
} else {
|
||||
Write-Output "$_ (shared)" | Out-File -FilePath "$env:file" -Append
|
||||
}
|
||||
}
|
||||
Write-Output "```````n" | Out-File -FilePath "$env:file" -Append
|
||||
Remove-Item "$env:file.all" -Force
|
||||
Remove-Item "$env:file.builtin" -Force
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: lists
|
||||
name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
update:
|
||||
permissions:
|
||||
contents: write # for Git to git push
|
||||
name: Update
|
||||
needs: create
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository }}.wiki
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}
|
||||
path: ${{ github.workspace }}/lists
|
||||
pattern: lists-*
|
||||
merge-multiple: true
|
||||
- name: Configure Git
|
||||
run : |
|
||||
git config --local user.email "${{ secrets.email }}"
|
||||
git config --local user.name "${{ github.repository_owner }}"
|
||||
- name: Combine
|
||||
run: |
|
||||
for os in ubuntu-20.04 ubuntu-18.04 windows-2022 windows-2019 macos-11 macos-10.15; do
|
||||
for os in ubuntu-24.04 ubuntu-22.04 ubuntu-20.04 windows-2022 windows-2019 macos-13 macos-14 macos-15; do
|
||||
echo "These are extensions which are loaded by default on the following PHP versions. More extensions which are available as packages and available on pecl are supported by setup-php. Refer to [php extension support](https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support) for more details." > Php-extensions-loaded-on-"$os".md
|
||||
for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2; do
|
||||
if [ "$os" = "macos-10.15" ]; then
|
||||
cat lists/php"$version"-macos-11.md >> Php-extensions-loaded-on-"$os".md
|
||||
elif [ "$os" = "windows-2019" ]; then
|
||||
for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5; do
|
||||
if [[ "${os%-*}" = "macos" ]]; then
|
||||
cat lists/php"$version"-macos-13.md >> Php-extensions-loaded-on-"$os".md
|
||||
elif [ "${os%-*}" = "windows" ]; then
|
||||
cat lists/php"$version"-windows-2022.md >> Php-extensions-loaded-on-"$os".md
|
||||
else
|
||||
cat lists/php"$version"-"$os".md >> Php-extensions-loaded-on-"$os".md
|
||||
|
13
.github/workflows/node.yml
vendored
13
.github/workflows/node.yml
vendored
@ -16,6 +16,9 @@ on:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'examples/**'
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: Run
|
||||
@ -26,14 +29,14 @@ jobs:
|
||||
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Setup Node.js 16.x
|
||||
uses: actions/setup-node@v1
|
||||
- name: Setup Node.js 20.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 20.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
@ -51,7 +54,7 @@ jobs:
|
||||
run: npm audit
|
||||
|
||||
- name: Send Coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: coverage/lcov.info
|
||||
|
31
.github/workflows/php.yml
vendored
31
.github/workflows/php.yml
vendored
@ -17,6 +17,10 @@ on:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'examples/**'
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
default-php-version: '8.2'
|
||||
jobs:
|
||||
run:
|
||||
name: Run
|
||||
@ -24,41 +28,51 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
operating-system: [ubuntu-20.04, ubuntu-18.04, windows-2019, macos-latest]
|
||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
|
||||
operating-system: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, macos-13]
|
||||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
|
||||
include:
|
||||
- operating-system: ubuntu-24.04
|
||||
php-versions: ''
|
||||
php-version-file: 'php-version-file'
|
||||
env:
|
||||
extensions: xml, opcache, xdebug, pcov
|
||||
extensions: xml, opcache, xdebug, pcov, gd
|
||||
key: cache-v5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup cache environment
|
||||
id: cache-env
|
||||
uses: shivammathur/cache-extensions@develop
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
php-version: ${{ matrix.php-versions || env.default-php-version }}
|
||||
extensions: ${{ env.extensions }}
|
||||
key: ${{ env.key }}
|
||||
|
||||
- name: Cache extensions
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.cache-env.outputs.dir }}
|
||||
key: ${{ steps.cache-env.outputs.key }}
|
||||
restore-keys: ${{ steps.cache-env.outputs.key }}
|
||||
|
||||
- name: Stage php-version-file
|
||||
if: ${{ matrix.php-version-file == 'php-version-file' }}
|
||||
run: |
|
||||
echo ${{ env.default-php-version }} > php-version-file
|
||||
|
||||
- name: Setup PHP with extensions and custom config
|
||||
run: node dist/index.js
|
||||
env:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
php-version-file: ${{ matrix.php-version-file }}
|
||||
extensions: ${{ env.extensions }}
|
||||
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata
|
||||
|
||||
- name: Testing PHP version
|
||||
run: |
|
||||
php -v
|
||||
php -r "if(strpos(phpversion(), '${{ matrix.php-versions }}') === false) {throw new Exception('Wrong PHP version Installed');}"
|
||||
php -r "if(strpos(phpversion(), '${{ matrix.php-versions || env.default-php-version }}') === false) {throw new Exception('Wrong PHP version Installed');}"
|
||||
|
||||
- name: Testing Composer version
|
||||
run: |
|
||||
@ -67,6 +81,7 @@ jobs:
|
||||
- name: Testing Extensions
|
||||
run: |
|
||||
php -m
|
||||
php -r "if(! extension_loaded('gd')) {throw new Exception('gd not found');}"
|
||||
php -r "if(! extension_loaded('xml')) {throw new Exception('xml not found');}"
|
||||
php -r "if(! extension_loaded('Xdebug')) {throw new Exception('Xdebug not found');}"
|
||||
php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
|
||||
@ -75,4 +90,4 @@ jobs:
|
||||
php -r "if(ini_get('memory_limit')!='-1') {throw new Exception('memory_limit not disabled');}"
|
||||
php -r "if(ini_get('post_max_size')!='256M') {throw new Exception('post_max_size not added');}"
|
||||
php -r "if(ini_get('short_open_tag')!=1) {throw new Exception('short_open_tag not added');}"
|
||||
php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}"
|
||||
php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}"
|
||||
|
10
.github/workflows/publish.yml
vendored
10
.github/workflows/publish.yml
vendored
@ -19,18 +19,18 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout release
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout tag
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
with:
|
||||
ref: ${{ github.event.inputs.tag }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '16.x'
|
||||
node-version: '20.x'
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Install dependencies and add lib
|
||||
@ -46,7 +46,7 @@ jobs:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Change to GitHub Packages registry
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
registry-url: https://npm.pkg.github.com
|
||||
scope: '@shivammathur'
|
||||
|
2
LICENSE
2
LICENSE
@ -1,7 +1,7 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019-2021 shivammathur and contributors
|
||||
Copyright (c) shivammathur and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
382
README.md
382
README.md
@ -9,8 +9,8 @@
|
||||
<p align="center">
|
||||
<a href="https://github.com/shivammathur/setup-php" title="GitHub action to setup PHP"><img alt="GitHub Actions status" src="https://github.com/shivammathur/setup-php/workflows/Main%20workflow/badge.svg"></a>
|
||||
<a href="https://codecov.io/gh/shivammathur/setup-php" title="Code coverage"><img alt="Codecov Code Coverage" src="https://img.shields.io/codecov/c/github/shivammathur/setup-php?logo=codecov"></a>
|
||||
<a href="https://github.com/shivammathur/setup-php/blob/master/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
|
||||
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.2-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
|
||||
<a href="https://github.com/shivammathur/setup-php/blob/main/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
|
||||
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.5-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://reddit.com/r/setup_php" title="setup-php reddit"><img alt="setup-php reddit" src="https://img.shields.io/badge/reddit-join-FF5700?logo=reddit&logoColor=FF5700&labelColor=555555"></a>
|
||||
@ -39,6 +39,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
||||
- [Basic Setup](#basic-setup)
|
||||
- [Matrix Setup](#matrix-setup)
|
||||
- [Nightly Build Setup](#nightly-build-setup)
|
||||
- [Debug Build Setup](#debug-build-setup)
|
||||
- [Thread Safe Setup](#thread-safe-setup)
|
||||
- [Force Update Setup](#force-update-setup)
|
||||
- [Verbose Setup](#verbose-setup)
|
||||
@ -48,7 +49,9 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
||||
- [JIT Configuration](#jit-configuration)
|
||||
- [Cache Extensions](#cache-extensions)
|
||||
- [Cache Composer Dependencies](#cache-composer-dependencies)
|
||||
- [Composer GitHub OAuth](#composer-github-oauth)
|
||||
- [GitHub Composer Authentication](#github-composer-authentication)
|
||||
- [Private Packagist Authentication](#private-packagist-authentication)
|
||||
- [Manual Composer Authentication](#manual-composer-authentication)
|
||||
- [Inline PHP Scripts](#inline-php-scripts)
|
||||
- [Problem Matchers](#problem-matchers)
|
||||
- [Examples](#examples)
|
||||
@ -65,30 +68,34 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
||||
|
||||
### GitHub-Hosted Runners
|
||||
|
||||
| Virtual environment | YAML workflow label | Pre-installed PHP |
|
||||
|-----------------------|------------------------------------|------------------------|
|
||||
| Ubuntu 20.04 | `ubuntu-latest` or `ubuntu-20.04` | `PHP 7.4` to `PHP 8.1` |
|
||||
| Ubuntu 18.04 | `ubuntu-18.04` | `PHP 7.1` to `PHP 8.1` |
|
||||
| Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.1` |
|
||||
| Windows Server 2019 | `windows-2019` | `PHP 8.1` |
|
||||
| macOS Big Sur 11.x | `macos-11` | `PHP 8.1` |
|
||||
| macOS Catalina 10.15 | `macos-latest` or `macos-10.15` | `PHP 8.1` |
|
||||
| Virtual environment | Arch | YAML workflow label | Pre-installed PHP |
|
||||
|---------------------|---------|------------------------------------|------------------------|
|
||||
| Ubuntu 24.04 | x86_64 | `ubuntu-latest` or `ubuntu-24.04` | `PHP 8.3` |
|
||||
| Ubuntu 22.04 | x86_64 | `ubuntu-22.04` | `PHP 8.1` |
|
||||
| Ubuntu 20.04 | x86_64 | `ubuntu-20.04` | `PHP 7.4` to `PHP 8.3` |
|
||||
| Ubuntu 24.04 | aarch64 | `ubuntu-24.04-arm` | `PHP 8.3` |
|
||||
| Ubuntu 22.04 | aarch64 | `ubuntu-22.04-arm` | `PHP 8.1` |
|
||||
| Windows Server 2025 | x64 | `windows-2025` | `PHP 8.3` |
|
||||
| Windows Server 2022 | x64 | `windows-latest` or `windows-2022` | `PHP 8.3` |
|
||||
| Windows Server 2019 | x64 | `windows-2019` | `PHP 8.3` |
|
||||
| macOS Sequoia 15.x | arm64 | `macos-15` | - |
|
||||
| macOS Sonoma 14.x | arm64 | `macos-latest` or `macos-14` | - |
|
||||
| macOS Ventura 13.x | x86_64 | `macos-13` | `PHP 8.3` |
|
||||
|
||||
### Self-Hosted Runners
|
||||
|
||||
| Host OS/Virtual environment | YAML workflow label |
|
||||
|----------------------------------|----------------------------|
|
||||
| Ubuntu 21.04 | `self-hosted` or `Linux` |
|
||||
| Ubuntu 24.04 | `self-hosted` or `Linux` |
|
||||
| Ubuntu 22.04 | `self-hosted` or `Linux` |
|
||||
| Ubuntu 20.04 | `self-hosted` or `Linux` |
|
||||
| Ubuntu 18.04 | `self-hosted` or `Linux` |
|
||||
| Debian 12 | `self-hosted` or `Linux` |
|
||||
| Debian 11 | `self-hosted` or `Linux` |
|
||||
| Debian 10 | `self-hosted` or `Linux` |
|
||||
| Debian 9 | `self-hosted` or `Linux` |
|
||||
| Windows 7 and newer | `self-hosted` or `Windows` |
|
||||
| Windows Server 2012 R2 and newer | `self-hosted` or `Windows` |
|
||||
| macOS Monterey 12.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
| macOS Big Sur 11.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
| macOS Catalina 10.15 | `self-hosted` or `macOS` |
|
||||
| macOS Sequoia 15.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
| macOS Sonoma 14.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
| macOS Ventura 13.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||
|
||||
- Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
|
||||
- Operating systems based on the above Ubuntu and Debian versions are also supported on best effort basis.
|
||||
@ -96,10 +103,11 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
||||
|
||||
## :tada: PHP Support
|
||||
|
||||
On all supported OS/Platforms the following PHP versions are supported as per the runner.
|
||||
On all supported OS/Platforms the following PHP versions can be set up as per the runner.
|
||||
|
||||
- PHP 5.3 to PHP 8.2 on GitHub-hosted runners.
|
||||
- PHP 5.6 to PHP 8.2 on self-hosted runners.
|
||||
- PHP 5.3 to PHP 8.5 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14).
|
||||
- PHP 5.6 to PHP 8.5 on GitHub-hosted macOS ARM64 runners (macos-14).
|
||||
- PHP 5.6 to PHP 8.5 on self-hosted runners.
|
||||
|
||||
| PHP Version | Stability | Release Support | Runner Support |
|
||||
|-------------|-----------|-----------------------|--------------------------------|
|
||||
@ -111,14 +119,18 @@ On all supported OS/Platforms the following PHP versions are supported as per th
|
||||
| `7.1` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
|
||||
| `7.2` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
|
||||
| `7.3` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
|
||||
| `7.4` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.0` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.1` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.2` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
||||
| `7.4` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.0` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.1` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.2` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.3` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||
| `8.5` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
||||
|
||||
**Notes:**
|
||||
- Specifying `8.2` in `php-version` input installs a nightly build of `PHP 8.2.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
|
||||
- To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
|
||||
|
||||
> [!Note]
|
||||
> - Specifying `8.5` in `php-version` input installs a nightly build of `PHP 8.5.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
|
||||
> - To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
|
||||
|
||||
## :heavy_plus_sign: PHP Extension Support
|
||||
|
||||
@ -130,7 +142,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP with PECL extension
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
extensions: imagick, swoole
|
||||
```
|
||||
|
||||
@ -158,29 +170,31 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP with pre-release PECL extension
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
extensions: xdebug-beta
|
||||
```
|
||||
|
||||
- On `Ubuntu` and `macOS` to compile and install an extension from PECL with libraries or custom configuration follow this [guide](https://github.com/shivammathur/setup-php/wiki/Add-extension-from-PECL-with-libraries-and-custom-configuration "Guide to compile and install PHP extensions using PECL with libraries and custom configuration in setup-php").
|
||||
|
||||
- Shared extensions can be disabled by prefixing them with a `:`. All extensions depending on the specified extension will also be disabled.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP and disable opcache
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
extensions: :opcache
|
||||
```
|
||||
|
||||
- All shared extensions can be disabled by specifying `none`. When `none` is specified along with other extensions, it is hoisted to the start of the input. So, all the shared extensions will be disabled first, then rest of the extensions in the input will be processed.
|
||||
|
||||
**Note:** This disables all core and third-party shared extensions and thus, can break some tools which need them. Required extensions are enabled again when the tools are set up on a best-effort basis. So it is recommended to add the extensions required for your tools after `none` in the `extensions` input to avoid any issues.
|
||||
This disables all core and third-party shared extensions and thus, can break some tools which need them. Required extensions are enabled again when the tools are set up on a best-effort basis. So it is recommended to add the extensions required for your tools after `none` in the `extensions` input to avoid any issues.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP without any shared extensions except mbstring
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
extensions: none, mbstring
|
||||
```
|
||||
|
||||
@ -190,16 +204,16 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP with intl
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
extensions: intl-70.1
|
||||
```
|
||||
|
||||
- Extensions loaded by default after `setup-php` runs can be found on the [wiki](https://github.com/shivammathur/setup-php/wiki).
|
||||
|
||||
- These extensions have custom support:
|
||||
- `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`.
|
||||
- `geos` on `Ubuntu` and `macOS`.
|
||||
- `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_oci`, `pecl_http`, `phalcon3` and `phalcon4` on all supported OS.
|
||||
- `cubrid` and `pdo_cubrid` on `Ubuntu`.
|
||||
- `event`, `gearman`, `geos` and `relay` on `Ubuntu` and `macOS`.
|
||||
- `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_oci`, `pecl_http`, `phalcon3`, `phalcon4`, `phalcon5`, and `zephir_parser` on all supported OS.
|
||||
|
||||
- By default, extensions which cannot be added or disabled gracefully leave an error message in the logs, the execution is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
|
||||
|
||||
@ -207,7 +221,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
- name: Setup PHP with fail-fast
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
extensions: oci8
|
||||
env:
|
||||
fail-fast: true
|
||||
@ -217,13 +231,13 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
||||
|
||||
These tools can be set up globally using the `tools` input. It accepts a string in csv-format.
|
||||
|
||||
[`behat`], [`blackfire`], [`blackfire-player`], [`churn`], [`codeception`], [`composer`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cs2pr`], [`deployer`], [`flex`], [`grpc_php_plugin`], [`infection`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`prestissimo`], [`protoc`], [`psalm`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
||||
[`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with tools
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
tools: php-cs-fixer, phpunit
|
||||
```
|
||||
|
||||
@ -233,38 +247,39 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
- name: Setup PHP with tools
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
tools: vimeo/psalm
|
||||
```
|
||||
|
||||
- To set up a particular version of a tool, specify it in the form `tool:version`.
|
||||
|
||||
Version can be in the following format:
|
||||
- Semver. For example `tool:1.2.3` or `tool:1.2.3-beta1`.
|
||||
- Major version. For example `tool:1` or `tool:1.x`.
|
||||
- Major and minor version. For example `tool:1.2` or `tool:1.2.x`.
|
||||
|
||||
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
|
||||
|
||||
Except for major versions of `composer`, For other tools when you specify only the `major` version or the version in `major.minor` format for any tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#composer-github-oauth "Composer GitHub OAuth"). You can do that by setting `COMPOSER_TOKEN` environment variable.
|
||||
Version can be in the following format:
|
||||
- Semver. For example `tool:1.2.3` or `tool:1.2.3-beta1`.
|
||||
- Major version. For example `tool:1` or `tool:1.x`.
|
||||
- Major and minor version. For example `tool:1.2` or `tool:1.2.x`.
|
||||
|
||||
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
|
||||
|
||||
With the exception of major versions of `composer`, if you specify only the `major` version or the version in `major.minor` format for a tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#composer-github-oauth "Composer GitHub OAuth").
|
||||
You can do that by setting `GITHUB_TOKEN` environment variable. The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with tools
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
tools: php-cs-fixer:3.5, phpunit:9.5
|
||||
php-version: '8.4'
|
||||
tools: php-cs-fixer:3.64, phpunit:11.4
|
||||
env:
|
||||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
- The latest stable version of `composer` is set up by default. You can set up the required `composer` version by specifying the major version `v1` or `v2`, or the version in `major.minor` or `semver` format, Additionally for composer `snapshot` and `preview` can also be specified to set up the respective releases.
|
||||
- The latest stable version of `composer` is set up by default. You can set up the required `composer` version by specifying the major version `v1` or `v2`, or the version in `major.minor` or `semver` format. Additionally, for composer `snapshot` and `preview` can also be specified to set up the respective releases.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with composer v2
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
tools: composer:v2
|
||||
```
|
||||
|
||||
@ -274,7 +289,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
- name: Setup PHP without composer
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
tools: none
|
||||
```
|
||||
|
||||
@ -284,22 +299,33 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
|
||||
- Tools `prestissimo` and `composer-prefetcher` will be skipped unless `composer:v1` is also specified in tools input. It is recommended to drop `prestissimo` and use `composer v2`.
|
||||
|
||||
- By default, expect `composer` tools which cannot be set up gracefully leave an error message in the logs, the execution is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
|
||||
- By default, except `composer` tools which cannot be set up gracefully leave an error message in the logs, the execution is not interrupted. To change this behaviour you can set `fail-fast` flag to `true`.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with fail-fast
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
tools: deployer
|
||||
env:
|
||||
fail-fast: true
|
||||
```
|
||||
|
||||
**Notes**
|
||||
- Input `tools` is useful to set up tools which are only used in CI workflows, thus keeping your `composer.json` tidy.
|
||||
- If you do not want to use all your dev-dependencies in workflow, you can run composer with `--no-dev` and install required tools using `tools` input to speed up your workflow.
|
||||
- By default, `COMPOSER_NO_INTERACTION` is set to `1` and `COMPOSER_PROCESS_TIMEOUT` is set to `0`. In effect, this means that Composer commands in your scripts do not need to specify `--no-interaction`.
|
||||
> [!NOTE]
|
||||
> - Input `tools` is useful to set up tools which are only used in CI workflows, thus keeping your `composer.json` tidy.
|
||||
> - If you do not want to use all your dev-dependencies in workflow, you can run composer with `--no-dev` and install required tools using `tools` input to speed up your workflow.
|
||||
> - By default, `COMPOSER_NO_INTERACTION` is set to `1` and `COMPOSER_PROCESS_TIMEOUT` is set to `0`. In effect, this means that Composer commands in your scripts do not need to specify `--no-interaction`.
|
||||
> - Also, `COMPOSER_NO_AUDIT` is set to `1`. So if you want to audit your dependencies for security vulnerabilities, it is recommended to add a `composer audit` step before you install them.
|
||||
> - If you want to set a different `COMPOSER_PROCESS_TIMEOUT`, you can set it in your workflow file using the `env` keyword.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with composer and custom process timeout
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
env:
|
||||
COMPOSER_PROCESS_TIMEOUT: 300
|
||||
```
|
||||
|
||||
## :signal_strength: Coverage Support
|
||||
|
||||
@ -312,7 +338,7 @@ Runs on all [PHP versions supported](#tada-php-support "List of PHP versions sup
|
||||
- name: Setup PHP with Xdebug
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
coverage: xdebug
|
||||
```
|
||||
|
||||
@ -327,25 +353,26 @@ Runs on all [PHP versions supported](#tada-php-support "List of PHP versions sup
|
||||
coverage: xdebug2
|
||||
```
|
||||
|
||||
**Note**: Xdebug is enabled by default on Ubuntu GitHub Actions images, so if you are not using it in your workflow it is recommended to disable it as that will have a positive impact on your PHP performance. Please refer to the [disable coverage](#disable-coverage) section for details.
|
||||
> [!NOTE]
|
||||
> Xdebug is enabled by default on Ubuntu GitHub Actions images, so if you are not using it in your workflow it is recommended to disable it as that will have a positive impact on your PHP performance. Please refer to the [disable coverage](#disable-coverage) section for details.
|
||||
|
||||
### PCOV
|
||||
|
||||
Specify `coverage: pcov` to use `PCOV` and disable `Xdebug`.
|
||||
Runs on PHP 7.1 and newer PHP versions.
|
||||
|
||||
- If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values` input.
|
||||
- If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values` input.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with PCOV
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
ini-values: pcov.directory=api #optional, see above for usage.
|
||||
coverage: pcov
|
||||
```
|
||||
|
||||
- PHPUnit 8.x and above supports PCOV out of the box.
|
||||
- PHPUnit 8.x and above supports PCOV out of the box.
|
||||
- If you are using PHPUnit 5.x, 6.x or 7.x, you need to set up `pcov/clobber` before executing your tests.
|
||||
|
||||
```yaml
|
||||
@ -370,7 +397,7 @@ Disable coverage for these reasons:
|
||||
- name: Setup PHP with no coverage driver
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
coverage: none
|
||||
```
|
||||
|
||||
@ -380,14 +407,30 @@ Disable coverage for these reasons:
|
||||
|
||||
> Specify using `with` keyword
|
||||
|
||||
#### `php-version` (required)
|
||||
#### `php-version` (optional)
|
||||
|
||||
- Specify the PHP version you want to set up.
|
||||
- Accepts a `string`. For example `'8.0'`.
|
||||
- Accepts `latest` to set up the latest stable PHP version.
|
||||
- Accepts a `string`. For example `'8.4'`.
|
||||
- Accepts `lowest` to set up the lowest supported PHP version.
|
||||
- Accepts `highest` or `latest` to set up the latest stable PHP version.
|
||||
- Accepts `nightly` to set up a nightly build from the master branch of PHP.
|
||||
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
|
||||
- See [PHP support](#tada-php-support) for supported PHP versions.
|
||||
- Accepts `pre-installed` to set up the highest pre-installed PHP version. You can combine this with `update: true` to update the pre-installed PHP version.
|
||||
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
|
||||
- See [PHP support](#tada-php-support) for the supported PHP versions.
|
||||
- If not specified, it looks for the following in order:
|
||||
- The `php-version-file` input if it exists
|
||||
- A `composer.lock` file and the `platform-overrides.php` value
|
||||
- A `composer.json` file and the `config.platform.php` value
|
||||
- If the `composer.lock` or `composer.json` file is in a sub-directory in your repository, please specify the subdirectory path in `COMPOSER_PROJECT_DIR` env.
|
||||
|
||||
#### `php-version-file` (optional)
|
||||
|
||||
- Specify a file with the PHP version you want to set up.
|
||||
- Accepts a `string`. For example `'.phpenv-version'`.
|
||||
- See [PHP support](#tada-php-support) for the supported PHP versions.
|
||||
- By default, `.php-version` file is used.
|
||||
- The file either have the PHP version as its content, or follow the asdf `.tool-versions` format.
|
||||
- If not specified and the default `.php-version` file is not found, the latest stable PHP version is set up.
|
||||
|
||||
#### `extensions` (optional)
|
||||
|
||||
@ -405,9 +448,9 @@ Disable coverage for these reasons:
|
||||
|
||||
#### `ini-values` (optional)
|
||||
|
||||
- Specify the values you want to add to `php.ini`.
|
||||
- Specify the values you want to add to `php.ini`.
|
||||
- Accepts a `string` in csv-format. For example `post_max_size=256M, max_execution_time=180`.
|
||||
- Accepts ini values with commas if wrapped in quotes. For example `xdebug.mode="develop,coverage"`.
|
||||
- Accepts ini values with commas if wrapped in quotes. For example `xdebug.mode="develop,coverage"`.
|
||||
|
||||
#### `coverage` (optional)
|
||||
|
||||
@ -419,7 +462,7 @@ Disable coverage for these reasons:
|
||||
|
||||
- Specify the tools you want to set up.
|
||||
- Accepts a `string` in csv-format. For example: `phpunit, phpcs`
|
||||
- See [tools Support](#wrench-tools-support) for tools supported.
|
||||
- See [tools support](#wrench-tools-support) for tools supported.
|
||||
|
||||
### Outputs
|
||||
|
||||
@ -434,7 +477,7 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
|
||||
id: setup-php
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
|
||||
- name: Print PHP version
|
||||
run: echo ${{ steps.setup-php.outputs.php-version }}
|
||||
@ -453,8 +496,8 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
|
||||
|
||||
#### `phpts` (optional)
|
||||
|
||||
- Specify to set up thread-safe version of PHP on Windows.
|
||||
- Accepts `ts` and `nts`.
|
||||
- Specify to set up a thread-safe build of PHP.
|
||||
- Accepts `nts` for non-thread-safe and `zts` or `ts` for thread-safe.
|
||||
- By default, it is set to `nts`.
|
||||
- See [thread safe setup](#thread-safe-setup) for more info.
|
||||
|
||||
@ -476,7 +519,7 @@ steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
extensions: mbstring, intl
|
||||
ini-values: post_max_size=256M, max_execution_time=180
|
||||
coverage: xdebug
|
||||
@ -494,12 +537,12 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
php-versions: ['8.2', '8.3', '8.4']
|
||||
phpunit-versions: ['latest']
|
||||
include:
|
||||
- operating-system: 'ubuntu-latest'
|
||||
php-versions: '7.2'
|
||||
phpunit-versions: '8.5.21'
|
||||
- operating-system: 'ubuntu-latest'
|
||||
php-versions: '8.1'
|
||||
phpunit-versions: 10
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
@ -509,13 +552,15 @@ jobs:
|
||||
ini-values: post_max_size=256M, max_execution_time=180
|
||||
coverage: xdebug
|
||||
tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
### Nightly Build Setup
|
||||
|
||||
> Set up a nightly build of `PHP 8.2`.
|
||||
> Set up a nightly build of `PHP 8.5`.
|
||||
|
||||
- This PHP version is currently in active development and might contain bugs and breaking changes.
|
||||
- These PHP versions are currently in active development and might contain bugs and breaking changes.
|
||||
- Some user space extensions might not support this version currently.
|
||||
|
||||
```yaml
|
||||
@ -523,31 +568,51 @@ steps:
|
||||
- name: Setup nightly PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.2'
|
||||
php-version: '8.5'
|
||||
extensions: mbstring
|
||||
ini-values: post_max_size=256M, max_execution_time=180
|
||||
coverage: xdebug
|
||||
tools: php-cs-fixer, phpunit
|
||||
```
|
||||
|
||||
### Debug Build Setup
|
||||
|
||||
> Set up a PHP build with debugging symbols.
|
||||
|
||||
- Production release builds of PHP without debugging symbols are set up by default.
|
||||
- You can use the `debug` environment variable to set up a build with debugging symbols for PHP 5.6 and above.
|
||||
|
||||
> [!NOTE]
|
||||
> - On Linux, the debug symbols are added as [debug info files](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Separate-Debug-Files.html) in the `/usr/lib/debug/.build-id` directory. These files match the `build-id` in the ELF section of the PHP binaries and debugging tools like `gdb` are able to resolve the symbols from these files.
|
||||
> - On Windows, the debug symbols are added as `pdb` files in the PHP installation directory.
|
||||
> - On macOS, the debug symbols are compiled into the binaries.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: Setup PHP with debugging symbols
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
env:
|
||||
debug: true # specify true or false
|
||||
```
|
||||
|
||||
### Thread Safe Setup
|
||||
|
||||
> Set up `TS` or `NTS` PHP on `Windows`.
|
||||
> Set up `TS` or `NTS` PHP.
|
||||
|
||||
- `NTS` versions are set up by default.
|
||||
- On `Ubuntu` and `macOS` only `NTS` versions are supported.
|
||||
- On `Windows` both `TS` and `NTS` versions are supported.
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
run:
|
||||
runs-on: windows-latest
|
||||
name: Setup PHP TS on Windows
|
||||
runs-on: [ubuntu-latest, windows-latest, macos-latest]
|
||||
name: Setup PHP TS
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
phpts: ts # specify ts or nts
|
||||
```
|
||||
@ -557,13 +622,14 @@ jobs:
|
||||
> Update to the latest patch of PHP versions.
|
||||
|
||||
- Pre-installed PHP versions are not updated to their latest patch release by default.
|
||||
- If `ppa:ondrej/php` is missing on the Ubuntu GitHub environment, the PHP version is updated to the latest patch release.
|
||||
- You can specify the `update` environment variable to `true` for updating to the latest release.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with latest versions
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
update: true # specify true or false
|
||||
```
|
||||
@ -578,14 +644,14 @@ To debug any issues, you can use the `verbose` tag instead of `v2`.
|
||||
- name: Setup PHP with logs
|
||||
uses: shivammathur/setup-php@verbose
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
```
|
||||
|
||||
### Multi-Arch Setup
|
||||
|
||||
> Set up PHP on multiple architecture on Ubuntu GitHub Runners.
|
||||
|
||||
- `PHP 5.6` to `PHP 8.1` are supported by `setup-php` on multiple architecture on `Ubuntu`.
|
||||
- `PHP 5.6` to `PHP 8.4` are supported by `setup-php` on multiple architecture on `Ubuntu`.
|
||||
- For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` installed for `setup-php`.
|
||||
- Currently, for `ARM` based setup, you will need [self-hosted runners](#self-hosted-setup).
|
||||
|
||||
@ -601,7 +667,7 @@ jobs:
|
||||
- name: Install PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
```
|
||||
|
||||
### Self Hosted Setup
|
||||
@ -623,7 +689,7 @@ jobs:
|
||||
runs-on: self-hosted
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
|
||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
|
||||
name: PHP ${{ matrix.php-versions }}
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
@ -634,10 +700,10 @@ jobs:
|
||||
runner: self-hosted
|
||||
```
|
||||
|
||||
**Notes**
|
||||
- Do not set up multiple self-hosted runners on a single server instance as parallel workflow will conflict with each other.
|
||||
- Do not set up self-hosted runners on the side on your development environment or your production server.
|
||||
- Avoid using the same labels for your `self-hosted` runners which are used by `GitHub-hosted` runners.
|
||||
> [!NOTE]
|
||||
> - Do not set up multiple self-hosted runners on a single server instance as parallel workflow will conflict with each other.
|
||||
> - Do not set up self-hosted runners on the side on your development environment or your production server.
|
||||
> - Avoid using the same labels for your `self-hosted` runners which are used by `GitHub-hosted` runners.
|
||||
|
||||
### Local Testing Setup
|
||||
|
||||
@ -651,40 +717,43 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
```
|
||||
|
||||
Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker images.
|
||||
|
||||
Choose the image tag which matches the `runs-on` property in your workflow. For example, if you are using `ubuntu-20.04` in your workflow, run `act -P ubuntu-20.04=shivammathur/node:20.04`.
|
||||
Choose the image tag which matches the `runs-on` property in your workflow. For example, if you are using `ubuntu-20.04` in your workflow, run `act -P ubuntu-20.04=shivammathur/node:2004`.
|
||||
|
||||
```bash
|
||||
# For runs-on: ubuntu-latest
|
||||
act -P ubuntu-latest=shivammathur/node:latest
|
||||
|
||||
# For runs-on: ubuntu-24.04
|
||||
act -P ubuntu-24.04=shivammathur/node:2404
|
||||
|
||||
# For runs-on: ubuntu-22.04
|
||||
act -P ubuntu-22.04=shivammathur/node:2204
|
||||
|
||||
# For runs-on: ubuntu-20.04
|
||||
act -P ubuntu-20.04=shivammathur/node:2004
|
||||
|
||||
# For runs-on: ubuntu-18.04
|
||||
act -P ubuntu-18.04=shivammathur/node:1804
|
||||
```
|
||||
|
||||
### JIT Configuration
|
||||
|
||||
> Enable Just-in-time(JIT) on PHP 8.0 and above.
|
||||
> Enable Just-in-time (JIT) on PHP 8.0 and above.
|
||||
|
||||
- To enable JIT, enable `opcache` in cli mode by setting `opcache.enable_cli=1`.
|
||||
- JIT conflicts with `Xdebug`, `PCOV`, and other extensions which override `zend_execute_ex` function, so set `coverage: none` and disable any such extension if added.
|
||||
- By default, `opcache.jit=1235` and `opcache.jit_buffer_size=256M` are set which can be changed using `ini-values` input.
|
||||
- For detailed information about JIT related directives refer to the [`official PHP documentation`](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit "opcache.jit documentation").
|
||||
|
||||
For example to enable JIT in `tracing` mode with buffer size of `64 MB`.
|
||||
For example to enable JIT in `tracing` mode with buffer size of `64 MB`.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with JIT in tracing mode
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
coverage: none
|
||||
ini-values: opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=64M
|
||||
```
|
||||
@ -701,10 +770,10 @@ If your project uses composer, you can persist the composer's internal cache dir
|
||||
```yaml
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
@ -714,9 +783,9 @@ If your project uses composer, you can persist the composer's internal cache dir
|
||||
run: composer install --prefer-dist
|
||||
```
|
||||
|
||||
**Notes**
|
||||
- Please do not cache `vendor` directory using `action/cache` as that will have side effects.
|
||||
- If you do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
|
||||
> [!NOTE]
|
||||
> - Please do not cache `vendor` directory using `action/cache` as that will have side effects.
|
||||
> - If you do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
|
||||
```yaml
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
```
|
||||
@ -727,17 +796,54 @@ key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ hashFiles('**/composer.l
|
||||
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
|
||||
```
|
||||
|
||||
### Composer GitHub OAuth
|
||||
### GitHub Composer Authentication
|
||||
|
||||
If you have a number of workflows which set up multiple tools or have many composer dependencies, you might hit the GitHub's rate limit for composer. Also, if you specify only the major version or the version in `major.minor` format, you can hit the rate limit. To avoid this you can specify an `OAuth` token by setting `COMPOSER_TOKEN` environment variable. You can use [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token "GITHUB_TOKEN documentation") secret for this purpose.
|
||||
If you have a number of workflows which set up multiple tools or have many composer dependencies, you might hit the GitHub's rate limit for composer. Also, if you specify only the major version or the version in `major.minor` format, you can hit the rate limit. To avoid this you can specify an `OAuth` token by setting `GITHUB_TOKEN` environment variable. You can use [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token "GITHUB_TOKEN documentation") secret for this purpose.
|
||||
|
||||
The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
env:
|
||||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
### Private Packagist Authentication
|
||||
|
||||
If you use Private Packagist for your private composer dependencies, you can set the `PACKAGIST_TOKEN` environment variable to authenticate.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
env:
|
||||
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
|
||||
```
|
||||
|
||||
### Manual Composer Authentication
|
||||
|
||||
In addition to GitHub or Private Packagist, if you want to authenticate private repositories hosted elsewhere, you can set the `COMPOSER_AUTH_JSON` environment variable with the authentication methods and the credentials in json format.
|
||||
Please refer to the authentication section in [`composer documentation`](https://getcomposer.org/doc/articles/authentication-for-private-packages.md "composer documentation") for more details.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
env:
|
||||
COMPOSER_AUTH_JSON: |
|
||||
{
|
||||
"http-basic": {
|
||||
"example.org": {
|
||||
"username": "${{ secrets.EXAMPLE_ORG_USERNAME }}",
|
||||
"password": "${{ secrets.EXAMPLE_ORG_PASSWORD }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Inline PHP Scripts
|
||||
@ -750,7 +856,7 @@ Put the code in the run property of a step and specify the shell as `php {0}`.
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
|
||||
- name: Run PHP code
|
||||
shell: php {0}
|
||||
@ -790,7 +896,7 @@ PHPStan supports error reporting in GitHub Actions, so it does not require probl
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
tools: phpstan
|
||||
|
||||
- name: Run PHPStan
|
||||
@ -805,7 +911,7 @@ Psalm supports error reporting in GitHub Actions with an output format `github`.
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
tools: psalm
|
||||
|
||||
- name: Run Psalm
|
||||
@ -815,7 +921,7 @@ Psalm supports error reporting in GitHub Actions with an output format `github`.
|
||||
#### Tools with checkstyle support
|
||||
|
||||
For tools that support `checkstyle` reporting like `phpstan`, `psalm`, `php-cs-fixer` and `phpcs` you can use `cs2pr` to annotate your code.
|
||||
For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-pull-request-from-checkstyle).
|
||||
For examples refer to the [cs2pr documentation](https://github.com/staabm/annotate-pull-request-from-checkstyle).
|
||||
|
||||
> Here is an example with `phpcs`.
|
||||
|
||||
@ -823,7 +929,7 @@ For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-p
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
php-version: '8.4'
|
||||
tools: cs2pr, phpcs
|
||||
|
||||
- name: Run phpcs
|
||||
@ -832,7 +938,7 @@ For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-p
|
||||
|
||||
### Examples
|
||||
|
||||
Examples of using `setup-php` with various PHP Frameworks and Packages.
|
||||
Examples of using `setup-php` with various PHP frameworks and packages.
|
||||
|
||||
| Framework/Package | Runs on | Workflow |
|
||||
|----------------------------------------|---------------------------------|---------------------------------------------------------------------------------------------------------------|
|
||||
@ -864,14 +970,15 @@ Examples of using `setup-php` with various PHP Frameworks and Packages.
|
||||
|
||||
- Use the `v2` tag as `setup-php` version. It is a rolling tag and is synced with the latest minor and patch releases. With `v2` you automatically get the bug fixes, security patches, new features and support for latest PHP releases.
|
||||
- Semantic release versions can also be used. It is recommended to [use dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot "Setup Dependabot with GitHub Actions") with semantic versioning to keep the actions in your workflows up to date.
|
||||
- Commit SHA can also be used, but are not recommended. They have to be updated with every release manually, without which you will not get any bug fixes, security patches or new features.
|
||||
- Commit SHA can also be used, but are not recommended unless you set up tooling to update them with each release of the action.
|
||||
- A new major version of the action will only be tagged when there are breaking changes in the setup-php API i.e. inputs, outputs, and environment flags.
|
||||
- For debugging any issues `verbose` tag can be used temporarily. It outputs all the logs and is also synced with the latest releases.
|
||||
- It is highly discouraged to use the `master` branch as version, it might break your workflow after major releases as they have breaking changes.
|
||||
- If you are using the `v1` tag or a `1.x.y` version, you should [switch to v2](https://github.com/shivammathur/setup-php/wiki/Switch-to-v2 "Guide for switching from setup-php v1 to v2") as `v1` only gets critical bug fixes. Maintenance support for `v1` will be dropped with the last `PHP 8.0` release.
|
||||
- It is highly discouraged to use the `main` branch as version, it might break your workflow after major releases as they have breaking changes.
|
||||
- If you are using the `v1` tag or a `1.x.y` version, you should [switch to v2](https://github.com/shivammathur/setup-php/wiki/Switch-to-v2 "Guide for switching from setup-php v1 to v2") as `v1` is not supported anymore.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
- The scripts and documentation in this project are under the [MIT License](LICENSE "License for shivammathur/setup-php").
|
||||
- The scripts and documentation in this project are under the [MIT License](LICENSE "License for shivammathur/setup-php").
|
||||
- This project has multiple [dependencies](#package-dependencies "Dependencies for this PHP Action"). Their licenses can be found in their respective repositories.
|
||||
- The logo for `setup-php` is a derivative work of [php.net logo](https://www.php.net/download-logos.php) and is licensed under the [CC BY-SA 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/ "Creative Commons License").
|
||||
|
||||
@ -903,18 +1010,18 @@ These companies generously provide setup-php their products and services to aid
|
||||
|
||||
<p>
|
||||
<a href="https://www.jetbrains.com/?from=setup-php">
|
||||
<img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="106" height="60">
|
||||
<img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="212" height="120">
|
||||
</a>
|
||||
|
||||
<a href="https://www.macstadium.com/opensource/members#gh-light-mode-only">
|
||||
<img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="148" height="60">
|
||||
<img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="296" height="120">
|
||||
</a>
|
||||
<a href="https://www.macstadium.com/opensource/members#gh-dark-mode-only">
|
||||
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="148" height="60">
|
||||
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="296" height="120">
|
||||
</a>
|
||||
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-setup-php">
|
||||
<img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="70" height="60">
|
||||
<img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="140" height="120">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@ -946,15 +1053,19 @@ These companies generously provide setup-php their products and services to aid
|
||||
[`behat`]: https://docs.behat.org/en/latest/
|
||||
[`blackfire`]: https://blackfire.io/docs/php/index
|
||||
[`blackfire-player`]: https://blackfire.io/docs/builds-cookbooks/player
|
||||
[`box`]: https://github.com/humbug/box
|
||||
[`castor`]: https://github.com/jolicode/castor
|
||||
[`churn`]: https://github.com/bmitch/churn-php
|
||||
[`codeception`]: https://codeception.com/
|
||||
[`composer`]: https://getcomposer.org/
|
||||
[`composer-dependency-analyser`]: https://github.com/shipmonk-rnd/composer-dependency-analyser
|
||||
[`composer-normalize`]: https://github.com/ergebnis/composer-normalize
|
||||
[`composer-prefetcher`]: https://github.com/narrowspark/automatic-composer-prefetcher
|
||||
[`composer-require-checker`]: https://github.com/maglnet/ComposerRequireChecker
|
||||
[`composer-unused`]: https://github.com/composer-unused/composer-unused
|
||||
[`cs2pr`]: https://github.com/staabm/annotate-pull-request-from-checkstyle
|
||||
[`deployer`]: https://deployer.org/
|
||||
[`ecs`]: https://github.com/easy-coding-standard/easy-coding-standard
|
||||
[`flex`]: https://flex.symfony.com/
|
||||
[`grpc_php_plugin`]: https://grpc.io/
|
||||
[`infection`]: https://infection.github.io/
|
||||
@ -966,9 +1077,10 @@ These companies generously provide setup-php their products and services to aid
|
||||
[`phive`]: https://phar.io/
|
||||
[`php-config`]: https://www.php.net/manual/en/install.pecl.php-config.php
|
||||
[`php-cs-fixer`]: https://cs.symfony.com/
|
||||
[`phpcbf`]: https://github.com/squizlabs/php_codesniffer
|
||||
[`php-scoper`]: https://github.com/humbug/php-scoper
|
||||
[`phpcbf`]: https://github.com/PHPCSStandards/php_codesniffer
|
||||
[`phpcpd`]: https://github.com/sebastianbergmann/phpcpd
|
||||
[`phpcs`]: https://github.com/squizlabs/php_codesniffer
|
||||
[`phpcs`]: https://github.com/PHPCSStandards/php_codesniffer
|
||||
[`phpdoc`]: https://phpdoc.org/
|
||||
[`phpDocumentor`]: https://phpdoc.org/
|
||||
[`phpize`]: https://www.php.net/manual/en/install.pecl.phpize.php
|
||||
@ -979,9 +1091,11 @@ These companies generously provide setup-php their products and services to aid
|
||||
[`phpunit`]: https://phpunit.de/
|
||||
[`phpunit-bridge`]: https://symfony.com/doc/current/components/phpunit_bridge.html
|
||||
[`phpunit-polyfills`]: https://github.com/Yoast/PHPUnit-Polyfills
|
||||
[`pint`]: https://github.com/laravel/pint
|
||||
[`prestissimo`]: https://github.com/hirak/prestissimo
|
||||
[`protoc`]: https://developers.google.com/protocol-buffers/
|
||||
[`psalm`]: https://psalm.dev/
|
||||
[`rector`]: https://getrector.org/
|
||||
[`symfony`]: https://symfony.com/download
|
||||
[`symfony-cli`]: https://symfony.com/download
|
||||
[`vapor`]: https://docs.vapor.build/
|
||||
|
@ -4,6 +4,8 @@ describe('Config tests', () => {
|
||||
it.each`
|
||||
driver | php | os | output
|
||||
${'PCOV'} | ${'7.4'} | ${'win32'} | ${'Add-Extension pcov,Disable-Extension xdebug false'}
|
||||
${'pcov'} | ${'7.4'} | ${'win32'} | ${'$pcov_version = php -r "echo phpversion(\'pcov\');"'}
|
||||
${'pcov'} | ${'7.4'} | ${'win32'} | ${'PCOV $pcov_version enabled as coverage driver'}
|
||||
${'pcov'} | ${'7.0'} | ${'win32'} | ${'PHP 7.1 or newer is required'}
|
||||
${'pcov'} | ${'5.6'} | ${'win32'} | ${'PHP 7.1 or newer is required'}
|
||||
${'pcov'} | ${'7.4'} | ${'win32'} | ${'Add-Extension pcov,Disable-Extension xdebug false'}
|
||||
@ -15,6 +17,8 @@ describe('Config tests', () => {
|
||||
${'xdebug'} | ${'8.0'} | ${'linux'} | ${'add_extension xdebug'}
|
||||
${'xdebug3'} | ${'8.0'} | ${'linux'} | ${'add_extension xdebug'}
|
||||
${'xdebug2'} | ${'7.4'} | ${'linux'} | ${'add_pecl_extension xdebug 2.9.8 zend_extension'}
|
||||
${'xdebug'} | ${'7.4'} | ${'linux'} | ${'xdebug_version="$(php -r "echo phpversion(\'xdebug\');")"'}
|
||||
${'xdebug'} | ${'7.4'} | ${'linux'} | ${'Xdebug $xdebug_version enabled as coverage driver'}
|
||||
${'xdebug'} | ${'7.4'} | ${'darwin'} | ${'add_brew_extension xdebug'}
|
||||
${'xdebug3'} | ${'7.1'} | ${'darwin'} | ${'xdebug3 is not supported on PHP 7.1'}
|
||||
${'xdebug2'} | ${'7.4'} | ${'darwin'} | ${'add_brew_extension xdebug2'}
|
||||
|
@ -19,12 +19,16 @@ describe('Extension tests', () => {
|
||||
${'pcov'} | ${'5.6'} | ${'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
|
||||
${'pdo_oci'} | ${'7.4'} | ${'Add-Oci pdo_oci'}
|
||||
${'pecl_http'} | ${'7.4'} | ${'Add-Http'}
|
||||
${'pdo_sqlsrv'} | ${'7.4'} | ${'Add-Sqlsrv pdo_sqlsrv'}
|
||||
${'phalcon3'} | ${'7.2'} | ${'Add-Phalcon phalcon3'}
|
||||
${'phalcon4'} | ${'7.4'} | ${'Add-Phalcon phalcon4'}
|
||||
${'sqlite'} | ${'7.4'} | ${'Add-Extension sqlite3'}
|
||||
${'sqlsrv'} | ${'5.6'} | ${'Add-Extension sqlsrv'}
|
||||
${'sqlsrv'} | ${'7.4'} | ${'Add-Sqlsrv sqlsrv'}
|
||||
${'sqlsrv-1.2.3preview1'} | ${'7.4'} | ${'Add-Extension sqlsrv devel 1.2.3'}
|
||||
${'Xdebug'} | ${'7.4'} | ${'Add-Extension xdebug'}
|
||||
${'xdebug2'} | ${'7.2'} | ${'Add-Extension xdebug stable 2.9.8'}
|
||||
${'zephir_parser'} | ${'7.2'} | ${'Add-ZephirParser zephir_parser'}
|
||||
`(
|
||||
'checking addExtensionOnWindows for extension $extension on version $version',
|
||||
async ({extension, version, output}) => {
|
||||
@ -48,6 +52,7 @@ describe('Extension tests', () => {
|
||||
${'http-1.2.3'} | ${'7.3'} | ${'add_http http-1.2.3'}
|
||||
${'intl-65.1'} | ${'5.6'} | ${'add_intl intl-65.1'}
|
||||
${'ioncube'} | ${'7.3'} | ${'add_ioncube'}
|
||||
${'memcache-8.2'} | ${'8.2'} | ${'add_pecl_extension memcache 8.2 extension'}
|
||||
${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
|
||||
${'oci8'} | ${'7.3'} | ${'add_oci oci8'}
|
||||
${'pcov'} | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6'}
|
||||
@ -59,11 +64,14 @@ describe('Extension tests', () => {
|
||||
${'pdo_sqlsrv'} | ${'7.4'} | ${'add_sqlsrv pdo_sqlsrv'}
|
||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
|
||||
${'relay'} | ${'7.4'} | ${'add_relay relay'}
|
||||
${'relay-v1.2.3'} | ${'7.4'} | ${'add_relay relay-v1.2.3'}
|
||||
${'sqlite'} | ${'7.4'} | ${'add_extension sqlite3'}
|
||||
${'sqlsrv-1.2.3-beta1'} | ${'7.4'} | ${'add_pecl_extension sqlsrv 1.2.3beta1 extension'}
|
||||
${'Xdebug'} | ${'7.4'} | ${'add_extension xdebug'}
|
||||
${'xdebug-alpha'} | ${'7.4'} | ${'add_unstable_extension xdebug alpha zend_extension'}
|
||||
${'xdebug2'} | ${'7.2'} | ${'add_pecl_extension xdebug 2.9.8 zend_extension'}
|
||||
${'zephir_parser-1.2.3'} | ${'7.2'} | ${'add_zephir_parser zephir_parser-1.2.3'}
|
||||
`(
|
||||
'checking addExtensionOnLinux for extension $extension on version $version',
|
||||
async ({extension, version, output}) => {
|
||||
@ -92,8 +100,9 @@ describe('Extension tests', () => {
|
||||
${'pcov'} | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
|
||||
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||
${'relay-1.2.3'} | ${'7.4'} | ${'add_relay relay-1.2.3'}
|
||||
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
|
||||
${'sqlsrv'} | ${'7.3'} | ${'add_sqlsrv sqlsrv'}
|
||||
${'zephir_parser-v1.2.3'} | ${'7.2'} | ${'add_zephir_parser zephir_parser-v1.2.3'}
|
||||
`(
|
||||
'checking addExtensionOnDarwin for extension $extension on version $version',
|
||||
async ({extension, version, output}) => {
|
||||
@ -112,12 +121,13 @@ describe('Extension tests', () => {
|
||||
const [formula, extension]: string[] = line.split('=');
|
||||
const prefix: string =
|
||||
extension == 'xdebug' ? 'zend_extension' : 'extension';
|
||||
const ext_name = extension.replace(/\d+|(pdo|pecl)[_-]/, '');
|
||||
const output: string = fs.existsSync(
|
||||
`src/scripts/extensions/${extension}.sh`
|
||||
`src/scripts/extensions/${ext_name}.sh`
|
||||
)
|
||||
? `add_${extension}`
|
||||
? `add_${ext_name}`
|
||||
: `add_brew_extension ${formula} ${prefix}`;
|
||||
return [formula, '7.3', output];
|
||||
return [formula, formula === 'phalcon3' ? '7.3' : '7.4', output];
|
||||
});
|
||||
|
||||
it.each(data)(
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as fetch from '../src/fetch';
|
||||
import nock = require('nock');
|
||||
import nock from 'nock';
|
||||
|
||||
it('checking fetch', async () => {
|
||||
const host_url = 'https://example.com';
|
||||
|
@ -10,7 +10,7 @@ jest.mock('../src/install', () => ({
|
||||
.mockImplementation(async (os: string): Promise<string> => {
|
||||
const filename = os + (await utils.scriptExtension(os));
|
||||
const version: string = await utils.parseVersion(
|
||||
await utils.getInput('php-version', true)
|
||||
await utils.readPHPVersion()
|
||||
);
|
||||
const ini_file: string = await utils.parseIniFile(
|
||||
await utils.getInput('ini-file', false)
|
||||
@ -38,25 +38,30 @@ jest.mock('../src/install', () => ({
|
||||
*/
|
||||
jest.mock('../src/fetch', () => ({
|
||||
fetch: jest.fn().mockImplementation(() => {
|
||||
return {data: '{ "latest": "8.1", "5.x": "5.6" }'};
|
||||
return {
|
||||
data: '{ "latest": "8.3", "lowest": "8.1", "highest": "8.3", "nightly": "8.4", "5.x": "5.6" }'
|
||||
};
|
||||
})
|
||||
}));
|
||||
|
||||
describe('Install', () => {
|
||||
it.each`
|
||||
version | os | extension_csv | ini_file | ini_values_csv | coverage_driver | tools | output
|
||||
${'7.3'} | ${'darwin'} | ${''} | ${'production'} | ${''} | ${''} | ${''} | ${'bash darwin.sh 7.3 production'}
|
||||
${'7.3'} | ${'darwin'} | ${'a, b'} | ${'development'} | ${'a=b'} | ${'x'} | ${''} | ${'bash darwin.sh 7.3 development install extensions set coverage driver edit php.ini'}
|
||||
${'7.4.1'} | ${'darwin'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash darwin.sh 7.4 none'}
|
||||
${'8'} | ${'darwin'} | ${''} | ${''} | ${''} | ${''} | ${''} | ${'bash darwin.sh 8.0 production'}
|
||||
${'8.0'} | ${'darwin'} | ${''} | ${'development'} | ${''} | ${''} | ${''} | ${'bash darwin.sh 8.0 development'}
|
||||
${'8.1'} | ${'darwin'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash darwin.sh 8.1 none'}
|
||||
${'7.3'} | ${'linux'} | ${''} | ${'invalid'} | ${''} | ${''} | ${''} | ${'bash linux.sh 7.3 production'}
|
||||
${'7.3'} | ${'linux'} | ${'a, b'} | ${'development'} | ${'a=b'} | ${'x'} | ${'phpunit'} | ${'bash linux.sh 7.3 development install extensions add_tool set coverage driver edit php.ini'}
|
||||
${'latest'} | ${'linux'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash linux.sh 8.1 none'}
|
||||
${'7.0'} | ${'win32'} | ${''} | ${'production'} | ${''} | ${''} | ${''} | ${'pwsh win32.ps1 7.0 production'}
|
||||
${'7.3'} | ${'win32'} | ${''} | ${'development'} | ${''} | ${''} | ${''} | ${'pwsh win32.ps1 7.3 development'}
|
||||
${'7.3'} | ${'win32'} | ${'a, b'} | ${'none'} | ${'a=b'} | ${'x'} | ${''} | ${'pwsh win32.ps1 7.3 none install extensions set coverage driver edit php.ini'}
|
||||
version | os | extension_csv | ini_file | ini_values_csv | coverage_driver | tools | output
|
||||
${'7.3'} | ${'darwin'} | ${''} | ${'production'} | ${''} | ${''} | ${''} | ${'bash darwin.sh 7.3 production'}
|
||||
${'7.3'} | ${'darwin'} | ${'a, b'} | ${'development'} | ${'a=b'} | ${'x'} | ${''} | ${'bash darwin.sh 7.3 development install extensions set coverage driver edit php.ini'}
|
||||
${'7.4.1'} | ${'darwin'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash darwin.sh 7.4 none'}
|
||||
${'8'} | ${'darwin'} | ${''} | ${''} | ${''} | ${''} | ${''} | ${'bash darwin.sh 8.0 production'}
|
||||
${'8.0'} | ${'darwin'} | ${''} | ${'development'} | ${''} | ${''} | ${''} | ${'bash darwin.sh 8.0 development'}
|
||||
${'8.1'} | ${'darwin'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash darwin.sh 8.1 none'}
|
||||
${'7.3'} | ${'linux'} | ${''} | ${'invalid'} | ${''} | ${''} | ${''} | ${'bash linux.sh 7.3 production'}
|
||||
${'7.3'} | ${'linux'} | ${'a, b'} | ${'development'} | ${'a=b'} | ${'x'} | ${'phpunit'} | ${'bash linux.sh 7.3 development install extensions add_tool set coverage driver edit php.ini'}
|
||||
${'latest'} | ${'linux'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash linux.sh 8.3 none'}
|
||||
${'lowest'} | ${'linux'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash linux.sh 8.1 none'}
|
||||
${'highest'} | ${'linux'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash linux.sh 8.3 none'}
|
||||
${'nightly'} | ${'linux'} | ${''} | ${'none'} | ${''} | ${''} | ${''} | ${'bash linux.sh 8.4 none'}
|
||||
${'7.0'} | ${'win32'} | ${''} | ${'production'} | ${''} | ${''} | ${''} | ${'pwsh win32.ps1 7.0 production'}
|
||||
${'7.3'} | ${'win32'} | ${''} | ${'development'} | ${''} | ${''} | ${''} | ${'pwsh win32.ps1 7.3 development'}
|
||||
${'7.3'} | ${'win32'} | ${'a, b'} | ${'none'} | ${'a=b'} | ${'x'} | ${''} | ${'pwsh win32.ps1 7.3 none install extensions set coverage driver edit php.ini'}
|
||||
`(
|
||||
'Test install on $os for $version with extensions=$extension_csv, ini_values=$ini_values_csv, coverage_driver=$coverage_driver, tools=$tools',
|
||||
async ({
|
||||
|
50
__tests__/packagist.test.ts
Normal file
50
__tests__/packagist.test.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import * as packagist from '../src/packagist';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('search function', () => {
|
||||
const mockResponse = {
|
||||
packages: {
|
||||
'test-package': [
|
||||
{
|
||||
require: {
|
||||
php: '8.0.0'
|
||||
},
|
||||
version: '1.0.0'
|
||||
},
|
||||
{
|
||||
version: '2.0.0'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
test('should return the version if matching php version is found', async () => {
|
||||
nock('https://repo.packagist.org')
|
||||
.get('/p2/test-package.json')
|
||||
.reply(200, mockResponse);
|
||||
const result = await packagist.search('test-package', '8.0');
|
||||
expect(result).toBe('1.0.0');
|
||||
});
|
||||
|
||||
test('should return null if no matching php version is found', async () => {
|
||||
nock('https://repo.packagist.org')
|
||||
.get('/p2/test-package.json')
|
||||
.reply(200, mockResponse);
|
||||
const result = await packagist.search('test-package', '5.6');
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test('should return null if fetch fails', async () => {
|
||||
nock('https://repo.packagist.org').get('/p2/test-package.json').reply(404);
|
||||
const result = await packagist.search('test-package', '8.0');
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test('should return null if the response is empty', async () => {
|
||||
nock('https://repo.packagist.org')
|
||||
.get('/p2/test-package.json')
|
||||
.reply(200, {error: true, data: '[]'});
|
||||
const result = await packagist.search('test-package', '8.0');
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
});
|
@ -1,3 +1,4 @@
|
||||
import * as fs from 'fs';
|
||||
import * as tools from '../src/tools';
|
||||
|
||||
interface IData {
|
||||
@ -45,7 +46,11 @@ jest.mock('../src/fetch', () => ({
|
||||
.fn()
|
||||
.mockImplementation(
|
||||
async (url: string, token?: string): Promise<Record<string, string>> => {
|
||||
if (url.includes('atom') && !url.includes('no-')) {
|
||||
if (url.includes('deployer')) {
|
||||
return {
|
||||
data: '[{"version": "1.2.3", "url": "https://deployer.org/releases/v1.2.3/deployer.phar"}]'
|
||||
};
|
||||
} else if (url.includes('atom') && !url.includes('no-')) {
|
||||
return {
|
||||
data: '"releases/tag/1.2.3", "releases/tag/3.2.1", "releases/tag/2.3.1"'
|
||||
};
|
||||
@ -66,6 +71,22 @@ jest.mock('../src/fetch', () => ({
|
||||
)
|
||||
}));
|
||||
|
||||
jest.mock('../src/packagist', () => ({
|
||||
search: jest
|
||||
.fn()
|
||||
.mockImplementation(
|
||||
async (
|
||||
package_name: string,
|
||||
php_version: string
|
||||
): Promise<string | null> => {
|
||||
if (package_name === 'phpunit/phpunit') {
|
||||
return php_version + '.0';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
)
|
||||
}));
|
||||
|
||||
describe('Tools tests', () => {
|
||||
it.each`
|
||||
token | version
|
||||
@ -74,7 +95,7 @@ describe('Tools tests', () => {
|
||||
${'beta_token'} | ${'1.2.3-beta1'}
|
||||
${''} | ${'1.2.3'}
|
||||
`('checking getSemverVersion: $token', async ({token, version}) => {
|
||||
process.env['COMPOSER_TOKEN'] = token;
|
||||
process.env['GITHUB_TOKEN'] = token;
|
||||
expect(
|
||||
await tools.getSemverVersion(getData({tool: 'tool', version: '1.2'}))
|
||||
).toBe(version);
|
||||
@ -218,11 +239,11 @@ describe('Tools tests', () => {
|
||||
});
|
||||
|
||||
it.each`
|
||||
os | script | scope
|
||||
${'linux'} | ${'add_composertool tool tool:1.2.3 user/ global'} | ${'global'}
|
||||
${'darwin'} | ${'add_composertool tool tool:1.2.3 user/ scoped'} | ${'scoped'}
|
||||
${'win32'} | ${'Add-Composertool tool tool:1.2.3 user/ scoped'} | ${'scoped'}
|
||||
${'openbsd'} | ${'Platform openbsd is not supported'} | ${'global'}
|
||||
os | script | scope
|
||||
${'linux'} | ${'add_composer_tool tool tool:1.2.3 user/ global'} | ${'global'}
|
||||
${'darwin'} | ${'add_composer_tool tool tool:1.2.3 user/ scoped'} | ${'scoped'}
|
||||
${'win32'} | ${'Add-ComposerTool tool tool:1.2.3 user/ scoped'} | ${'scoped'}
|
||||
${'openbsd'} | ${'Platform openbsd is not supported'} | ${'global'}
|
||||
`('checking addPackage: $os, $scope', async ({os, script, scope}) => {
|
||||
const data = getData({
|
||||
tool: 'tool',
|
||||
@ -260,15 +281,18 @@ describe('Tools tests', () => {
|
||||
);
|
||||
|
||||
it.each`
|
||||
version | php_version | url
|
||||
${'latest'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player.phar'}
|
||||
${'1.2.3'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player-v1.2.3.phar'}
|
||||
${'latest'} | ${'5.5'} | ${'https://get.blackfire.io/blackfire-player-v1.9.3.phar'}
|
||||
${'latest'} | ${'7.0'} | ${'https://get.blackfire.io/blackfire-player-v1.9.3.phar'}
|
||||
os | version | php_version | url
|
||||
${'linux'} | ${'latest'} | ${'8.1'} | ${'https://get.blackfire.io/blackfire-player.phar'}
|
||||
${'linux'} | ${'1.2.3'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player-v1.2.3.phar'}
|
||||
${'linux'} | ${'latest'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player-v1.22.0.phar'}
|
||||
${'linux'} | ${'latest'} | ${'5.5'} | ${'https://get.blackfire.io/blackfire-player-v1.9.3.phar'}
|
||||
${'linux'} | ${'latest'} | ${'7.0'} | ${'https://get.blackfire.io/blackfire-player-v1.9.3.phar'}
|
||||
${'win32'} | ${'latest'} | ${'7.0'} | ${'blackfire-player is not a windows tool'}
|
||||
`(
|
||||
'checking addBlackfirePlayer: $version, $php_version',
|
||||
async ({version, php_version, url}) => {
|
||||
'checking addBlackfirePlayer: $os, $version, $php_version',
|
||||
async ({os, version, php_version, url}) => {
|
||||
const data = getData({
|
||||
os: os,
|
||||
tool: 'blackfire-player',
|
||||
domain: 'https://get.blackfire.io',
|
||||
version_prefix: 'v',
|
||||
@ -283,6 +307,7 @@ describe('Tools tests', () => {
|
||||
version | url
|
||||
${'latest'} | ${'https://deployer.org/deployer.phar'}
|
||||
${'1.2.3'} | ${'https://deployer.org/releases/v1.2.3/deployer.phar'}
|
||||
${'3.2.1'} | ${'Version missing in deployer manifest'}
|
||||
`('checking addDeployer: $version', async ({version, url}) => {
|
||||
const data = getData({
|
||||
tool: 'deployer',
|
||||
@ -293,31 +318,41 @@ describe('Tools tests', () => {
|
||||
});
|
||||
|
||||
it.each`
|
||||
version | no_tool_cache | cache_url | source_url
|
||||
${'latest'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||
${'stable'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||
${'snapshot'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar'} | ${'https://getcomposer.org/composer.phar'}
|
||||
${'preview'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar'} | ${'https://getcomposer.org/composer-preview.phar'}
|
||||
${'1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
|
||||
${'2'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-2.phar'} | ${'https://getcomposer.org/composer-2.phar'}
|
||||
${'1.2.3'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3.phar'}
|
||||
${'1.2.3-RC1'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3-RC1/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3-RC1.phar'}
|
||||
version | php_version | no_tool_cache | cache_url | source_url
|
||||
${'latest'} | ${'7.4'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||
${'stable'} | ${'7.4'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||
${'snapshot'} | ${'7.4'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar'} | ${'https://getcomposer.org/composer.phar'}
|
||||
${'preview'} | ${'7.4'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar'} | ${'https://getcomposer.org/composer-preview.phar'}
|
||||
${'1'} | ${'7.4'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
|
||||
${'2'} | ${'7.4'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-2.phar'} | ${'https://getcomposer.org/composer-2.phar'}
|
||||
${'latest'} | ${'7.4'} | ${'true'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||
${'stable'} | ${'7.4'} | ${'true'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar'} | ${'https://getcomposer.org/composer-stable.phar'}
|
||||
${'snapshot'} | ${'7.4'} | ${'true'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-snapshot.phar'} | ${'https://getcomposer.org/composer.phar'}
|
||||
${'preview'} | ${'7.4'} | ${'true'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-preview.phar'} | ${'https://getcomposer.org/composer-preview.phar'}
|
||||
${'1'} | ${'7.4'} | ${'false'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
|
||||
${'2'} | ${'7.4'} | ${'false'} | ${'https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-2.phar'} | ${'https://getcomposer.org/composer-2.phar'}
|
||||
${'latest'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-stable.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||
${'stable'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-stable.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||
${'snapshot'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-snapshot.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||
${'preview'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-preview.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||
${'1'} | ${'7.1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
|
||||
${'2'} | ${'7.1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-2.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
|
||||
${'1.2.3'} | ${'7.4'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3.phar'}
|
||||
${'1.2.3-RC1'} | ${'7.4'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3-RC1/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3-RC1.phar'}
|
||||
`(
|
||||
'checking addComposer: $version, $no_tool_cache',
|
||||
async ({version, no_tool_cache, cache_url, source_url}) => {
|
||||
'checking addComposer: $version, $php_version, $no_tool_cache',
|
||||
async ({version, php_version, no_tool_cache, cache_url, source_url}) => {
|
||||
const data = getData({
|
||||
tool: 'composer',
|
||||
php_version: php_version,
|
||||
domain: 'https://getcomposer.org',
|
||||
repository: 'composer/composer',
|
||||
version: version
|
||||
});
|
||||
process.env['no_tools_cache'] = no_tool_cache;
|
||||
expect(await tools.addComposer(data)).toContain(source_url);
|
||||
if (no_tool_cache !== 'true') {
|
||||
expect(await tools.addComposer(data)).toContain(
|
||||
`${cache_url},${source_url}`
|
||||
);
|
||||
} else {
|
||||
expect(await tools.addComposer(data)).toContain(source_url);
|
||||
expect(await tools.addComposer(data)).toContain(cache_url);
|
||||
}
|
||||
}
|
||||
);
|
||||
@ -357,33 +392,36 @@ describe('Tools tests', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
'blackfire, blackfire-player, churn, cs2pr, flex, grpc_php_plugin, parallel-lint, php-cs-fixer, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, php-config, phpize, protoc, symfony, vapor, wp',
|
||||
'blackfire, blackfire-player, box, churn, cs2pr, flex, grpc_php_plugin, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, vapor, wp',
|
||||
[
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_blackfire',
|
||||
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"',
|
||||
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
|
||||
'add_tool https://github.com/box-project/box/releases/latest/download/box.phar box "--version"',
|
||||
'add_tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
||||
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
||||
'add_composertool flex flex symfony/ global',
|
||||
'add_composer_tool flex flex symfony/ global',
|
||||
'add_grpc_php_plugin latest',
|
||||
'add_tool https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/latest/download/parallel-lint.phar parallel-lint "--version"',
|
||||
'add_tool https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.2.1/php-cs-fixer.phar php-cs-fixer "-V"',
|
||||
'add_tool https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.2.1/php-cs-fixer.phar php-cs-fixer "-V"',
|
||||
'add_tool https://github.com/humbug/php-scoper/releases/latest/download/php-scoper.phar php-scoper "--version"',
|
||||
'add_tool https://github.com/phpDocumentor/phpDocumentor/releases/latest/download/phpDocumentor.phar phpDocumentor "--version"',
|
||||
'add_composertool phplint phplint overtrue/',
|
||||
'add_composer_tool phplint phplint overtrue/',
|
||||
'add_tool https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar phpstan "-V"',
|
||||
'add_tool https://phar.phpunit.de/phpunit.phar phpunit "--version"',
|
||||
'add_tool https://phar.phpunit.de/phpunit-7.4.0.phar,https://phar.phpunit.de/phpunit-7.phar phpunit "--version"',
|
||||
'add_pecl',
|
||||
'add_tool https://www.phing.info/get/phing-latest.phar phing "-v"',
|
||||
'add_composertool phinx phinx robmorgan/ scoped',
|
||||
'add_composertool phinx phinx:1.2.3 robmorgan/ scoped',
|
||||
'add_composer_tool phinx phinx robmorgan/ scoped',
|
||||
'add_composer_tool phinx phinx:1.2.3 robmorgan/ scoped',
|
||||
'add_tool https://github.com/phar-io/phive/releases/download/3.2.1/phive-3.2.1.phar phive "status"',
|
||||
'add_composertool phpunit-bridge phpunit-bridge symfony/ global',
|
||||
'add_composertool phpunit-polyfills phpunit-polyfills yoast/ global',
|
||||
'add_composer_tool phpunit-bridge phpunit-bridge symfony/ global',
|
||||
'add_composer_tool phpunit-polyfills phpunit-polyfills yoast/ global',
|
||||
'add_tool https://github.com/laravel/pint/releases/latest/download/pint.phar pint "-V"',
|
||||
'add_devtools php-config',
|
||||
'add_devtools phpize',
|
||||
'add_protoc latest',
|
||||
'add_symfony latest',
|
||||
'add_composertool vapor-cli vapor-cli laravel/ scoped',
|
||||
'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
|
||||
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
|
||||
]
|
||||
]
|
||||
@ -396,40 +434,43 @@ describe('Tools tests', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
'behat, blackfire, blackfire-player, churn, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, flex, grpc_php_plugin:1.2.3, infection, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, symfony-cli, vapor-cli, wp-cli',
|
||||
'behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, vapor-cli, wp-cli',
|
||||
[
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_composertool behat behat behat/ scoped',
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_composer_tool behat behat behat/ scoped',
|
||||
'add_blackfire',
|
||||
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player "-V"',
|
||||
'add_tool https://get.blackfire.io/blackfire-player-v1.22.0.phar blackfire-player "-V"',
|
||||
'add_tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
||||
'add_tool https://github.com/ergebnis/composer-normalize/releases/latest/download/composer-normalize.phar composer-normalize "-V"',
|
||||
'add_composertool composer-require-checker composer-require-checker maglnet/ scoped',
|
||||
'add_composertool composer-unused composer-unused icanhazstring/ scoped',
|
||||
'add_tool https://github.com/ergebnis/composer-normalize/releases/latest/download/composer-normalize.phar composer-normalize "diagnose"',
|
||||
'add_composer_tool composer-dependency-analyser composer-dependency-analyser shipmonk/ scoped',
|
||||
'add_composer_tool composer-require-checker composer-require-checker maglnet/ scoped',
|
||||
'add_tool https://github.com/composer-unused/composer-unused/releases/latest/download/composer-unused.phar composer-unused "-V"',
|
||||
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr "-V"',
|
||||
'add_composertool flex flex symfony/ global',
|
||||
'add_composer_tool flex flex symfony/ global',
|
||||
'add_grpc_php_plugin 1.2.3',
|
||||
'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection "-V"',
|
||||
'add_tool https://github.com/phan/phan/releases/latest/download/phan.phar phan "-v"',
|
||||
'add_tool https://github.com/phan/phan/releases/download/1.2.3/phan.phar phan "-v"',
|
||||
'add_tool https://www.phing.info/get/phing-1.2.3.phar phing "-v"',
|
||||
'add_composertool phinx phinx robmorgan/ scoped',
|
||||
'add_tool https://www.phing.info/get/phing-1.2.3.phar,https://github.com/phingofficial/phing/releases/download/1.2.3/phing-1.2.3.phar phing "-v"',
|
||||
'add_composer_tool phinx phinx robmorgan/ scoped',
|
||||
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive',
|
||||
'add_devtools php-config',
|
||||
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcbf.phar phpcbf "--version"',
|
||||
'add_tool https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/latest/download/phpcbf.phar phpcbf "--version"',
|
||||
'add_tool https://phar.phpunit.de/phpcpd.phar phpcpd "--version"',
|
||||
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs "--version"',
|
||||
'add_tool https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs "--version"',
|
||||
'add_tool https://github.com/phpDocumentor/phpDocumentor/releases/latest/download/phpDocumentor.phar phpDocumentor "--version"',
|
||||
'add_devtools phpize',
|
||||
'add_tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"',
|
||||
'add_tool https://github.com/phpspec/phpspec/releases/latest/download/phpspec.phar phpspec "-V"',
|
||||
'add_composertool phpunit-bridge phpunit-bridge:5.6.* symfony/ global',
|
||||
'add_composertool phpunit-polyfills phpunit-polyfills:1.0.1 yoast/ global',
|
||||
'add_composer_tool phpunit-bridge phpunit-bridge:5.6.* symfony/ global',
|
||||
'add_composer_tool phpunit-polyfills phpunit-polyfills:1.0.1 yoast/ global',
|
||||
'add_protoc 1.2.3',
|
||||
'add_tool https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm "-v"',
|
||||
'add_composer_tool rector rector rector/ scoped',
|
||||
'add_symfony latest',
|
||||
'add_composertool vapor-cli vapor-cli laravel/ scoped',
|
||||
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
|
||||
'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
|
||||
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
|
||||
'add_composer_tool easy-coding-standard easy-coding-standard symplify/ scoped'
|
||||
]
|
||||
]
|
||||
])('checking addTools on darwin', async (tools_csv, scripts) => {
|
||||
@ -443,20 +484,20 @@ describe('Tools tests', () => {
|
||||
[
|
||||
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, wp',
|
||||
[
|
||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'Add-Blackfire',
|
||||
'Add-Tool https://get.blackfire.io/blackfire-player-v1.2.3.phar blackfire-player "-V"',
|
||||
'blackfire-player is not a windows tool',
|
||||
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
||||
'Add-Tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-V"',
|
||||
'Add-Tool https://deployer.org/deployer.phar deployer "-V"',
|
||||
'Tool does_not_exist is not supported',
|
||||
'Add-Composertool flex flex symfony/ global',
|
||||
'Add-Composertool phinx phinx robmorgan/ scoped',
|
||||
'Add-ComposerTool flex flex symfony/ global',
|
||||
'Add-ComposerTool phinx phinx robmorgan/ scoped',
|
||||
'Add-Tool https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar phive "status"',
|
||||
'php-config is not a windows tool',
|
||||
'phpize is not a windows tool',
|
||||
'Add-Tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"',
|
||||
'Add-Composertool phpunit-bridge phpunit-bridge symfony/ global',
|
||||
'Add-ComposerTool phpunit-bridge phpunit-bridge symfony/ global',
|
||||
'Add-Symfony',
|
||||
'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
|
||||
]
|
||||
@ -472,14 +513,14 @@ describe('Tools tests', () => {
|
||||
[
|
||||
'composer:v1, codeception/codeception, prestissimo, hirak/prestissimo, composer-prefetcher, narrowspark/automatic-composer-prefetcher, phinx: 1.2, robmorgan/phinx: ^1.2, user/tool:1.2.3, user/tool:~1.2',
|
||||
[
|
||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer',
|
||||
'Add-Composertool codeception codeception codeception/ global',
|
||||
'Add-Composertool prestissimo prestissimo hirak/ global',
|
||||
'Add-Composertool automatic-composer-prefetcher automatic-composer-prefetcher narrowspark/ global',
|
||||
'Add-Composertool phinx phinx:1.2.* robmorgan/ scoped',
|
||||
'Add-Composertool phinx phinx:^1.2 robmorgan/ global',
|
||||
'Add-Composertool tool tool:1.2.3 user/ global',
|
||||
'Add-Composertool tool tool:~1.2 user/ global'
|
||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer',
|
||||
'Add-ComposerTool codeception codeception codeception/ global',
|
||||
'Add-ComposerTool prestissimo prestissimo hirak/ global',
|
||||
'Add-ComposerTool automatic-composer-prefetcher automatic-composer-prefetcher narrowspark/ global',
|
||||
'Add-ComposerTool phinx phinx:1.2.* robmorgan/ scoped',
|
||||
'Add-ComposerTool phinx phinx:^1.2 robmorgan/ global',
|
||||
'Add-ComposerTool tool tool:1.2.3 user/ global',
|
||||
'Add-ComposerTool tool tool:~1.2 user/ global'
|
||||
]
|
||||
]
|
||||
])(
|
||||
@ -492,13 +533,39 @@ describe('Tools tests', () => {
|
||||
}
|
||||
);
|
||||
|
||||
it.each`
|
||||
version | os | uri
|
||||
${'latest'} | ${'linux'} | ${'releases/latest/download/castor.linux-amd64.phar'}
|
||||
${'0.5.1'} | ${'linux'} | ${'releases/download/v0.5.1/castor.linux-amd64.phar'}
|
||||
${'latest'} | ${'darwin'} | ${'releases/latest/download/castor.darwin-amd64.phar'}
|
||||
${'0.5.1'} | ${'darwin'} | ${'releases/download/v0.5.1/castor.darwin-amd64.phar'}
|
||||
${'latest'} | ${'win32'} | ${'releases/latest/download/castor.windows-amd64.phar'}
|
||||
${'0.5.1'} | ${'win32'} | ${'releases/download/v0.5.1/castor.windows-amd64.phar castor -V'}
|
||||
${'latest'} | ${'openbsd'} | ${'Platform openbsd is not supported'}
|
||||
`('checking addCastor: $version, $os', async ({version, os, uri}) => {
|
||||
const data = getData({
|
||||
tool: 'castor',
|
||||
php_version: '8.1',
|
||||
version_prefix: 'v',
|
||||
version: version,
|
||||
os: os
|
||||
});
|
||||
if (os === 'win32' && version === '0.5.1') {
|
||||
fs.writeFileSync('castor.php', '');
|
||||
expect(await tools.addCastor(data)).toContain(uri);
|
||||
fs.unlinkSync('castor.php');
|
||||
} else {
|
||||
expect(await tools.addCastor(data)).toContain(uri);
|
||||
}
|
||||
});
|
||||
|
||||
it.each`
|
||||
tools_csv | script
|
||||
${'none'} | ${''}
|
||||
${'none, phpunit'} | ${'\nstep_log "Setup Tools"\nadd_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer latest\n\nadd_tool https://phar.phpunit.de/phpunit.phar phpunit "--version"'}
|
||||
${'composer:preview'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar,https://getcomposer.org/composer-preview.phar composer preview'}
|
||||
${'composer, composer:v1'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer'}
|
||||
${'composer:v1, composer:preview, composer:snapshot'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar,https://getcomposer.org/composer.phar composer snapshot'}
|
||||
${'none, phpunit'} | ${'\nstep_log "Setup Tools"\nadd_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer latest\n\nadd_tool https://phar.phpunit.de/phpunit-7.4.0.phar,https://phar.phpunit.de/phpunit-7.phar phpunit "--version"'}
|
||||
${'composer:preview'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-preview.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-preview.phar,https://getcomposer.org/composer-preview.phar composer preview'}
|
||||
${'composer, composer:v1'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-1.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer'}
|
||||
${'composer:v1, composer:preview, composer:snapshot'} | ${'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-snapshot.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-snapshot.phar,https://getcomposer.org/composer.phar composer snapshot'}
|
||||
`('checking composer setup: $tools_csv', async ({tools_csv, script}) => {
|
||||
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
|
||||
});
|
||||
@ -509,7 +576,35 @@ describe('Tools tests', () => {
|
||||
${'phpunit:1.2'} | ${'invalid_token'} | ${'add_log "$cross" "phpunit" "Invalid token"'}
|
||||
${'phpunit:0.1'} | ${'no_data'} | ${'add_log "$cross" "phpunit" "No version found with prefix 0.1."'}
|
||||
`('checking error: $tools_csv', async ({tools_csv, token, script}) => {
|
||||
process.env['COMPOSER_TOKEN'] = token;
|
||||
process.env['GITHUB_TOKEN'] = token;
|
||||
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
|
||||
});
|
||||
|
||||
it.each`
|
||||
tools_csv | token | script
|
||||
${'cs2pr:1.2'} | ${'invalid_token'} | ${'add_log "$cross" "cs2pr" "Invalid token"'}
|
||||
${'phpunit:1.2'} | ${'invalid_token'} | ${'add_log "$cross" "phpunit" "Invalid token"'}
|
||||
${'phpunit:0.1'} | ${'no_data'} | ${'add_log "$cross" "phpunit" "No version found with prefix 0.1."'}
|
||||
`('checking error: $tools_csv', async ({tools_csv, token, script}) => {
|
||||
process.env['GITHUB_TOKEN'] = token;
|
||||
expect(await tools.addTools(tools_csv, '7.4', 'linux')).toContain(script);
|
||||
});
|
||||
|
||||
it.each`
|
||||
tools_csv | php_version | resolved
|
||||
${'phpunit'} | ${'8.2'} | ${'/phpunit-8.2.0.phar'}
|
||||
${'phpunit'} | ${'8.1'} | ${'/phpunit-8.1.0.phar'}
|
||||
${'phpunit'} | ${'8.0'} | ${'/phpunit-8.0.0.phar'}
|
||||
${'phpunit'} | ${'7.3'} | ${'/phpunit-7.3.0.phar'}
|
||||
${'phpunit'} | ${'7.2'} | ${'/phpunit-7.2.0.phar'}
|
||||
${'phpunit'} | ${'7.1'} | ${'/phpunit-7.1.0.phar'}
|
||||
${'phpunit'} | ${'7.0'} | ${'/phpunit-7.0.0.phar'}
|
||||
`(
|
||||
'checking error: $tools_csv',
|
||||
async ({tools_csv, php_version, resolved}) => {
|
||||
expect(await tools.addTools(tools_csv, php_version, 'linux')).toContain(
|
||||
resolved
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -1,3 +1,4 @@
|
||||
import fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as utils from '../src/utils';
|
||||
|
||||
@ -7,7 +8,8 @@ import * as utils from '../src/utils';
|
||||
jest.mock('@actions/core', () => ({
|
||||
getInput: jest.fn().mockImplementation(key => {
|
||||
return ['setup-php'].indexOf(key) !== -1 ? key : '';
|
||||
})
|
||||
}),
|
||||
info: jest.fn()
|
||||
}));
|
||||
|
||||
/**
|
||||
@ -109,6 +111,9 @@ describe('Utils tests', () => {
|
||||
expect(
|
||||
await utils.CSVArray('a=E_ALL, b=E_ALL & ~ E_ALL, c="E_ALL", d=\'E_ALL\'')
|
||||
).toEqual(['a=E_ALL', 'b=E_ALL & ~ E_ALL', 'c=E_ALL', 'd=E_ALL']);
|
||||
expect(
|
||||
await utils.CSVArray('a="b=c;d=e", b=\'c=d,e\', c="g=h,i=j", d=g=h, a===')
|
||||
).toEqual(["a='b=c;d=e'", "b='c=d,e'", "c='g=h,i=j'", "d='g=h'", "a='=='"]);
|
||||
expect(await utils.CSVArray('')).toEqual([]);
|
||||
expect(await utils.CSVArray(' ')).toEqual([]);
|
||||
});
|
||||
@ -190,6 +195,7 @@ describe('Utils tests', () => {
|
||||
expect(await utils.getCommand('linux', 'tool')).toBe('add_tool ');
|
||||
expect(await utils.getCommand('darwin', 'tool')).toBe('add_tool ');
|
||||
expect(await utils.getCommand('win32', 'tool')).toBe('Add-Tool ');
|
||||
expect(await utils.getCommand('win32', 'tool_name')).toBe('Add-ToolName ');
|
||||
expect(await utils.getCommand('openbsd', 'tool')).toContain(
|
||||
'Platform openbsd is not supported'
|
||||
);
|
||||
@ -256,4 +262,62 @@ describe('Utils tests', () => {
|
||||
'\nadd_extension_from_source ext https://sub.domain.XN--tld org repo release extension'
|
||||
);
|
||||
});
|
||||
|
||||
it('checking readPHPVersion', async () => {
|
||||
expect(await utils.readPHPVersion()).toBe('latest');
|
||||
|
||||
process.env['php-version-file'] = '.phpenv-version';
|
||||
await expect(utils.readPHPVersion()).rejects.toThrow(
|
||||
"Could not find '.phpenv-version' file."
|
||||
);
|
||||
|
||||
const existsSync = jest.spyOn(fs, 'existsSync').mockImplementation();
|
||||
const readFileSync = jest.spyOn(fs, 'readFileSync').mockImplementation();
|
||||
|
||||
existsSync.mockReturnValue(true);
|
||||
readFileSync.mockReturnValue('8.1');
|
||||
|
||||
expect(await utils.readPHPVersion()).toBe('8.1');
|
||||
|
||||
process.env['php-version'] = '8.2';
|
||||
expect(await utils.readPHPVersion()).toBe('8.2');
|
||||
|
||||
delete process.env['php-version-file'];
|
||||
delete process.env['php-version'];
|
||||
|
||||
existsSync.mockReturnValue(true);
|
||||
readFileSync.mockReturnValue('ruby 1.2.3\nphp 8.4.2\nnode 20.1.2');
|
||||
expect(await utils.readPHPVersion()).toBe('8.4.2');
|
||||
|
||||
existsSync.mockReturnValue(true);
|
||||
readFileSync.mockReturnValue('setup-php');
|
||||
expect(await utils.readPHPVersion()).toBe('setup-php');
|
||||
|
||||
existsSync.mockReturnValueOnce(false).mockReturnValueOnce(true);
|
||||
readFileSync.mockReturnValue(
|
||||
'{ "platform-overrides": { "php": "7.3.25" } }'
|
||||
);
|
||||
expect(await utils.readPHPVersion()).toBe('7.3.25');
|
||||
|
||||
existsSync
|
||||
.mockReturnValueOnce(false)
|
||||
.mockReturnValueOnce(false)
|
||||
.mockReturnValueOnce(true);
|
||||
readFileSync.mockReturnValue(
|
||||
'{ "config": { "platform": { "php": "7.4.33" } } }'
|
||||
);
|
||||
expect(await utils.readPHPVersion()).toBe('7.4.33');
|
||||
|
||||
existsSync.mockClear();
|
||||
readFileSync.mockClear();
|
||||
});
|
||||
|
||||
it('checking setVariable', async () => {
|
||||
let script: string = await utils.setVariable('var', 'command', 'linux');
|
||||
expect(script).toEqual('\nvar="$(command)"\n');
|
||||
script = await utils.setVariable('var', 'command', 'darwin');
|
||||
expect(script).toEqual('\nvar="$(command)"\n');
|
||||
script = await utils.setVariable('var', 'command', 'win32');
|
||||
expect(script).toEqual('\n$var = command\n');
|
||||
});
|
||||
});
|
||||
|
10
action.yml
10
action.yml
@ -7,15 +7,17 @@ branding:
|
||||
inputs:
|
||||
php-version:
|
||||
description: 'Setup PHP version.'
|
||||
default: '8.1'
|
||||
required: true
|
||||
required: false
|
||||
php-version-file:
|
||||
description: 'Setup PHP version from a file.'
|
||||
required: false
|
||||
extensions:
|
||||
description: 'Setup PHP extensions.'
|
||||
required: false
|
||||
ini-file:
|
||||
description: 'Set base ini file.'
|
||||
default: 'production'
|
||||
required: false
|
||||
default: 'production'
|
||||
ini-values:
|
||||
description: 'Add values to php.ini.'
|
||||
required: false
|
||||
@ -29,5 +31,5 @@ outputs:
|
||||
php-version:
|
||||
description: 'PHP version in semver format'
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
|
4189
dist/index.js
vendored
4189
dist/index.js
vendored
File diff suppressed because one or more lines are too long
51
eslint.config.mjs
Normal file
51
eslint.config.mjs
Normal file
@ -0,0 +1,51 @@
|
||||
import {fixupConfigRules, fixupPluginRules} from '@eslint/compat';
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
||||
import jest from 'eslint-plugin-jest';
|
||||
import globals from 'globals';
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import tsParser from '@typescript-eslint/parser';
|
||||
import path from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import js from '@eslint/js';
|
||||
import {FlatCompat} from '@eslint/eslintrc';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
|
||||
export default [
|
||||
...fixupConfigRules(
|
||||
compat.extends(
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:import/errors',
|
||||
'plugin:import/warnings',
|
||||
'plugin:import/typescript',
|
||||
'plugin:prettier/recommended',
|
||||
'prettier'
|
||||
)
|
||||
),
|
||||
{
|
||||
plugins: {
|
||||
'@typescript-eslint': fixupPluginRules(typescriptEslint),
|
||||
jest
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.jest
|
||||
},
|
||||
|
||||
parser: tsParser,
|
||||
ecmaVersion: 2021,
|
||||
sourceType: 'module'
|
||||
}
|
||||
}
|
||||
];
|
@ -11,7 +11,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -21,9 +21,9 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/cache@v2
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -19,7 +19,7 @@ jobs:
|
||||
# blackfire-player supports PHP >= 5.5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
|
@ -19,7 +19,7 @@ jobs:
|
||||
# Blackfire supports PHP >= 5.3 on Ubuntu and macOS, and PHP >= 5.4 on Windows
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
|
@ -8,6 +8,8 @@ jobs:
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
@ -26,7 +28,7 @@ jobs:
|
||||
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -38,15 +40,17 @@ jobs:
|
||||
extensions: mbstring, intl, redis, pdo_mysql
|
||||
coverage: pcov
|
||||
|
||||
- name: Start mysql service
|
||||
run: sudo systemctl start mysql
|
||||
# Local MySQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start mysql service
|
||||
# run: sudo systemctl start mysql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
@ -71,7 +75,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -82,10 +86,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
@ -104,7 +108,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -116,10 +120,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -8,6 +8,8 @@ jobs:
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
@ -26,7 +28,7 @@ jobs:
|
||||
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -38,12 +40,17 @@ jobs:
|
||||
extensions: mbstring, intl, redis, pdo_pgsql
|
||||
coverage: pcov
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start postgresql service
|
||||
# run: sudo systemctl start postgresql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
@ -68,7 +75,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -79,10 +86,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
@ -101,8 +108,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
@ -112,10 +120,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -23,10 +23,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
@ -47,7 +47,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -57,10 +57,10 @@ jobs:
|
||||
extensions: mbstring, intl
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
@ -79,7 +79,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -91,10 +91,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -22,10 +22,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -21,10 +21,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -12,7 +12,9 @@ jobs:
|
||||
BROADCAST_DRIVER: log
|
||||
CACHE_DRIVER: redis
|
||||
QUEUE_CONNECTION: redis
|
||||
SESSION_DRIVER: redis
|
||||
SESSION_DRIVER: redis
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
@ -35,7 +37,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -45,15 +47,17 @@ jobs:
|
||||
extensions: mbstring, dom, fileinfo, mysql
|
||||
coverage: xdebug
|
||||
|
||||
- name: Start mysql service
|
||||
run: sudo systemctl start mysql
|
||||
# Local MySQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start mysql service
|
||||
# run: sudo systemctl start mysql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -15,6 +15,8 @@ jobs:
|
||||
DB_PASSWORD: postgres
|
||||
DB_USERNAME: postgres
|
||||
DB_DATABASE: postgres
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
@ -37,7 +39,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -47,12 +49,17 @@ jobs:
|
||||
extensions: mbstring, dom, fileinfo, pgsql
|
||||
coverage: xdebug
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start postgresql service
|
||||
# run: sudo systemctl start postgresql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -12,7 +12,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -24,10 +24,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -13,6 +13,8 @@ jobs:
|
||||
CACHE_DRIVER: redis
|
||||
QUEUE_CONNECTION: redis
|
||||
SESSION_DRIVER: redis
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
@ -35,7 +37,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -45,15 +47,17 @@ jobs:
|
||||
extensions: mbstring, dom, fileinfo, mysql
|
||||
coverage: xdebug
|
||||
|
||||
- name: Start mysql service
|
||||
run: sudo systemctl start mysql
|
||||
# Local MySQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start mysql service
|
||||
# run: sudo systemctl start mysql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -15,6 +15,8 @@ jobs:
|
||||
DB_PASSWORD: postgres
|
||||
DB_USERNAME: postgres
|
||||
DB_DATABASE: postgres
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
@ -37,7 +39,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -47,12 +49,17 @@ jobs:
|
||||
extensions: mbstring, dom, fileinfo, pgsql
|
||||
coverage: xdebug
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start postgresql service
|
||||
# run: sudo systemctl start postgresql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -12,7 +12,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -24,10 +24,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -16,6 +16,8 @@ jobs:
|
||||
DB_PASSWORD: password
|
||||
CODECEPTION_URL: 127.0.0.1
|
||||
CODECEPTION_PORT: 8888
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
@ -34,7 +36,7 @@ jobs:
|
||||
# php-versions: ['7.0', '7.1', '7.2', '7.3']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -45,15 +47,17 @@ jobs:
|
||||
extensions: mbstring, dom, zip, phalcon4, mysql
|
||||
coverage: xdebug
|
||||
|
||||
- name: Start mysql service
|
||||
run: sudo systemctl start mysql
|
||||
# Local MySQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start mysql service
|
||||
# run: sudo systemctl start mysql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -17,6 +17,8 @@ jobs:
|
||||
CODECEPTION_URL: 127.0.0.1
|
||||
CODECEPTION_PORT: 8888
|
||||
DB_CONNECTION: pgsql
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
@ -35,7 +37,7 @@ jobs:
|
||||
# php-versions: ['7.0', '7.1', '7.2', '7.3']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -46,11 +48,16 @@ jobs:
|
||||
extensions: mbstring, dom, zip, phalcon4, pgsql
|
||||
coverage: xdebug
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start postgresql service
|
||||
# run: sudo systemctl start postgresql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -9,10 +9,10 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
node-versions: [16']
|
||||
node-versions: ['16']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
@ -31,9 +31,9 @@ jobs:
|
||||
|
||||
- name: Get yarn cache
|
||||
id: yarn-cache
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/cache@v2
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.yarn-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
@ -41,10 +41,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -22,10 +22,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -5,6 +5,8 @@ jobs:
|
||||
symfony:
|
||||
name: Symfony (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
@ -21,7 +23,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -32,15 +34,17 @@ jobs:
|
||||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql
|
||||
coverage: xdebug
|
||||
|
||||
- name: Start mysql service
|
||||
run: sudo systemctl start mysql
|
||||
# Local MySQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start mysql service
|
||||
# run: sudo systemctl start mysql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -5,6 +5,8 @@ jobs:
|
||||
symfony:
|
||||
name: Symfony (PHP ${{ matrix.php-versions }})
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
@ -21,7 +23,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -32,12 +34,17 @@ jobs:
|
||||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql
|
||||
coverage: xdebug
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start postgresql service
|
||||
# run: sudo systemctl start postgresql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -12,7 +12,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Docs: https://github.com/shivammathur/setup-php
|
||||
- name: Setup PHP
|
||||
@ -25,10 +25,10 @@ jobs:
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -11,6 +11,8 @@ jobs:
|
||||
TEST_DB_USERNAME: root
|
||||
TEST_DB_PASSWORD: yii
|
||||
DB_CHARSET: utf8
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
@ -27,7 +29,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set Node.js 10.x
|
||||
uses: actions/setup-node@v1
|
||||
@ -42,15 +44,17 @@ jobs:
|
||||
extensions: mbstring, intl, gd, imagick, zip, dom, mysql
|
||||
coverage: xdebug
|
||||
|
||||
- name: Start mysql service
|
||||
run: sudo systemctl start mysql
|
||||
# Local MySQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start mysql service
|
||||
# run: sudo systemctl start mysql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
@ -11,6 +11,8 @@ jobs:
|
||||
TEST_DB_USERNAME: postgres
|
||||
TEST_DB_PASSWORD: postgres
|
||||
DB_CHARSET: utf8
|
||||
|
||||
# Docs: https://docs.github.com/en/actions/using-containerized-services
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
@ -27,7 +29,7 @@ jobs:
|
||||
php-versions: ['7.4', '8.0']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set Node.js 10.x
|
||||
uses: actions/setup-node@v1
|
||||
@ -42,12 +44,17 @@ jobs:
|
||||
extensions: mbstring, intl, gd, imagick, zip, dom, pgsql
|
||||
coverage: xdebug
|
||||
|
||||
# Local PostgreSQL service in GitHub hosted environments is disabled by default.
|
||||
# If you are using it instead of service containers, make sure you start it.
|
||||
# - name: Start postgresql service
|
||||
# run: sudo systemctl start postgresql.service
|
||||
|
||||
- name: Get composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache composer dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
# Use composer.json for key, if composer.lock is not committed.
|
||||
|
10415
package-lock.json
generated
10415
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
51
package.json
51
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-php",
|
||||
"version": "2.17.0",
|
||||
"version": "2.32.0",
|
||||
"private": false,
|
||||
"description": "Setup PHP for use with GitHub Actions",
|
||||
"main": "lib/install.js",
|
||||
@ -17,9 +17,9 @@
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"lint": "eslint **/src/*.ts **/__tests__/*.ts --cache --fix",
|
||||
"format": "prettier --write **/src/*.ts **/__tests__/*.ts && git add -f src/",
|
||||
"format": "prettier --write **/src/*.ts **/__tests__/*.ts && git add -f __tests__/ ",
|
||||
"format-check": "prettier --check **/src/*.ts **/__tests__/*.ts",
|
||||
"release": "ncc build -o dist && git add -f dist/",
|
||||
"release": "ncc build -m -o dist && git add -f dist/",
|
||||
"test": "jest"
|
||||
},
|
||||
"repository": {
|
||||
@ -34,29 +34,32 @@
|
||||
"author": "shivammathur",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/io": "^1.1.1",
|
||||
"fs": "0.0.1-security"
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"compare-versions": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^17.0.16",
|
||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
||||
"@typescript-eslint/parser": "^5.11.0",
|
||||
"@vercel/ncc": "^0.33.1",
|
||||
"eslint": "^8.8.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"eslint-plugin-jest": "^26.1.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"jest-circus": "^27.5.1",
|
||||
"nock": "^13.2.4",
|
||||
"prettier": "^2.5.1",
|
||||
"simple-git-hooks": "^2.7.0",
|
||||
"ts-jest": "^27.1.3",
|
||||
"typescript": "^4.5.5"
|
||||
"@eslint/compat": "^1.2.7",
|
||||
"@eslint/js": "9.22.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^22.13.10",
|
||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||
"@typescript-eslint/parser": "^8.26.1",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"eslint": "9.22.0",
|
||||
"eslint-config-prettier": "^10.1.1",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-jest": "^28.11.0",
|
||||
"eslint-plugin-prettier": "^5.2.3",
|
||||
"globals": "^16.0.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"nock": "^14.0.1",
|
||||
"prettier": "^3.5.3",
|
||||
"simple-git-hooks": "^2.11.1",
|
||||
"ts-jest": "^29.2.6",
|
||||
"typescript": "^5.8.2"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||
|
@ -1,29 +1,43 @@
|
||||
amqp=amqp
|
||||
apcu=apcu
|
||||
ast=ast
|
||||
couchbase=couchbase
|
||||
ds=ds
|
||||
event=event
|
||||
expect=expect
|
||||
gearman=gearman
|
||||
gnupg=gnupg
|
||||
grpc=grpc
|
||||
igbinary=igbinary
|
||||
imagick=imagick
|
||||
imap=imap
|
||||
lua=lua
|
||||
mailparse=mailparse
|
||||
mcrypt=mcrypt
|
||||
memcache=memcache
|
||||
memcached=memcached
|
||||
mongodb=mongodb
|
||||
msgpack=msgpack
|
||||
pcov=pcov
|
||||
pdo_sqlsrv=pdo_sqlsrv
|
||||
pecl_http=http
|
||||
phalcon3=phalcon
|
||||
phalcon4=phalcon
|
||||
phalcon5=phalcon
|
||||
propro=propro
|
||||
protobuf=protobuf
|
||||
psr=psr
|
||||
raphf=raphf
|
||||
rdkafka=rdkafka
|
||||
redis=redis
|
||||
snmp=snmp
|
||||
sqlsrv=sqlsrv
|
||||
ssh2=ssh2
|
||||
swoole=swoole
|
||||
uuid=uuid
|
||||
v8js=v8js
|
||||
vips=vips
|
||||
vld=vld
|
||||
xdebug=xdebug
|
||||
xdebug2=xdebug
|
||||
xlswriter=xlswriter
|
||||
|
@ -1,2 +1,3 @@
|
||||
COMPOSER_PROCESS_TIMEOUT=0
|
||||
COMPOSER_NO_INTERACTION=1
|
||||
COMPOSER_NO_AUDIT=1
|
||||
|
31
src/configs/mod_priority
Normal file
31
src/configs/mod_priority
Normal file
@ -0,0 +1,31 @@
|
||||
apc=25
|
||||
apcu_bc=25
|
||||
apcu-bc=25
|
||||
blackfire=30
|
||||
couchbase=30
|
||||
decimal=30
|
||||
ds=30
|
||||
event=30
|
||||
ev=30
|
||||
grpc=30
|
||||
http=25
|
||||
pecl_http=25
|
||||
pecl-http=25
|
||||
inotify=30
|
||||
libvirt-php=40
|
||||
mailparse=25
|
||||
maxminddb=30
|
||||
memcached=25
|
||||
mysqlnd=10
|
||||
mysqlnd_ms=30
|
||||
opcache=10
|
||||
openswoole=25
|
||||
pdo=10
|
||||
phalcon=35
|
||||
protobuf=30
|
||||
psr=15
|
||||
rdkafka=30
|
||||
swoole=25
|
||||
vips=30
|
||||
xml=15
|
||||
zstd=30
|
@ -17,3 +17,6 @@
|
||||
21.04,hirsute
|
||||
21.10,impish
|
||||
22.04,jammy
|
||||
23.04,lunar
|
||||
23.10,mantic
|
||||
24.04,noble
|
||||
|
|
@ -1,7 +1,9 @@
|
||||
{
|
||||
"latest": "8.1",
|
||||
"nightly": "8.2",
|
||||
"lowest": "8.1",
|
||||
"highest": "8.4",
|
||||
"latest": "8.4",
|
||||
"nightly": "8.5",
|
||||
"5.x": "5.6",
|
||||
"7.x": "7.4",
|
||||
"8.x": "8.1"
|
||||
}
|
||||
"8.x": "8.4"
|
||||
}
|
||||
|
11
src/configs/php_debug_packages
Normal file
11
src/configs/php_debug_packages
Normal file
@ -0,0 +1,11 @@
|
||||
cgi
|
||||
cli
|
||||
curl
|
||||
fpm
|
||||
intl
|
||||
mbstring
|
||||
mysql
|
||||
opcache
|
||||
pgsql
|
||||
xml
|
||||
zip
|
@ -1,4 +1,13 @@
|
||||
{
|
||||
"box": {
|
||||
"type": "phar",
|
||||
"repository": "box-project/box",
|
||||
"packagist": "humbug/box",
|
||||
"extension": ".phar",
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": "",
|
||||
"version_parameter": "--version"
|
||||
},
|
||||
"churn": {
|
||||
"type": "phar",
|
||||
"repository": "bmitch/churn-php",
|
||||
@ -7,13 +16,26 @@
|
||||
"version_prefix": "",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"composer-dependency-analyser": {
|
||||
"type": "composer",
|
||||
"repository": "shipmonk/composer-dependency-analyser",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"composer-unused": {
|
||||
"type": "phar",
|
||||
"repository": "composer-unused/composer-unused",
|
||||
"extension": ".phar",
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": "",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"composer-normalize": {
|
||||
"type": "phar",
|
||||
"repository": "ergebnis/composer-normalize",
|
||||
"extension": ".phar",
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": "",
|
||||
"version_parameter": "-V"
|
||||
"version_parameter": "diagnose"
|
||||
},
|
||||
"cs2pr": {
|
||||
"type": "phar",
|
||||
@ -49,16 +71,25 @@
|
||||
},
|
||||
"php-cs-fixer": {
|
||||
"type": "phar",
|
||||
"repository": "FriendsOfPHP/PHP-CS-Fixer",
|
||||
"repository": "PHP-CS-Fixer/PHP-CS-Fixer",
|
||||
"extension": ".phar",
|
||||
"domain": "https://github.com",
|
||||
"fetch_latest": "true",
|
||||
"version_prefix": "v",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"php-scoper": {
|
||||
"type": "phar",
|
||||
"repository": "humbug/php-scoper",
|
||||
"packagist": "humbug/php-scoper",
|
||||
"extension": ".phar",
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": "",
|
||||
"version_parameter": "--version"
|
||||
},
|
||||
"phpcbf": {
|
||||
"type": "phar",
|
||||
"repository": "squizlabs/PHP_CodeSniffer",
|
||||
"repository": "PHPCSStandards/PHP_CodeSniffer",
|
||||
"extension": ".phar",
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": "",
|
||||
@ -66,7 +97,7 @@
|
||||
},
|
||||
"phpcs": {
|
||||
"type": "phar",
|
||||
"repository": "squizlabs/PHP_CodeSniffer",
|
||||
"repository": "PHPCSStandards/PHP_CodeSniffer",
|
||||
"extension": ".phar",
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": "",
|
||||
@ -105,6 +136,14 @@
|
||||
"version_prefix": "",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"pint": {
|
||||
"type": "phar",
|
||||
"repository": "laravel/pint",
|
||||
"extension": ".phar",
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": "v",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"psalm": {
|
||||
"type": "phar",
|
||||
"repository": "vimeo/psalm",
|
||||
@ -134,11 +173,6 @@
|
||||
"repository": "maglnet/composer-require-checker",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"composer-unused": {
|
||||
"type": "composer",
|
||||
"repository": "icanhazstring/composer-unused",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"flex": {
|
||||
"type": "composer",
|
||||
"repository": "symfony/flex",
|
||||
@ -176,6 +210,11 @@
|
||||
"repository": "laravel/vapor-cli",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"rector": {
|
||||
"type": "composer",
|
||||
"repository": "rector/rector",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"blackfire": {
|
||||
"type": "custom-package",
|
||||
"alias": "blackfire-agent"
|
||||
@ -206,6 +245,14 @@
|
||||
"version_prefix": "v",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"castor": {
|
||||
"type": "custom-function",
|
||||
"domain": "https://github.com",
|
||||
"repository": "jolicode/castor",
|
||||
"function": "castor",
|
||||
"version_prefix": "v",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"composer": {
|
||||
"type": "custom-function",
|
||||
"domain": "https://getcomposer.org",
|
||||
@ -252,6 +299,7 @@
|
||||
"phpunit": {
|
||||
"type": "custom-function",
|
||||
"repository": "sebastianbergmann/phpunit",
|
||||
"packagist": "phpunit/phpunit",
|
||||
"domain": "https://phar.phpunit.de",
|
||||
"function": "phpunit",
|
||||
"version_prefix": "",
|
||||
@ -275,5 +323,11 @@
|
||||
"extension": ".phar",
|
||||
"version_parameter": "--version",
|
||||
"version_prefix": "v"
|
||||
},
|
||||
"easy-coding-standard": {
|
||||
"type": "composer",
|
||||
"alias": "ecs",
|
||||
"repository": "symplify/easy-coding-standard",
|
||||
"scope": "scoped"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
"fetch_latest": "true",
|
||||
"function": "function_name",
|
||||
"repository": "user/tool",
|
||||
"packagist": "user/tool",
|
||||
"scope": "global, scoped",
|
||||
"type": "phar, composer, custom-package or custom-function",
|
||||
"version_parameter": "--version",
|
||||
@ -77,6 +78,15 @@
|
||||
"user/tool"
|
||||
]
|
||||
},
|
||||
"packagist": {
|
||||
"$id": "#/items/properties/packagist",
|
||||
"type": "string",
|
||||
"title": "The repository schema",
|
||||
"description": "Packagist repository of the tool in case different from repository.",
|
||||
"examples": [
|
||||
"user/tool"
|
||||
]
|
||||
},
|
||||
"scope": {
|
||||
"$id": "#/items/properties/scope",
|
||||
"type": "string",
|
||||
|
2
src/configs/windows_extensions
Normal file
2
src/configs/windows_extensions
Normal file
@ -0,0 +1,2 @@
|
||||
xdebug
|
||||
pcov
|
@ -16,7 +16,7 @@ export async function checkXdebugError(
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to setup Xdebug
|
||||
* Function to set up Xdebug
|
||||
*
|
||||
* @param extension
|
||||
* @param version
|
||||
@ -30,23 +30,29 @@ export async function addCoverageXdebug(
|
||||
pipe: string
|
||||
): Promise<string> {
|
||||
let script = '\n';
|
||||
let message: string = await checkXdebugError(extension, version);
|
||||
let status = '$cross';
|
||||
if (!message) {
|
||||
const error: string = await checkXdebugError(extension, version);
|
||||
if (!error) {
|
||||
script +=
|
||||
(await extensions.addExtension(':pcov:false', version, os, true)) + pipe;
|
||||
extension = extension == 'xdebug3' ? 'xdebug' : extension;
|
||||
script +=
|
||||
(await extensions.addExtension(extension, version, os, true)) + pipe;
|
||||
message = 'Xdebug enabled as coverage driver';
|
||||
status = '$tick';
|
||||
script += await utils.setVariable(
|
||||
'xdebug_version',
|
||||
'php -r "echo phpversion(\'xdebug\');"',
|
||||
os
|
||||
);
|
||||
script +=
|
||||
(await utils.getCommand(os, 'extension_log')) +
|
||||
'xdebug "Xdebug $xdebug_version enabled as coverage driver"';
|
||||
} else {
|
||||
script += await utils.addLog('$cross', extension, error, os);
|
||||
}
|
||||
script += await utils.addLog(status, extension, message, os);
|
||||
return script;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to setup PCOV
|
||||
* Function to set up PCOV
|
||||
*
|
||||
* @param version
|
||||
* @param os
|
||||
@ -66,15 +72,14 @@ export async function addCoveragePCOV(
|
||||
script +=
|
||||
(await extensions.addExtension('pcov', version, os, true)) + pipe;
|
||||
script += (await config.addINIValues('pcov.enabled=1', os, true)) + '\n';
|
||||
|
||||
// success
|
||||
script += await utils.addLog(
|
||||
'$tick',
|
||||
'coverage: pcov',
|
||||
'PCOV enabled as coverage driver',
|
||||
script += await utils.setVariable(
|
||||
'pcov_version',
|
||||
'php -r "echo phpversion(\'pcov\');"',
|
||||
os
|
||||
);
|
||||
// version is not supported
|
||||
script +=
|
||||
(await utils.getCommand(os, 'extension_log')) +
|
||||
'pcov "PCOV $pcov_version enabled as coverage driver"';
|
||||
break;
|
||||
|
||||
case /5\.[3-6]|7\.0/.test(version):
|
||||
|
@ -31,20 +31,28 @@ export async function addExtensionDarwin(
|
||||
case /.+-.+\/.+@.+/.test(extension):
|
||||
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
||||
return;
|
||||
// match 5.3blackfire...8.1blackfire
|
||||
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
||||
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
||||
// match 5.3ioncube...7.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
// match 7.4relay...8.5relay
|
||||
// match 5.3blackfire...8.4blackfire
|
||||
// match 5.3blackfire-(semver)...8.4blackfire-(semver)
|
||||
// match couchbase, event, geos, pdo_oci, oci8, http, pecl_http
|
||||
// match 5.3ioncube...8.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
|
||||
// match 7.0zephir_parser...8.4zephir_parser
|
||||
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^couchbase$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
extension
|
||||
):
|
||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
|
||||
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4|(7\.4|8\.[0-4])phalcon5?/.test(
|
||||
version_extension
|
||||
):
|
||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||
case /^(7\.[0-4]|8\.[0-4])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
add_script += await utils.customPackage(
|
||||
ext_name,
|
||||
'extensions',
|
||||
@ -62,7 +70,7 @@ export async function addExtensionDarwin(
|
||||
);
|
||||
return;
|
||||
// match semver
|
||||
case /.+-\d+\.\d+\.\d+.*/.test(extension):
|
||||
case /.+-\d+(\.\d+\.\d+.*)?/.test(extension):
|
||||
add_script += await utils.joins(
|
||||
'\nadd_pecl_extension',
|
||||
ext_name,
|
||||
@ -74,16 +82,14 @@ export async function addExtensionDarwin(
|
||||
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
|
||||
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
|
||||
return;
|
||||
// match 5.6 and newer - amqp, apcu, expect, gnupg, grpc, igbinary, imagick, imap, memcache, memcached, mongodb, msgpack, protobuf, raphf, rdkafka, redis, ssh2, swoole, xdebug, xdebug2, yaml, zmq
|
||||
// match 7.1 and newer - pcov
|
||||
// match 5.6 to 7.4 - propro
|
||||
// match 7.0 and newer - vips, xlswriter
|
||||
case /(?<!5\.[3-5])(amqp|apcu|expect|gnupg|grpc|igbinary|imagick|imap|mailparse|memcache|memcached|mongodb|msgpack|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(
|
||||
// match brew extensions
|
||||
case /(?<!5\.[3-5])(amqp|apcu|expect|gnupg|grpc|igbinary|imagick|imap|mailparse|mcrypt|memcache|memcached|mongodb|msgpack|protobuf|psr|raphf|rdkafka|redis|snmp|ssh2|swoole|uuid|vld|xdebug|xdebug2|yaml|zmq)/.test(
|
||||
version_extension
|
||||
):
|
||||
case /(5\.6|7\.[0-4])propro/.test(version_extension):
|
||||
case /(?<!5\.[3-6])(ds|v8js)/.test(version_extension):
|
||||
case /(5\.6|7\.[0-4])(propro|lua)/.test(version_extension):
|
||||
case /(?<!5\.[3-6]|7\.0)pcov/.test(version_extension):
|
||||
case /(?<!5\.[3-6])(vips|xlswriter)/.test(version_extension):
|
||||
case /(?<!5\.[3-6])(ast|vips|xlswriter)/.test(version_extension):
|
||||
add_script += await utils.joins(
|
||||
'\nadd_brew_extension',
|
||||
ext_name,
|
||||
@ -128,19 +134,26 @@ export async function addExtensionWindows(
|
||||
case /^none$/.test(ext_name):
|
||||
add_script += '\nDisable-AllShared';
|
||||
break;
|
||||
// match 5.3blackfire...8.0blackfire
|
||||
// match 5.3blackfire-(semver)...8.0blackfire-(semver)
|
||||
// match 5.3blackfire...8.4blackfire
|
||||
// match 5.3blackfire-(semver)...8.4blackfire-(semver)
|
||||
// match pdo_oci and oci8
|
||||
// match 5.3ioncube...7.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||
// match 7.1pecl_http...8.0pecl_http and 7.1http...8.0http
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.0)blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
// match 5.3ioncube...8.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
|
||||
// match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
|
||||
// match 7.0zephir_parser...8.4zephir_parser
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
|
||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||
case /^(7\.[1-4]|8\.0)(pecl_)?http/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^(7\.[1-4]|8\.1)(pecl_)?http/.test(version_extension):
|
||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||
case /^(7\.[0-4]|8\.[0-4])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
add_script += await utils.customPackage(
|
||||
ext_name,
|
||||
'extensions',
|
||||
@ -164,15 +177,6 @@ export async function addExtensionWindows(
|
||||
'win32'
|
||||
);
|
||||
break;
|
||||
// match semver without state
|
||||
case /.+-\d+\.\d+\.\d+$/.test(extension):
|
||||
add_script += await utils.joins(
|
||||
'\nAdd-Extension',
|
||||
ext_name,
|
||||
'stable',
|
||||
ext_version
|
||||
);
|
||||
break;
|
||||
// match semver with state
|
||||
case /.+-\d+\.\d+\.\d+[a-zA-Z]+\d*/.test(extension):
|
||||
matches = /.+-(\d+\.\d+\.\d+)([a-zA-Z]+)\d*/.exec(
|
||||
@ -185,6 +189,15 @@ export async function addExtensionWindows(
|
||||
matches[1]
|
||||
);
|
||||
break;
|
||||
// match semver without state
|
||||
case /.+-\d+(\.\d+\.\d+.*)?/.test(extension):
|
||||
add_script += await utils.joins(
|
||||
'\nAdd-Extension',
|
||||
ext_name,
|
||||
'stable',
|
||||
ext_version
|
||||
);
|
||||
break;
|
||||
// match 7.2xdebug2 to 7.4xdebug2
|
||||
case /7\.[2-4]xdebug2/.test(version_extension):
|
||||
add_script += '\nAdd-Extension xdebug stable 2.9.8';
|
||||
@ -250,25 +263,33 @@ export async function addExtensionLinux(
|
||||
case /.+-.+\/.+@.+/.test(extension):
|
||||
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
||||
return;
|
||||
// match 5.3blackfire...8.1blackfire
|
||||
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
||||
// match 7.4relay...8.5relay
|
||||
// match 5.3blackfire...8.4blackfire
|
||||
// match 5.3blackfire-(semver)...8.4blackfire-(semver)
|
||||
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
||||
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
||||
// match 5.3ioncube...7.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
// match 5.3ioncube...8.4ioncube
|
||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5
|
||||
// match 7.0zephir_parser...8.4zephir_parser
|
||||
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /^couchbase$|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||
extension
|
||||
):
|
||||
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||
case /(?<!5\.[3-5])intl-\d+\.\d+$/.test(version_extension):
|
||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test(
|
||||
version_extension
|
||||
):
|
||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||
case /^(7\.[0-4]|8\.[0-4])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||
version_extension
|
||||
):
|
||||
add_script += await utils.customPackage(
|
||||
ext_name,
|
||||
'extensions',
|
||||
@ -286,7 +307,7 @@ export async function addExtensionLinux(
|
||||
);
|
||||
return;
|
||||
// match semver versions
|
||||
case /.+-\d+\.\d+\.\d+.*/.test(extension):
|
||||
case /.+-\d+(\.\d+\.\d+.*)?/.test(extension):
|
||||
add_script += await utils.joins(
|
||||
'\nadd_pecl_extension',
|
||||
ext_name,
|
||||
|
@ -3,10 +3,11 @@ import * as https from 'https';
|
||||
import * as url from 'url';
|
||||
|
||||
/**
|
||||
* Function to fetch an URL
|
||||
* Function to fetch a URL
|
||||
*
|
||||
* @param input_url
|
||||
* @param auth_token
|
||||
* @param redirect_count
|
||||
*/
|
||||
export async function fetch(
|
||||
input_url: string,
|
||||
@ -25,7 +26,8 @@ export async function fetch(
|
||||
const options: https.RequestOptions = {
|
||||
hostname: url_object.hostname,
|
||||
path: url_object.pathname,
|
||||
headers: headers
|
||||
headers: headers,
|
||||
agent: new https.Agent({keepAlive: false})
|
||||
};
|
||||
const req = https.get(options, (res: IncomingMessage) => {
|
||||
if (res.statusCode === 200) {
|
||||
|
@ -24,7 +24,7 @@ export async function getScript(os: string): Promise<string> {
|
||||
const coverage_driver: string = await utils.getInput('coverage', false);
|
||||
const tools_csv: string = await utils.getInput('tools', false);
|
||||
const version: string = await utils.parseVersion(
|
||||
await utils.getInput('php-version', true)
|
||||
await utils.readPHPVersion()
|
||||
);
|
||||
const ini_file: string = await utils.parseIniFile(
|
||||
await utils.getInput('ini-file', false)
|
||||
|
37
src/packagist.ts
Normal file
37
src/packagist.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import * as cv from 'compare-versions';
|
||||
import * as fetch from './fetch';
|
||||
|
||||
type RS = Record<string, string>;
|
||||
type RSRS = Record<string, RS>;
|
||||
|
||||
export async function search(
|
||||
package_name: string,
|
||||
php_version: string
|
||||
): Promise<string | null> {
|
||||
const response = await fetch.fetch(
|
||||
`https://repo.packagist.org/p2/${package_name}.json`
|
||||
);
|
||||
if (response.error || response.data === '[]') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const data = JSON.parse(response['data']);
|
||||
if (data && data.packages) {
|
||||
const versions = data.packages[package_name];
|
||||
versions.sort((a: RS, b: RS) => cv.compareVersions(b.version, a.version));
|
||||
|
||||
const result = versions.find((versionData: RSRS) => {
|
||||
if (versionData?.require?.php) {
|
||||
return versionData?.require?.php
|
||||
.split('|')
|
||||
.some(
|
||||
require => require && cv.satisfies(php_version + '.0', require)
|
||||
);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
return result ? result.version : null;
|
||||
}
|
||||
return null;
|
||||
}
|
@ -1,22 +1,23 @@
|
||||
# Function to setup environment for self-hosted runners.
|
||||
self_hosted_helper() {
|
||||
if ! command -v brew >/dev/null; then
|
||||
step_log "Setup Brew"
|
||||
get -q -e "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" && /tmp/install.sh >/dev/null 2>&1
|
||||
add_log "${tick:?}" "Brew" "Installed Homebrew"
|
||||
fi
|
||||
}
|
||||
|
||||
# Disable dependency extensions
|
||||
disable_dependency_extensions() {
|
||||
local extension=$1
|
||||
formula_file="$tap_dir/$ext_tap/Formula/$extension@${version:?}.rb"
|
||||
# Handle dependency extensions
|
||||
handle_dependency_extensions() {
|
||||
local formula=$1
|
||||
local extension=$2
|
||||
formula_file="${tap_dir:?}/$ext_tap/Formula/$extension@${version:?}.rb"
|
||||
[ -e "$formula_file" ] || formula_file="$tap_dir/$ext_tap/Formula/$formula@$version.rb"
|
||||
if [ -e "$formula_file" ]; then
|
||||
IFS=" " read -r -a dependency_extensions <<< "$(grep -Eo "shivammathur.*@" "$formula_file" | xargs -I {} -n 1 basename '{}' | cut -d '@' -f 1 | tr '\n' ' ')"
|
||||
for dependency_extension in "${dependency_extensions[@]}"; do
|
||||
sudo sed -Ei '' "/=(.*\/)?\"?$dependency_extension(.so)?$/d" "${ini_file:?}"
|
||||
done
|
||||
fi
|
||||
suffix="$(get_php_formula_suffix)"
|
||||
if [[ -n "$suffix" ]]; then
|
||||
brew_opts=(-sf)
|
||||
patch_abstract_file >/dev/null 2>&1
|
||||
for dependency_extension in "${dependency_extensions[@]}"; do
|
||||
brew install "${brew_opts[@]}" "$ext_tap/$dependency_extension@$version" >/dev/null 2>&1 && copy_brew_extensions "$dependency_extension"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to disable an extension.
|
||||
@ -28,35 +29,32 @@ disable_extension_helper() {
|
||||
disable_extension_dependents "$extension"
|
||||
fi
|
||||
sudo sed -Ei '' "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file:?}"
|
||||
sudo rm -rf "$scan_dir"/*"$extension"*
|
||||
sudo rm -rf "$scan_dir"/*"$extension"* /tmp/php"$version"_extensions
|
||||
mkdir -p /tmp/extdisabled/"$version"
|
||||
echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Function to fetch a brew tap.
|
||||
fetch_brew_tap() {
|
||||
tap=$1
|
||||
tap_user=$(dirname "$tap")
|
||||
tap_name=$(basename "$tap")
|
||||
mkdir -p "$tap_dir/$tap_user"
|
||||
get -s -n "" "https://github.com/$tap/archive/master.tar.gz" | sudo tar -xzf - -C "$tap_dir/$tap_user"
|
||||
if [ -d "$tap_dir/$tap_user/$tap_name-master" ]; then
|
||||
sudo mv "$tap_dir/$tap_user/$tap_name-master" "$tap_dir/$tap_user/$tap_name"
|
||||
fi
|
||||
# Function to get extension name from brew formula.
|
||||
get_extension_from_formula() {
|
||||
local formula=$1
|
||||
local extension
|
||||
extension=$(grep -E "^$formula=" "$src"/configs/brew_extensions | cut -d '=' -f 2)
|
||||
[[ -z "$extension" ]] && extension="$(echo "$formula" | sed -E "s/pecl_|[0-9]//g")"
|
||||
echo "$extension"
|
||||
}
|
||||
|
||||
# Function to add a brew tap.
|
||||
add_brew_tap() {
|
||||
tap=$1
|
||||
if ! [ -d "$tap_dir/$tap" ]; then
|
||||
if [ "${runner:?}" = "self-hosted" ]; then
|
||||
brew tap "$tap" >/dev/null 2>&1
|
||||
else
|
||||
fetch_brew_tap "$tap" >/dev/null 2>&1
|
||||
if ! [ -d "$tap_dir/$tap" ]; then
|
||||
brew tap "$tap" >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
# Function to copy extension binaries to the extension directory.
|
||||
copy_brew_extensions() {
|
||||
local formula=$1
|
||||
formula_file="$tap_dir/$ext_tap/Formula/$formula@$version.rb"
|
||||
deps="$(grep -Eo 'depends_on "shivammathur[^"]+' "$formula_file" | cut -d '/' -f 3 | tr '\n' ' ')"
|
||||
IFS=' ' read -r -a deps <<< "$formula@$version $deps"
|
||||
for dependency in "${deps[@]}"; do
|
||||
extension_file="${brew_prefix:?}/opt/$dependency/$(get_extension_from_formula "${dependency%@*}").so"
|
||||
[ -e "$extension_file" ] && sudo cp "$extension_file" "$ext_dir"
|
||||
done
|
||||
if [ -d "$brew_prefix"/Cellar/"$formula"@"$version" ]; then
|
||||
sudo find -- "$brew_prefix"/Cellar/"$formula"@"$version" -name "*.dylib" -exec cp {} "$ext_dir" \;
|
||||
fi
|
||||
}
|
||||
|
||||
@ -64,23 +62,30 @@ add_brew_tap() {
|
||||
add_brew_extension() {
|
||||
formula=$1
|
||||
prefix=$2
|
||||
extension=$(grep "$formula=" "$src"/configs/brew_extensions | cut -d '=' -f 2)
|
||||
[[ -z "$extension" ]] && extension="$(echo "$formula" | sed -E "s/pecl_|[0-9]//g")"
|
||||
extension="$(get_extension_from_formula "$formula")"
|
||||
enable_extension "$extension" "$prefix"
|
||||
if check_extension "$extension"; then
|
||||
add_log "${tick:?}" "$extension" "Enabled"
|
||||
else
|
||||
add_brew_tap "$php_tap"
|
||||
add_brew_tap "$ext_tap"
|
||||
sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "$core_repo/Formula/" 2>/dev/null || true
|
||||
sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "${core_repo:?}/Formula/" 2>/dev/null || true
|
||||
update_dependencies >/dev/null 2>&1
|
||||
disable_dependency_extensions "$extension" >/dev/null 2>&1
|
||||
brew install -f "$formula@$version" >/dev/null 2>&1
|
||||
sudo cp "$brew_prefix/opt/$formula@$version/$extension.so" "$ext_dir"
|
||||
handle_dependency_extensions "$formula" "$extension" >/dev/null 2>&1
|
||||
(brew install "${brew_opts[@]}" "$ext_tap/$formula@$version" >/dev/null 2>&1 && copy_brew_extensions "$formula") || pecl_install "$extension" >/dev/null 2>&1
|
||||
add_extension_log "$extension" "Installed and enabled"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to patch the abstract file in the extensions tap.
|
||||
patch_abstract_file() {
|
||||
abstract_path="$tap_dir"/"$ext_tap"/Abstract/abstract-php-extension.rb
|
||||
if [[ -e "$abstract_path" && ! -e /tmp/abstract_patch ]]; then
|
||||
echo '' | sudo tee /tmp/abstract_patch >/dev/null 2>&1
|
||||
sudo sed -i '' -e "s|php@#{\(.*\)}|php@#{\1}$suffix|g" -e "s|php_version /|\"#{php_version}$suffix\" /|g" "$abstract_path"
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to add an extension.
|
||||
add_extension_helper() {
|
||||
local extension=$1
|
||||
@ -108,65 +113,42 @@ add_pecl() {
|
||||
add_log "${tick:?}" "PECL" "Found PECL $pear_version"
|
||||
}
|
||||
|
||||
# Function to link all libraries of a formula.
|
||||
link_libraries() {
|
||||
formula=$1
|
||||
formula_prefix="$(brew --prefix "$formula")"
|
||||
sudo mkdir -p "$formula_prefix"/lib
|
||||
for lib in "$formula_prefix"/lib/*.dylib; do
|
||||
lib_name=$(basename "$lib")
|
||||
sudo cp -a "$lib" "$brew_prefix/lib/$lib_name" 2>/dev/null || true
|
||||
done
|
||||
# Link opcache extension to extensions directory.
|
||||
link_opcache() {
|
||||
opcache_ini="$brew_prefix"/etc/php/"$version"/conf.d/ext-opcache.ini
|
||||
if [ -e "$opcache_ini" ]; then
|
||||
opcache_ext=$(grep -Eo "zend_extension.*opcache.*\.so" "$opcache_ini" | cut -d '"' -f 2)
|
||||
sudo ln -sf "$opcache_ext" "$ext_dir"
|
||||
fi
|
||||
}
|
||||
|
||||
# Patch brew to overwrite packages.
|
||||
patch_brew() {
|
||||
formula_installer="$brew_repo"/Library/Homebrew/formula_installer.rb
|
||||
code=" keg.link(verbose: verbose?"
|
||||
sudo sed -i '' "s/$code)/$code, overwrite: true)/" "$formula_installer"
|
||||
formula_installer="${brew_repo:?}"/Library/Homebrew/formula_installer.rb
|
||||
code=" keg.link\(verbose: verbose\?"
|
||||
sudo sed -Ei '' "s/$code.*/$code, overwrite: true\)/" "$formula_installer"
|
||||
# shellcheck disable=SC2064
|
||||
trap "sudo sed -i '' 's/$code, overwrite: true)/$code)/' $formula_installer" exit
|
||||
}
|
||||
|
||||
# Helper function to update the dependencies.
|
||||
update_dependencies_helper() {
|
||||
dependency=$1
|
||||
get -q -n "$core_repo/Formula/$dependency.rb" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$dependency.rb"
|
||||
link_libraries "$dependency"
|
||||
trap "sudo sed -Ei '' 's/$code.*/$code, overwrite: overwrite?\)/' $formula_installer" exit
|
||||
}
|
||||
|
||||
# Function to update dependencies.
|
||||
update_dependencies() {
|
||||
patch_brew
|
||||
if ! [ -e /tmp/update_dependencies ]; then
|
||||
if [ "${runner:?}" != "self-hosted" ] && [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
|
||||
patch_brew
|
||||
while read -r dependency; do
|
||||
update_dependencies_helper "$dependency" &
|
||||
to_wait+=($!)
|
||||
done <"$tap_dir/$php_tap/.github/deps/${ImageOS:?}_${ImageVersion:?}"
|
||||
wait "${to_wait[@]}"
|
||||
else
|
||||
git -C "$core_repo" fetch origin master && git -C "$core_repo" reset --hard origin/master
|
||||
fi
|
||||
for repo in "$brew_repo" "$core_repo"; do
|
||||
git_retry -C "$repo" fetch origin master && git -C "$repo" reset --hard origin/master
|
||||
done
|
||||
echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to fix dependencies on install PHP version.
|
||||
fix_dependencies() {
|
||||
broken_deps_paths=$(php -v 2>&1 | grep -Eo '/opt/[a-zA-Z0-9@\.]+')
|
||||
if [ "x$broken_deps_paths" != "x" ]; then
|
||||
update_dependencies
|
||||
IFS=" " read -r -a formulae <<< "$(echo "$broken_deps_paths" | tr '\n' ' ' | sed 's|/opt/||g' 2>&1)$php_formula"
|
||||
brew reinstall "${formulae[@]}"
|
||||
brew link --force --overwrite "$php_formula" || true
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to get PHP version if it is already installed using Homebrew.
|
||||
get_brewed_php() {
|
||||
php_cellar="$brew_prefix"/Cellar/php
|
||||
if [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
|
||||
cellar="$brew_prefix"/Cellar
|
||||
php_cellar="$cellar"/php
|
||||
if [ -d "$cellar" ] && ! [[ "$(find "$cellar" -maxdepth 1 -name "php@$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
|
||||
php_semver | cut -c 1-3
|
||||
elif [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
|
||||
php_semver | cut -c 1-3
|
||||
else
|
||||
echo 'false';
|
||||
@ -179,14 +161,25 @@ add_php() {
|
||||
existing_version=$2
|
||||
add_brew_tap "$php_tap"
|
||||
update_dependencies
|
||||
if [ "$existing_version" != "false" ]; then
|
||||
([ "$action" = "upgrade" ] && brew upgrade -f "$php_formula") || brew unlink "$php_formula"
|
||||
suffix="$(get_php_formula_suffix)"
|
||||
php_formula="shivammathur/php/php@$version$suffix"
|
||||
if [[ "$existing_version" != "false" && -z "$suffix" ]]; then
|
||||
([ "$action" = "upgrade" ] && brew upgrade -f --overwrite "$php_formula") || brew unlink "$php_formula"
|
||||
else
|
||||
brew install -f "$php_formula"
|
||||
brew install -f --overwrite "$php_formula"
|
||||
fi
|
||||
sudo chown -R "$(id -un)":"$(id -gn)" "$brew_prefix"
|
||||
brew link --force --overwrite "$php_formula"
|
||||
}
|
||||
|
||||
# Function to get formula suffix
|
||||
get_php_formula_suffix() {
|
||||
local suffix
|
||||
[ "${debug:?}" = "debug" ] && suffix="-debug"
|
||||
[ "${ts:?}" = "zts" ] && suffix="$suffix-zts"
|
||||
echo "$suffix"
|
||||
}
|
||||
|
||||
# Function to get extra version.
|
||||
php_extra_version() {
|
||||
php_formula_file="$tap_dir"/"$php_tap"/Formula/php@"$version".rb
|
||||
@ -220,6 +213,8 @@ get_scan_dir() {
|
||||
setup_php() {
|
||||
step_log "Setup PHP"
|
||||
php_config="$(command -v php-config 2>/dev/null)"
|
||||
update=true
|
||||
check_pre_installed
|
||||
existing_version=$(get_brewed_php)
|
||||
if [[ "$version" =~ ${old_versions:?} ]]; then
|
||||
run_script "php5-darwin" "${version/./}" >/dev/null 2>&1
|
||||
@ -227,15 +222,16 @@ setup_php() {
|
||||
elif [ "$existing_version" != "$version" ]; then
|
||||
add_php "install" "$existing_version" >/dev/null 2>&1
|
||||
status="Installed"
|
||||
elif [ "$existing_version" = "$version" ] && [ "${update:?}" = "true" ]; then
|
||||
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
||||
status="Updated to"
|
||||
else
|
||||
status="Found"
|
||||
fix_dependencies >/dev/null 2>&1
|
||||
elif [ "$existing_version" = "$version" ]; then
|
||||
if [ "${update:?}" = "true" ]; then
|
||||
add_php "upgrade" "$existing_version" >/dev/null 2>&1
|
||||
status="Updated to"
|
||||
else
|
||||
status="Found"
|
||||
fi
|
||||
fi
|
||||
php_config="$(command -v php-config)"
|
||||
ext_dir="$(grep 'extension_dir=' "$php_config" | cut -d "'" -f 2)"
|
||||
ext_dir="$(sed -n "s/.*extension_dir=['\"]\(.*\)['\"].*/\1/p" "$php_config")"
|
||||
ini_dir="$(php_ini_path)"
|
||||
scan_dir="$(get_scan_dir)"
|
||||
ini_file="$ini_dir"/php.ini
|
||||
@ -244,6 +240,7 @@ setup_php() {
|
||||
semver="$(php_semver)"
|
||||
extra_version="$(php_extra_version)"
|
||||
configure_php
|
||||
link_opcache
|
||||
set_output "php-version" "$semver"
|
||||
if [ "${semver%.*}" != "$version" ]; then
|
||||
add_log "${cross:?}" "PHP" "Could not setup PHP $version"
|
||||
@ -255,31 +252,28 @@ setup_php() {
|
||||
}
|
||||
|
||||
# Variables
|
||||
version=${1:-'8.1'}
|
||||
version=${1:-'8.4'}
|
||||
ini=${2:-'production'}
|
||||
src=${0%/*}/..
|
||||
php_formula=shivammathur/php/php@"$version"
|
||||
brew_path="$(command -v brew)"
|
||||
brew_path_dir="$(dirname "$brew_path")"
|
||||
brew_prefix="$brew_path_dir"/..
|
||||
brew_repo="$brew_path_dir/$(dirname "$(readlink "$brew_path")")"/..
|
||||
tap_dir="$brew_repo"/Library/Taps
|
||||
core_repo="$tap_dir"/homebrew/homebrew-core
|
||||
scripts="$src"/scripts
|
||||
ext_tap=shivammathur/homebrew-extensions
|
||||
php_tap=shivammathur/homebrew-php
|
||||
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
||||
export HOMEBREW_DEVELOPER=1
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
export HOMEBREW_NO_INSTALL_FROM_API=1
|
||||
|
||||
# shellcheck source=.
|
||||
. "${scripts:?}"/unix.sh
|
||||
. "${scripts:?}"/tools/brew.sh
|
||||
. "${scripts:?}"/tools/retry.sh
|
||||
. "${scripts:?}"/tools/add_tools.sh
|
||||
. "${scripts:?}"/extensions/source.sh
|
||||
. "${scripts:?}"/extensions/add_extensions.sh
|
||||
configure_brew
|
||||
read_env
|
||||
self_hosted_setup
|
||||
setup_php
|
||||
|
@ -1,3 +1,32 @@
|
||||
# Function to check if extension is enabled.
|
||||
Function Test-Extension() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
$extension_info = Get-PhpExtension -Path $php_dir | Where-Object { $_.Name -eq $extension -or $_.Handle -eq $extension }
|
||||
return $null -ne $extension_info
|
||||
}
|
||||
|
||||
# Function to add extension log.
|
||||
Function Add-ExtensionLog() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
$extension,
|
||||
[Parameter(Position = 1, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
$message
|
||||
)
|
||||
if (Test-Extension $extension) {
|
||||
Add-Log $tick $extension $message
|
||||
} else {
|
||||
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
|
||||
}
|
||||
}
|
||||
|
||||
# Function to link dependencies to PHP directory.
|
||||
Function Set-ExtensionPrerequisites
|
||||
{
|
||||
@ -6,8 +35,9 @@ Function Set-ExtensionPrerequisites
|
||||
[ValidateNotNull()]
|
||||
[ValidateLength(1, [int]::MaxValue)]
|
||||
[string]
|
||||
$deps_dir
|
||||
$extension
|
||||
)
|
||||
$deps_dir = "$ext_dir\$extension-vc$($installed.VCVersion)-$arch"
|
||||
$deps = Get-ChildItem -Recurse -Path $deps_dir
|
||||
if ($deps.Count -ne 0) {
|
||||
# Symlink dependencies instead of adding the directory to PATH ...
|
||||
@ -20,6 +50,41 @@ Function Set-ExtensionPrerequisites
|
||||
}
|
||||
}
|
||||
|
||||
# Function to enable extension.
|
||||
Function Enable-Extension() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[ValidateLength(1, [int]::MaxValue)]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
Enable-ExtensionDependencies $extension
|
||||
Enable-PhpExtension -Extension $extension -Path $php_dir
|
||||
Set-ExtensionPrerequisites $extension
|
||||
Add-Log $tick $extension "Enabled"
|
||||
}
|
||||
|
||||
# Function to add custom built PHP extension for nightly builds.
|
||||
Function Add-ExtensionFromGithub {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[ValidateLength(1, [int]::MaxValue)]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
if($ts) { $ts_part = 'ts' } else { $ts_part = 'nts' }
|
||||
$repo = "$github/shivammathur/php-extensions-windows"
|
||||
$url = "$repo/releases/download/builds/php$version`_$ts_part`_$arch`_$extension.dll"
|
||||
Get-File -Url $url -OutFile "$ext_dir\php_$extension.dll"
|
||||
if(Test-Path "$ext_dir\php_$extension.dll") {
|
||||
Enable-Extension $extension > $null
|
||||
} else {
|
||||
throw "Failed to download the $extension"
|
||||
}
|
||||
}
|
||||
|
||||
# Function to add PHP extensions.
|
||||
Function Add-Extension {
|
||||
Param (
|
||||
@ -35,7 +100,7 @@ Function Add-Extension {
|
||||
$stability = 'stable',
|
||||
[Parameter(Position = 2, Mandatory = $false)]
|
||||
[ValidateNotNull()]
|
||||
[ValidatePattern('^\d+(\.\d+){0,2}$')]
|
||||
[ValidatePattern('^\d+(\.\d+){0,3}$')]
|
||||
[string]
|
||||
$extension_version = ''
|
||||
)
|
||||
@ -52,31 +117,36 @@ Function Add-Extension {
|
||||
Add-Log $tick $extension "Enabled"
|
||||
}
|
||||
default {
|
||||
Enable-ExtensionDependencies $extension
|
||||
Enable-PhpExtension -Extension $extension_info.Handle -Path $php_dir
|
||||
Set-ExtensionPrerequisites $deps_dir
|
||||
Add-Log $tick $extension "Enabled"
|
||||
Enable-Extension $extension_info.Handle
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Patch till PHP 8.1 DLLs are released as stable.
|
||||
$minimumStability = $stability
|
||||
if($version -eq '8.1' -and $stability -eq 'stable') {
|
||||
$minimumStability = 'snapshot'
|
||||
}
|
||||
if(($version -match $nightly_versions) -and (Select-String -Path $src\configs\windows_extensions -Pattern $extension -SimpleMatch -Quiet)) {
|
||||
Add-ExtensionFromGithub $extension
|
||||
} else {
|
||||
# Patch till DLLs for PHP 8.1 and above are released as stable.
|
||||
$minimumStability = $stability
|
||||
if ($version -match '8.[1-4]' -and $stability -eq 'stable') {
|
||||
$minimumStability = 'snapshot'
|
||||
}
|
||||
|
||||
$params = @{ Extension = $extension; MinimumStability = $minimumStability; MaximumStability = $stability; Path = $php_dir; AdditionalFilesPath = $deps_dir; NoDependencies = $true }
|
||||
if($extension_version -ne '') {
|
||||
$params["Version"] = $extension_version
|
||||
$params = @{ Extension = $extension; MinimumStability = $minimumStability; MaximumStability = $stability; Path = $php_dir; AdditionalFilesPath = $deps_dir; NoDependencies = $true }
|
||||
if ($extension_version -ne '')
|
||||
{
|
||||
$params["Version"] = $extension_version
|
||||
}
|
||||
# If extension for a different version exists
|
||||
if(Test-Path $ext_dir\php_$extension.dll) {
|
||||
Move-Item $ext_dir\php_$extension.dll $ext_dir\php_$extension.bak.dll -Force
|
||||
}
|
||||
Install-PhpExtension @params
|
||||
Set-ExtensionPrerequisites $extension
|
||||
}
|
||||
Install-PhpExtension @params
|
||||
Set-ExtensionPrerequisites $deps_dir
|
||||
Add-Log $tick $extension "Installed and enabled"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Add-Log $cross $extension "Could not install $extension on PHP $($installed.FullVersion)"
|
||||
} catch {
|
||||
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,4 +261,4 @@ Function Disable-AllShared() {
|
||||
# Function to handle request to add PECL.
|
||||
Function Add-Pecl() {
|
||||
Add-Log $tick "PECL" "Use extensions input to setup PECL extensions on windows"
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,14 @@ add_extension_log() {
|
||||
# Function to test if extension is loaded.
|
||||
check_extension() {
|
||||
local extension=$1
|
||||
local extension_list=/tmp/php${version:?}_extensions
|
||||
if [ ! -e "$extension_list" ]; then
|
||||
php -m > "$extension_list"
|
||||
fi
|
||||
if [ "$extension" != "mysql" ]; then
|
||||
php -m | grep -i -q -w "$extension"
|
||||
grep -i -q -w "$extension" "$extension_list" || php -m | grep -i -q -w "$extension"
|
||||
else
|
||||
php -m | grep -i -q "$extension"
|
||||
grep -i -q "$extension" "$extension_list" || php -m | grep -i -q "$extension"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -26,7 +30,8 @@ enable_cache_extension_dependencies() {
|
||||
cache_dir=$(find /tmp/extcache -maxdepth 1 -type d -regex ".*$1[0-9]*")
|
||||
if [[ -n "$cache_dir" ]]; then
|
||||
IFS=" " read -r -a deps <<<"$(find "$cache_dir" -maxdepth 1 -type f -name "*" -exec basename {} \; | tr '\n' ' ')"
|
||||
if [[ -n "${deps[*]}" ]] && php "${deps[@]/#/-d ${2}=}" -d "${2}=$1" -m 2>/dev/null | grep -i -q "$1"; then
|
||||
IFS="#" read -r -a deps_enable <<<"$(printf -- "-d ${2}=%s.so#" "${deps[@]}")"
|
||||
if [[ -n "${deps[*]}" ]] && php "${deps_enable[@]}" -d "${2}=$1.so" -m 2>/dev/null | grep -i -q "$1"; then
|
||||
for ext in "${deps[@]}"; do
|
||||
sudo rm -rf /tmp/extcache/"$ext"
|
||||
enable_extension "$ext" "$2"
|
||||
@ -38,12 +43,24 @@ enable_cache_extension_dependencies() {
|
||||
|
||||
# Function to enable existing extensions.
|
||||
enable_extension() {
|
||||
modules_dir="/var/lib/php/modules/${version:?}"
|
||||
[ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete
|
||||
enable_extension_dependencies "$1" "$2"
|
||||
enable_cache_extension_dependencies "$1" "$2"
|
||||
if ! check_extension "$1" && shared_extension "$1"; then
|
||||
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
|
||||
modules_dir="/var/lib/php/modules/${version:?}"
|
||||
[ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete
|
||||
enable_extension_dependencies "$1" "$2"
|
||||
enable_cache_extension_dependencies "$1" "$2"
|
||||
if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod >/dev/null 2>&1; then
|
||||
sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?\"?$/d" "$pecl_file"
|
||||
mod="${ini_dir:?}"/../mods-available/"$1".ini
|
||||
if ! [ -e "$mod" ]; then
|
||||
priority="${3:-20}";
|
||||
mod_priority_line="$(grep -E "^$1=" "${src:?}/configs/mod_priority")";
|
||||
[ -n "$mod_priority_line" ] && priority=$(echo "$mod_priority_line" | cut -d'=' -f 2)
|
||||
(echo "; priority=$priority"; echo "$2=${ext_dir:?}/$1.so") | sudo tee "$mod" >/dev/null
|
||||
fi
|
||||
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
|
||||
else
|
||||
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@ -60,7 +77,7 @@ enable_extensions() {
|
||||
|
||||
# Function to get a map of extensions and their dependent shared extensions.
|
||||
get_extension_map() {
|
||||
php -d'error_reporting=0' "${src:?}"/scripts/extensions/extension_map.php /tmp/map"$version".orig
|
||||
php -d'error_reporting=0' "${src:?}"/scripts/extensions/extension_map.php /tmp/map"$version".orig >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Function to enable extension dependencies which are also extensions.
|
||||
@ -108,15 +125,16 @@ disable_all_shared() {
|
||||
sudo sed -i.orig -E -e "/^(zend_)?extension\s*=/d" "${ini_file[@]}" "$pecl_file" 2>/dev/null || true
|
||||
sudo find "${ini_dir:-$scan_dir}"/.. -name "*.ini" -not -path "*php.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true
|
||||
mkdir -p /tmp/extdisabled/"$version"
|
||||
sudo find "$ext_dir" -name '*.so' -print0 | xargs -0 -n 1 basename -s .so | xargs -n 1 -I{} touch /tmp/extdisabled/"$version"/{}
|
||||
sudo rm -f /tmp/php"$version"_extensions
|
||||
sudo find "$ext_dir" -name '*.so' -print0 | xargs -0 -n 1 basename -s .so | xargs -I{} touch /tmp/extdisabled/"$version"/{}
|
||||
add_log "${tick:?}" "none" "Disabled all shared extensions"
|
||||
}
|
||||
|
||||
# Function to configure PECL.
|
||||
configure_pecl() {
|
||||
[ -z "${pecl_file:-${ini_file[@]}}" ] && return
|
||||
if ! [ -e /tmp/pecl_config ]; then
|
||||
for script in pear pecl; do
|
||||
sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}"
|
||||
sudo "$script" channel-update "$script".php.net
|
||||
done
|
||||
echo '' | sudo tee /tmp/pecl_config >/dev/null 2>&1
|
||||
@ -138,21 +156,50 @@ add_extension() {
|
||||
# Function to get the PECL version of an extension.
|
||||
get_pecl_version() {
|
||||
local extension=$1
|
||||
stability="$(echo "$2" | grep -m 1 -Eio "(stable|alpha|beta|rc|snapshot|preview)")"
|
||||
states=("stable" "rc" "preview" "beta" "alpha" "snapshot")
|
||||
stability="$(echo "$2" | grep -m 1 -Eio "($(IFS='|' ; echo "${states[*]}"))")"
|
||||
IFS=' ' read -r -a states <<< "$(echo "${states[@]}" | grep -Eo "$stability.*")"
|
||||
major_version=${3:-'[0-9]+'}
|
||||
pecl_rest='https://pecl.php.net/rest/r/'
|
||||
response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml)
|
||||
pecl_version=$(echo "$response" | grep -m 1 -Eio "([0-9]+\.[0-9]+\.[0-9]+${stability}[0-9]+)")
|
||||
if [ ! "$pecl_version" ]; then
|
||||
pecl_version=$(echo "$response" | grep -m 1 -Eo "([0-9]+\.[0-9]+\.[0-9]+)")
|
||||
fi
|
||||
for state in "${states[@]}"; do
|
||||
pecl_version=$(echo "$response" | grep -m 1 -Eio "($major_version\.[0-9]+\.[0-9]+${state}[0-9]+<)" | cut -d '<' -f 1)
|
||||
[ -z "$pecl_version" ] && pecl_version=$(echo "$response" | grep -m 1 -Eio "v>(.*)<\/v>.*$state<" | grep -m 1 -Eo "($major_version\.[0-9]+\.[0-9]+.*)<" | cut -d '<' -f 1)
|
||||
[ -n "$pecl_version" ] && break;
|
||||
done
|
||||
[ -z "$pecl_version" ] && pecl_version=$(echo "$response" | grep -m 1 -Eo "($major_version\.[0-9]+\.[0-9]+)<" | cut -d '<' -f 1)
|
||||
echo "$pecl_version"
|
||||
}
|
||||
|
||||
# Function to install PECL extensions and accept default options
|
||||
pecl_install() {
|
||||
local extension=$1
|
||||
local prefix=${2:-extension}
|
||||
add_pecl >/dev/null 2>&1
|
||||
yes '' 2>/dev/null | sudo pecl install -f "$extension" >/dev/null 2>&1
|
||||
disable_extension_helper "${extension%-*}" >/dev/null 2>&1
|
||||
# Compare version with 8.3 so it runs only on 8.4 and above
|
||||
# Install using the source interface as it allows for patching.
|
||||
if [[ $(printf "%s\n%s" "${version:?}" "8.3" | sort -V | head -n1) != "$version" ]]; then
|
||||
extension_version=${extension##*-};
|
||||
[ "$extension_version" = "${extension%-*}" ] && extension_version=$(get_pecl_version "$extension" "stable")
|
||||
add_extension_from_source "${extension%-*}" https://pecl.php.net "${extension%-*}" "${extension%-*}" "$extension_version" "$prefix" pecl
|
||||
check_extension "${extension%-*}" && return 0 || return 1;
|
||||
else
|
||||
cpu_count="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo '1')"
|
||||
prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS) MAKEFLAGS='-j $cpu_count'"
|
||||
suffix_opts="$(parse_args "$extension" CONFIGURE_OPTS) $(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)"
|
||||
IFS=' ' read -r -a libraries <<<"$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)"
|
||||
(( ${#libraries[@]} )) && add_libs "${libraries[@]}" >/dev/null 2>&1
|
||||
if [ "$version" = "5.3" ]; then
|
||||
yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f "$extension" >/dev/null 2>&1
|
||||
else
|
||||
yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" >/dev/null 2>&1
|
||||
fi
|
||||
local exit_code=$?
|
||||
sudo pecl info "$extension" | grep -iq 'zend extension' && prefix=zend_extension
|
||||
enable_extension "${extension%-*}" "$prefix"
|
||||
return "$exit_code"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to install a specific version of PECL extension.
|
||||
@ -165,12 +212,14 @@ add_pecl_extension() {
|
||||
pecl_version=$(get_pecl_version "$extension" "$pecl_version")
|
||||
fi
|
||||
ext_version=$(php -r "echo phpversion('$extension');")
|
||||
if [ "${ext_version/-/}" = "$pecl_version" ]; then
|
||||
if check_extension "$extension" && [[ -z "$pecl_version" || (-n "$pecl_version" && "${ext_version/-/}" == "$pecl_version") ]]; then
|
||||
add_log "${tick:?}" "$extension" "Enabled"
|
||||
else
|
||||
disable_extension_helper "$extension" >/dev/null 2>&1
|
||||
pecl_install "$extension-$pecl_version"
|
||||
add_extension_log "$extension-$pecl_version" "Installed and enabled"
|
||||
[ -n "$pecl_version" ] && pecl_version="-$pecl_version"
|
||||
pecl_install "$extension$pecl_version" || add_extension "$extension" "$(get_extension_prefix "$extension")" >/dev/null 2>&1
|
||||
extension_version="$(php -r "echo phpversion('$extension');")"
|
||||
[ -n "$extension_version" ] && extension_version="-$extension_version"
|
||||
add_extension_log "$extension$extension_version" "Installed and enabled"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -182,3 +231,8 @@ add_unstable_extension() {
|
||||
pecl_version=$(get_pecl_version "$extension" "$stability")
|
||||
add_pecl_extension "$extension" "$pecl_version" "$prefix"
|
||||
}
|
||||
|
||||
# Function to get extension prefix
|
||||
get_extension_prefix() {
|
||||
echo "$1" | grep -Eq "xdebug([2-3])?$|opcache|ioncube|eaccelerator" && echo zend_extension || echo extension
|
||||
}
|
||||
|
@ -21,7 +21,9 @@ Function Add-Blackfire() {
|
||||
$status="Enabled"
|
||||
} else {
|
||||
$nts = if (!$installed.ThreadSafe) { "_nts" } else { "" }
|
||||
Invoke-WebRequest -Uri "https://packages.blackfire.io/binaries/blackfire-php/${extension_version}/blackfire-php-windows_${arch}-php-${no_dot_version}${nts}.dll" -OutFile $ext_dir\blackfire.dll > $null 2>&1
|
||||
Get-File -Url "https://packages.blackfire.io/binaries/blackfire-php/${extension_version}/blackfire-php-windows_${arch}-php-${no_dot_version}${nts}.dll" -OutFile $ext_dir\blackfire.dll > $null 2>&1
|
||||
Disable-Extension xdebug > $null 2>&1
|
||||
Disable-Extension pcov > $null 2>&1
|
||||
Enable-PhpExtension -Extension blackfire -Path $php_dir
|
||||
$status="Installed and enabled"
|
||||
}
|
||||
|
@ -8,6 +8,10 @@ add_blackfire() {
|
||||
status='Enabled'
|
||||
if ! shared_extension blackfire; then
|
||||
status='Installed and enabled'
|
||||
arch="$(uname -m)"
|
||||
arch_name="amd64"
|
||||
[[ "$arch" = "aarch64" || "$arch" = "arm64" ]] && arch_name="arm64"
|
||||
[ "${ts:?}" = 'zts' ] && no_dot_version="${no_dot_version}-zts"
|
||||
if [ "$extension_version" = "blackfire" ]; then
|
||||
if [[ ${version:?} =~ 5.[3-6] ]]; then
|
||||
extension_version='1.50.0'
|
||||
@ -15,8 +19,14 @@ add_blackfire() {
|
||||
extension_version=$(get -s -n "" https://blackfire.io/api/v1/releases | grep -Eo 'php":"([0-9]+.[0-9]+.[0-9]+)' | cut -d '"' -f 3)
|
||||
fi
|
||||
fi
|
||||
get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_amd64-php-"$no_dot_version".so >/dev/null 2>&1
|
||||
get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_"$arch_name"-php-"$no_dot_version".so >/dev/null 2>&1
|
||||
fi
|
||||
if [ -e "${ext_dir:?}/blackfire.so" ]; then
|
||||
disable_extension xdebug >/dev/null 2>&1
|
||||
disable_extension pcov >/dev/null 2>&1
|
||||
enable_extension blackfire extension
|
||||
add_extension_log blackfire "$status"
|
||||
else
|
||||
add_extension_log blackfire "Could not install blackfire on PHP ${semver:?}"
|
||||
fi
|
||||
enable_extension blackfire extension
|
||||
add_extension_log blackfire "$status"
|
||||
}
|
||||
|
@ -1,43 +1,87 @@
|
||||
# Function to install libraries required by couchbase
|
||||
add_couchbase_libs() {
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
trunk="https://github.com/couchbase/libcouchbase/releases"
|
||||
if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then
|
||||
release="2.10.9"
|
||||
else
|
||||
release="$(curl -sL $trunk/latest | grep -Eo "libcouchbase-[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -d'-' -f 2)"
|
||||
fi
|
||||
deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu${VERSION_ID/./}_${VERSION_CODENAME}_amd64.tar"
|
||||
get -q -n /tmp/libcouchbase.tar "$deb_url"
|
||||
sudo tar -xf /tmp/libcouchbase.tar -C /tmp
|
||||
install_packages libev4 libevent-dev
|
||||
sudo dpkg -i /tmp/libcouchbase-*/*.deb
|
||||
add_couchbase_clibs() {
|
||||
ext=$1
|
||||
trunk="https://github.com/couchbase/libcouchbase/releases"
|
||||
if [[ "$ext" =~ couchbase-2.+ ]]; then
|
||||
release="2.10.9"
|
||||
else
|
||||
if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then
|
||||
brew install libcouchbase@2
|
||||
brew link --overwrite --force libcouchbase@2
|
||||
else
|
||||
brew install libcouchbase
|
||||
fi
|
||||
release=$(get -s -n "" "$trunk"/latest | grep -Eo -m 1 "[0-9]+\.[0-9]+\.[0-9]+" | head -n 1)
|
||||
fi
|
||||
[ "$VERSION_ID" = "24.04" ] && vid=22.04 || vid="$VERSION_ID"
|
||||
[ "$VERSION_CODENAME" = "noble" ] && vcn=jammy || vcn="$VERSION_CODENAME"
|
||||
deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu${vid/./}_${vcn}_amd64.tar"
|
||||
get -q -n /tmp/libcouchbase.tar "$deb_url"
|
||||
if ! [ -e /tmp/libcouchbase.tar ] || ! file /tmp/libcouchbase.tar | grep -q 'tar archive'; then
|
||||
deb_url="$trunk/download/$release/libcouchbase-${release}_ubuntu2004_focal_amd64.tar"
|
||||
get -q -n /tmp/libcouchbase.tar "$deb_url"
|
||||
add_old_libssl
|
||||
fi
|
||||
sudo tar -xf /tmp/libcouchbase.tar -C /tmp
|
||||
install_packages libev4 libevent-dev
|
||||
sudo dpkg -i /tmp/libcouchbase-*/*.deb
|
||||
}
|
||||
|
||||
add_old_libssl() {
|
||||
if [[ "$VERSION_ID" = "24.04" ]]; then
|
||||
get -q -n /tmp/libssl.deb http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
|
||||
[ -e /tmp/libssl.deb ] && sudo dpkg -i /tmp/libssl.deb || add_extension_log "couchbase" "Could not install libssl1.1"
|
||||
fi
|
||||
}
|
||||
|
||||
add_couchbase_cxxlibs() {
|
||||
if [ "${runner:?}" = "self-hosted" ]; then
|
||||
add_list cmake https://apt.kitware.com/ubuntu/ https://apt.kitware.com/keys/kitware-archive-latest.asc "$VERSION_CODENAME" main
|
||||
fi
|
||||
install_packages cmake ccache
|
||||
}
|
||||
|
||||
get_couchbase_version() {
|
||||
if [[ "${version:?}" =~ ${old_versions:?} ]]; then
|
||||
echo couchbase-2.2.3
|
||||
elif [[ "${version:?}" =~ 5.6|7.[0-1] ]]; then
|
||||
echo couchbase-2.6.2
|
||||
elif [ "${version:?}" = '7.2' ]; then
|
||||
echo couchbase-3.0.4
|
||||
elif [ "${version:?}" = '7.3' ]; then
|
||||
echo couchbase-3.2.2
|
||||
elif [ "${version:?}" = '7.4' ]; then
|
||||
echo couchbase-4.1.1
|
||||
else
|
||||
echo couchbase
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to add couchbase.
|
||||
add_couchbase() {
|
||||
add_couchbase_libs >/dev/null 2>&1
|
||||
enable_extension "couchbase" "extension"
|
||||
if check_extension "couchbase"; then
|
||||
add_log "${tick:?}" "couchbase" "Enabled"
|
||||
else
|
||||
if [[ "${version:?}" =~ ${old_versions:?} ]]; then
|
||||
pecl_install couchbase-2.2.3 >/dev/null 2>&1
|
||||
elif [[ "${version:?}" =~ 5.6|7.[0-1] ]]; then
|
||||
pecl_install couchbase-2.6.2 >/dev/null 2>&1
|
||||
elif [[ "${version:?}" =~ 7.2 ]]; then
|
||||
pecl_install couchbase-3.0.4 >/dev/null 2>&1
|
||||
else
|
||||
pecl_install couchbase >/dev/null 2>&1
|
||||
ext=$1
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
if [ "$ext" = "couchbase" ]; then
|
||||
ext=$(get_couchbase_version)
|
||||
fi
|
||||
add_extension_log "couchbase" "Installed and enabled"
|
||||
if [[ "$ext" =~ couchbase-[2-3].+ ]]; then
|
||||
add_couchbase_clibs "$ext" >/dev/null 2>&1
|
||||
else
|
||||
add_couchbase_cxxlibs >/dev/null 2>&1
|
||||
fi
|
||||
enable_extension "couchbase" "extension"
|
||||
if check_extension "couchbase"; then
|
||||
add_log "${tick:?}" "couchbase" "Enabled"
|
||||
else
|
||||
if [ "$ext" = "couchbase" ]; then
|
||||
ext="couchbase-$(get_pecl_version "couchbase" "stable")"
|
||||
n_proc="$(nproc)"
|
||||
export COUCHBASE_SUFFIX_OPTS="CMAKE_BUILD_TYPE=Release"
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL="$n_proc"
|
||||
add_extension_from_source couchbase https://pecl.php.net couchbase couchbase "${ext##*-}" extension pecl >/dev/null 2>&1
|
||||
else
|
||||
pecl_install "${ext}" >/dev/null 2>&1
|
||||
fi
|
||||
add_extension_log "couchbase" "Installed and enabled"
|
||||
fi
|
||||
else
|
||||
if [ -e "${ext_dir:?}"/libcouchbase_php_core.dylib ]; then
|
||||
sudo cp "${ext_dir:?}"/libcouchbase_php_core.dylib "${brew_prefix:?}"/lib
|
||||
fi
|
||||
add_brew_extension couchbase extension
|
||||
fi
|
||||
}
|
||||
|
50
src/scripts/extensions/event.sh
Normal file
50
src/scripts/extensions/event.sh
Normal file
@ -0,0 +1,50 @@
|
||||
# Function to get event configure options
|
||||
get_event_configure_opts() {
|
||||
event_opts=(
|
||||
--with-event-core
|
||||
--with-event-extra
|
||||
--with-event-openssl
|
||||
--enable-event-sockets
|
||||
)
|
||||
if [ "$os" = 'Linux' ]; then
|
||||
event_opts+=(
|
||||
--with-openssl-dir=yes
|
||||
--with-event-libevent-dir=/usr
|
||||
)
|
||||
else
|
||||
event_opts+=(
|
||||
--with-openssl-dir="$(brew --prefix openssl@3)"
|
||||
--with-event-libevent-dir="$(brew --prefix libevent)"
|
||||
)
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to compile and install event
|
||||
add_event_helper() {
|
||||
local ext=$1
|
||||
[[ "$ext" =~ ^event$ ]] && ext="event-$(get_pecl_version "event" "stable")"
|
||||
event_opts=() && get_event_configure_opts
|
||||
export EVENT_LINUX_LIBS='libevent-dev'
|
||||
export EVENT_DARWIN_LIBS='libevent'
|
||||
event_configure_opts="--with-php-config=$(command -v php-config) ${event_opts[*]}"
|
||||
export EVENT_CONFIGURE_OPTS="$event_configure_opts"
|
||||
add_extension_from_source event https://pecl.php.net event event "${ext##*-}" extension pecl
|
||||
}
|
||||
|
||||
# Function to add event
|
||||
add_event() {
|
||||
local ext=$1
|
||||
enable_extension "event" "extension"
|
||||
if check_extension "event"; then
|
||||
add_log "${tick:?}" "event" "Enabled"
|
||||
else
|
||||
if ! [[ "${version:?}" =~ ${old_versions:?} ]] && [ "$os" = "Darwin" ]; then
|
||||
add_brew_extension event extension >/dev/null 2>&1
|
||||
else
|
||||
add_event_helper "$ext" >/dev/null 2>&1
|
||||
fi
|
||||
add_extension_log "event" "Installed and enabled"
|
||||
fi
|
||||
}
|
||||
|
||||
os="$(uname -s)"
|
@ -4,7 +4,7 @@ Function Add-Choco() {
|
||||
# Source: https://docs.chocolatey.org/en-us/choco/setup
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
@ -1,16 +1,21 @@
|
||||
add_firebird_client_darwin() {
|
||||
firebird_tag='R3_0_7'
|
||||
pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/tag/"$firebird_tag" | grep -Eo "Firebird-.*.pkg" | head -n 1)
|
||||
firebird_tag='v5.0.0'
|
||||
arch_name='x64'
|
||||
arch="$(uname -m)"
|
||||
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_name='arm64'
|
||||
pkg_name=$(get -s -n "" https://api.github.com/repos/FirebirdSQL/firebird/releases/tags/"$firebird_tag" | grep -Eo "Firebird-.*.-$arch_name.pkg" | head -n 1)
|
||||
[ -z "$pkg_name" ] && pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/expanded_assets/"$firebird_tag" | grep -Eo "Firebird-.*.-$arch_name.pkg" | head -n 1)
|
||||
get -q -e "/tmp/firebird.pkg" https://github.com/FirebirdSQL/firebird/releases/download/"$firebird_tag"/"$pkg_name"
|
||||
sudo installer -pkg /tmp/firebird.pkg -target /
|
||||
sudo mkdir -p /opt/firebird/include /opt/firebird/lib
|
||||
sudo find /Library/Frameworks/Firebird.framework -name '*.h' -exec cp "{}" /opt/firebird/include \;
|
||||
sudo cp -a /Library/Frameworks/Firebird.framework/Headers/* /opt/firebird/include/
|
||||
sudo find /Library/Frameworks/Firebird.framework -name '*.dylib' -exec cp "{}" /opt/firebird/lib \;
|
||||
}
|
||||
|
||||
add_firebird_helper() {
|
||||
firebird_dir=$1
|
||||
tag="$(php_src_tag)"
|
||||
export PDO_FIREBIRD_CONFIGURE_PREFIX_OPTS="CFLAGS=-Wno-incompatible-function-pointer-types EXTRA_CFLAGS=-Wno-int-conversion"
|
||||
export PDO_FIREBIRD_CONFIGURE_OPTS="--with-pdo-firebird=$firebird_dir"
|
||||
export PDO_FIREBIRD_LINUX_LIBS="firebird-dev"
|
||||
export PDO_FIREBIRD_PATH="ext/pdo_firebird"
|
||||
|
@ -17,6 +17,10 @@ add_gearman_helper() {
|
||||
# Function to add gearman extension.
|
||||
add_gearman() {
|
||||
status="Enabled"
|
||||
add_gearman_helper >/dev/null 2>&1
|
||||
add_extension_log "gearman" "$status"
|
||||
if [ "$(uname -s)" = 'Linux' ]; then
|
||||
add_gearman_helper >/dev/null 2>&1
|
||||
add_extension_log "gearman" "$status"
|
||||
else
|
||||
add_brew_extension gearman extension
|
||||
fi
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ Function Get-ICUUrl() {
|
||||
$trunk = "https://windows.php.net"
|
||||
$urls=@("${trunk}/downloads/php-sdk/deps/${vs_version}/${arch}", "${trunk}/downloads/php-sdk/deps/archives/${vs_version}/${arch}")
|
||||
foreach ($url in $urls) {
|
||||
$web_content = Invoke-WebRequest -Uri $url
|
||||
$web_content = Get-File -Url $url
|
||||
foreach ($link in $web_content.Links) {
|
||||
if ($link -match "/.*ICU-${icu_version}.*/") {
|
||||
return $trunk + $link.HREF
|
||||
@ -32,7 +32,7 @@ Function Repair-ICU() {
|
||||
$zip_url = Get-ICUUrl $icu.Groups[1].Value $installed.Architecture $vs
|
||||
if ($zip_url -ne '') {
|
||||
New-Item -Path "$php_dir" -Name "icu" -ItemType "directory" -Force > $null 2>&1
|
||||
Invoke-WebRequest -Uri $zip_url -OutFile "$php_dir\icu\icu.zip"
|
||||
Get-File -Url $zip_url -OutFile "$php_dir\icu\icu.zip"
|
||||
Expand-Archive -Path $php_dir\icu\icu.zip -DestinationPath $php_dir\icu -Force
|
||||
Get-ChildItem $php_dir\icu\bin -Filter *.dll | Copy-Item -Destination $php_dir -Force
|
||||
}
|
||||
@ -40,16 +40,12 @@ Function Repair-ICU() {
|
||||
}
|
||||
|
||||
Function Add-Http() {
|
||||
Add-Extension iconv >$null 2>&1
|
||||
Add-Extension raphf >$null 2>&1
|
||||
if($version -lt '8.0') {
|
||||
Add-Extension propro >$null 2>&1
|
||||
}
|
||||
Add-Extension pecl_http >$null 2>&1
|
||||
Repair-ICU
|
||||
try {
|
||||
php --ri "http" 2> $null | Out-Null
|
||||
Add-Log $tick "http" "Installed and enabled"
|
||||
} catch {
|
||||
Add-Log $cross "http" "Could not install http on PHP $( $installed.FullVersion )"
|
||||
}
|
||||
Add-ExtensionLog http "Installed and enabled"
|
||||
}
|
@ -11,10 +11,11 @@ get_http_version() {
|
||||
|
||||
# Function to enable http extension.
|
||||
enable_http() {
|
||||
enable_extension iconv extension
|
||||
enable_extension propro extension
|
||||
enable_extension raphf extension
|
||||
if (! [[ ${version:?} =~ ${jit_versions:?} ]] && check_extension propro && check_extension raphf) ||
|
||||
( [[ ${version:?} =~ ${jit_versions:?} ]] && check_extension raphf); then
|
||||
if (! [[ ${version:?} =~ ${jit_versions:?} ]] && check_extension iconv && check_extension propro && check_extension raphf) ||
|
||||
( [[ ${version:?} =~ ${jit_versions:?} ]] && check_extension iconv && check_extension raphf); then
|
||||
enable_extension http extension
|
||||
fi
|
||||
}
|
||||
@ -25,10 +26,12 @@ add_http_dependencies() {
|
||||
add_pecl_extension raphf 1.1.2 extension
|
||||
add_pecl_extension propro 1.0.2 extension
|
||||
elif [[ ${version:?} =~ 5.6|7.[0-4] ]]; then
|
||||
add_extension_helper propro
|
||||
add_extension_helper raphf
|
||||
add_extension iconv extension
|
||||
add_extension propro extension
|
||||
add_extension raphf extension
|
||||
else
|
||||
add_extension_helper raphf
|
||||
add_extension iconv extension
|
||||
add_extension raphf extension
|
||||
fi
|
||||
}
|
||||
|
||||
@ -88,6 +91,7 @@ add_http_version() {
|
||||
ext=$1
|
||||
enable_http
|
||||
if [ "x$(php -r "echo phpversion('http');")" != "x${ext##*-}" ]; then
|
||||
add_http_dependencies
|
||||
disable_extension_helper http >/dev/null
|
||||
add_http_helper pecl_http-"${ext##*-}" "$os"
|
||||
status="Installed and enabled"
|
||||
|
@ -2,9 +2,9 @@
|
||||
install_icu() {
|
||||
icu=$1
|
||||
if [ "$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")" != "$icu" ]; then
|
||||
get -q -n /tmp/icu.tar.zst "https://github.com/shivammathur/icu-intl/releases/download/icu4c/icu4c-$icu.tar.zst"
|
||||
get -q -n /tmp/icu.tar.zst "https://github.com/shivammathur/icu-intl/releases/download/icu4c/icu4c-$icu$arch_suffix.tar.zst"
|
||||
sudo tar -I zstd -xf /tmp/icu.tar.zst -C /usr/local
|
||||
sudo cp -r /usr/local/icu/lib/* /usr/lib/x86_64-linux-gnu/
|
||||
sudo cp -r /usr/local/icu/lib/* /usr/lib/"$(uname -m)"-linux-gnu/
|
||||
fi
|
||||
}
|
||||
|
||||
@ -15,9 +15,13 @@ add_intl() {
|
||||
if [ "$icu" != "$supported_version" ]; then
|
||||
add_log "${cross:?}" "intl" "ICU $icu is not supported"
|
||||
else
|
||||
[ "${ts:?}" = 'zts' ] && suffix='-zts'
|
||||
install_icu "$icu" >/dev/null 2>&1
|
||||
get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu.so"
|
||||
get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix$arch_suffix.so"
|
||||
enable_extension intl extension
|
||||
add_extension_log intl "Installed and enabled with ICU $icu"
|
||||
fi
|
||||
}
|
||||
|
||||
arch="$(uname -m)"
|
||||
[[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch_suffix='-arm64' || arch_suffix=''
|
||||
|
@ -20,7 +20,7 @@ Function Add-Ioncube() {
|
||||
if (-not($installed.ThreadSafe)) {
|
||||
$ts_part = "_nonts"
|
||||
}
|
||||
Invoke-WebRequest -Uri "https://downloads.ioncube.com/loader_downloads/ioncube_loaders_win$ts_part`_vc$vc`_$arch_part.zip" -OutFile $ext_dir\ioncube.zip
|
||||
Get-File -Url "https://downloads.ioncube.com/loader_downloads/ioncube_loaders_win$ts_part`_vc$vc`_$arch_part.zip" -OutFile $ext_dir\ioncube.zip
|
||||
Expand-Archive -Path $ext_dir\ioncube.zip -DestinationPath $ext_dir -Force
|
||||
Copy-Item $ext_dir\ioncube\ioncube_loader_win_$version.dll $ext_dir\php_ioncube.dll
|
||||
}
|
||||
|
@ -10,12 +10,25 @@ add_ioncube() {
|
||||
status='Enabled'
|
||||
if ! shared_extension ioncube; then
|
||||
status='Installed and enabled'
|
||||
os_name='lin' && [ "$(uname -s)" = "Darwin" ] && os_name='mac'
|
||||
get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_name"_x86-64.tar.gz | tar -xzf - -C /tmp
|
||||
sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "${ext_dir:?}/ioncube.so"
|
||||
sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt
|
||||
arch="$(uname -m)"
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
[ "$arch" = "arm64" ] && os_suffix="dar_arm64" || os_suffix="mac_x86-64"
|
||||
else
|
||||
[[ "$arch" = "i386" || "$arch" = "i686" ]] && arch=x86
|
||||
[[ "$arch" = "x86_64" ]] && arch=x86-64
|
||||
os_suffix="lin_$arch"
|
||||
fi
|
||||
ts_part="" && [ "${ts:?}" = "zts" ] && ts_part="_ts"
|
||||
get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_suffix".tar.gz | tar -xzf - -C /tmp
|
||||
loader_file=/tmp/ioncube/ioncube_loader_"${os_suffix%%_*}_${version:?}$ts_part".so
|
||||
if [ -e "$loader_file" ]; then
|
||||
sudo mv /tmp/ioncube/ioncube_loader_"${os_suffix%%_*}_${version:?}$ts_part".so "${ext_dir:?}/ioncube.so"
|
||||
sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
fi
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
add_extension_log "ioncube" "$status"
|
||||
check_extension "ioncube" && add_license_log
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ Function Add-InstantClient() {
|
||||
if ($arch -eq 'x86') {
|
||||
$suffix = 'nt'
|
||||
}
|
||||
Invoke-WebRequest -Uri https://download.oracle.com/otn_software/nt/instantclient/instantclient-basiclite-$suffix.zip -OutFile $php_dir\instantclient.zip
|
||||
Get-File -Url https://download.oracle.com/otn_software/nt/instantclient/instantclient-basiclite-$suffix.zip -OutFile $php_dir\instantclient.zip
|
||||
Expand-Archive -Path $php_dir\instantclient.zip -DestinationPath $php_dir -Force
|
||||
Copy-Item $php_dir\instantclient*\* $php_dir
|
||||
}
|
||||
@ -48,6 +48,7 @@ Function Get-Oci8DLL() {
|
||||
return $_
|
||||
}
|
||||
}
|
||||
return $null
|
||||
}
|
||||
|
||||
# Function to install oci8 and pdo_oci.
|
||||
@ -62,22 +63,17 @@ Function Add-Oci() {
|
||||
try {
|
||||
$status = 'Enabled'
|
||||
Add-InstantClient
|
||||
if ($extension -eq "pdo_oci") {
|
||||
Enable-PhpExtension pdo_oci -Path $php_dir
|
||||
} else {
|
||||
if(-not(Test-Path $ext_dir\php_oci8.dll)) {
|
||||
$oci8DLL = Get-Oci8DLL
|
||||
if($oci8DLL) {
|
||||
Copy-Item -Path $oci8DLL -Destination $ext_dir\php_oci8.dll
|
||||
} else {
|
||||
$status = 'Installed and enabled'
|
||||
Invoke-WebRequest -Uri (Get-Oci8Url) -OutFile $php_dir\oci8.zip
|
||||
Expand-Archive -Path $php_dir\oci8.zip -DestinationPath $ext_dir -Force
|
||||
}
|
||||
if($version -lt '8.4') {
|
||||
if($version -lt '5.6' -and $extension -eq 'oci8') {
|
||||
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
|
||||
} else {
|
||||
Enable-PhpExtension $extension -Path $php_dir
|
||||
}
|
||||
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
|
||||
} else {
|
||||
$status = 'Installed and enabled'
|
||||
Add-Extension $extension >$null 2>&1
|
||||
}
|
||||
Add-Log $tick $extension $status
|
||||
Add-ExtensionLog $extension $status
|
||||
Add-LicenseLog
|
||||
} catch {
|
||||
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
|
||||
|
@ -11,25 +11,37 @@ add_license_log() {
|
||||
add_client() {
|
||||
if [ ! -e "$oracle_client" ]; then
|
||||
sudo mkdir -p -m 777 "$oracle_home" "$oracle_client"
|
||||
arch="$(uname -m)"
|
||||
for package in basiclite sdk; do
|
||||
if [ "$os" = 'Linux' ]; then
|
||||
libs='/usr/lib/'
|
||||
os_name='linux'
|
||||
arch='linuxx64'
|
||||
[[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch_suffix='linux-arm64' || arch_suffix='linuxx64'
|
||||
lib_ext='so'
|
||||
elif [ "$os" = 'Darwin' ]; then
|
||||
libs='/usr/local/lib/'
|
||||
os_name='mac'
|
||||
arch='macos'
|
||||
arch_suffix='macos'
|
||||
lib_ext='dylib'
|
||||
fi
|
||||
get -q -n "/opt/oracle/$package.zip" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-$arch.zip"
|
||||
unzip -o "/opt/oracle/$package.zip" -d "$oracle_home"
|
||||
if [[ "$os" = 'Darwin' && ("$arch" = 'arm64' || "$arch" = 'aarch64') ]]; then
|
||||
get -q -n "/opt/oracle/$package.dmg" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-macos-arm64.dmg"
|
||||
sudo hdiutil attach "/opt/oracle/$package.dmg"
|
||||
(cd /Volumes/instantclient-"$package"-macos.arm64-* && bash install_ic.sh)
|
||||
sudo cp -a ~/Downloads/instantclient_* /opt/oracle/
|
||||
else
|
||||
get -q -n "/opt/oracle/$package.zip" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-$arch_suffix.zip"
|
||||
unzip -o "/opt/oracle/$package.zip" -d "$oracle_home"
|
||||
fi
|
||||
done
|
||||
for icdir in /opt/oracle/instantclient_*; do
|
||||
sudo mv "$icdir"/* "$oracle_client"/
|
||||
done
|
||||
sudo mkdir -p "$libs"
|
||||
sudo ln -sf /opt/oracle/instantclient/*.$lib_ext* $libs
|
||||
if [ "$os" = "Linux" ]; then
|
||||
[ -e "$libs/$arch"-linux-gnu/libaio.so.1 ] || sudo ln -sf "$libs/$arch"-linux-gnu/libaio.so.1t64 "$libs/$arch"-linux-gnu/libaio.so.1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@ -39,9 +51,13 @@ add_oci_helper() {
|
||||
status='Installed and enabled'
|
||||
read -r "${ext}_LINUX_LIBS" <<< "libaio-dev"
|
||||
read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config) --with-${ext/_/-}=instantclient,$oracle_client"
|
||||
read -r "${ext}_PATH" <<< "ext/$ext"
|
||||
patch_phpize
|
||||
add_extension_from_source "$ext" https://github.com php php-src "$(php_src_tag)" extension get
|
||||
if [[ $(printf "%s\n%s" "${version:?}" "8.3" | sort -V | head -n1) != "$version" ]]; then
|
||||
add_extension_from_source "$ext" https://github.com php pecl-database-"$ext" main extension get
|
||||
else
|
||||
read -r "${ext}_PATH" <<< "ext/$ext"
|
||||
add_extension_from_source "$ext" https://github.com php php-src "$(php_src_tag)" extension get
|
||||
fi
|
||||
restore_phpize
|
||||
else
|
||||
enable_extension "$ext" extension
|
||||
|
12
src/scripts/extensions/patches/common.sh
Normal file
12
src/scripts/extensions/patches/common.sh
Normal file
@ -0,0 +1,12 @@
|
||||
process_file() {
|
||||
local file=$1
|
||||
sed -i'' -e '0,/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\).*/s//\#include <ext\/random\/php_random.h>/' "$file"
|
||||
sed -i'' -e '/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\)/d' "$file"
|
||||
}
|
||||
|
||||
export -f process_file
|
||||
|
||||
# Compare with 8.3 so it runs only on 8.4 and above
|
||||
if [[ $(printf "%s\n%s" "${version:?}" "8.3" | sort -V | head -n1) != "$version" ]]; then
|
||||
find . -type f \( -name "*.c" -o -name "*.h" \) -exec bash -c 'process_file "$0"' {} \;
|
||||
fi
|
@ -3,5 +3,7 @@ patch_geos() {
|
||||
sed -i~ -e "s/, ce->name/, ZSTR_VAL(ce->name)/; s/ulong /zend_ulong /" geos.c
|
||||
fi
|
||||
get -q -n /tmp/php8.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0003-add-all-arginfo-and-fix-build-with-PHP-8.patch
|
||||
get -q -n /tmp/toString.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0006-fix-__toString-with-8.2.patch
|
||||
patch -p1 < /tmp/php8.patch 2>/dev/null || true
|
||||
patch -p1 < /tmp/toString.patch 2>/dev/null || true
|
||||
}
|
||||
|
@ -1,24 +1,98 @@
|
||||
# Function to install phalcon
|
||||
Function Add-PhalconHelper() {
|
||||
if ($extension_version -eq '4') {
|
||||
Install-Phpextension -Extension phalcon -MinimumStability stable -Path $php_dir
|
||||
} else {
|
||||
$domain = 'https://github.com'
|
||||
# Function to get the url of the phalcon release asset.
|
||||
Function Get-PhalconReleaseAssetUrl() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$Semver
|
||||
)
|
||||
$domain = 'https://api.github.com/repos'
|
||||
$releases = 'phalcon/cphalcon/releases'
|
||||
$match = $null
|
||||
if($extension_version -match '[3-4]') {
|
||||
$nts = if (!$installed.ThreadSafe) { "_nts" } else { "" }
|
||||
$match = Invoke-WebRequest -Uri "$domain/phalcon/cphalcon/releases/v3.4.5" | Select-String -Pattern "href=`"(.*phalcon_x64_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)`""
|
||||
$zip_file = $match.Matches[0].Groups[1].Value
|
||||
Invoke-WebRequest -Uri $domain/$zip_file -OutFile $ENV:RUNNER_TOOL_CACHE\phalcon.zip > $null 2>&1
|
||||
try {
|
||||
$match = (Invoke-RestMethod -Uri "$domain/$releases/tags/v$Semver").assets | Select-String -Pattern "browser_download_url=.*(phalcon_${arch}_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)"
|
||||
} catch { }
|
||||
if($null -eq $match) {
|
||||
try {
|
||||
$match = (Get-File -Url "$github/$releases/expanded_assets/v$Semver").Links.href | Select-String -Pattern "(phalcon_${arch}_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)"
|
||||
} catch { }
|
||||
}
|
||||
} else {
|
||||
$nts = if (!$installed.ThreadSafe) { "-nts" } else { "-ts" }
|
||||
try {
|
||||
$match = (Invoke-RestMethod -Uri "$domain/$releases/tags/v$Semver").assets | Select-String -Pattern "browser_download_url=.*(php_phalcon-php${version}${nts}-windows.*-x64.zip)"
|
||||
} catch { }
|
||||
if($null -eq $match) {
|
||||
try {
|
||||
$match = (Get-File -Url "$github/$releases/expanded_assets/v$Semver").Links.href | Select-String -Pattern "(php_phalcon-php${version}${nts}-windows.*-x64.zip)"
|
||||
} catch { }
|
||||
}
|
||||
if($null -eq $match) {
|
||||
try {
|
||||
$match = (Invoke-RestMethod -Uri "$domain/$releases/tags/v$Semver").assets | Select-String -Pattern "browser_download_url=.*(phalcon-php${version}${nts}-windows.*-x64.zip)"
|
||||
} catch { }
|
||||
}
|
||||
if($null -eq $match) {
|
||||
try {
|
||||
$match = (Get-File -Url "$github/$releases/expanded_assets/v$Semver").Links.href | Select-String -Pattern "(phalcon-php${version}${nts}-windows.*-x64.zip)"
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
if($NULL -ne $match) {
|
||||
return "$github/$releases/download/v$Semver/$($match.Matches[0].Groups[1].Value)"
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
# Function to add phalcon using GitHub releases.
|
||||
Function Add-PhalconFromGitHub() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$Semver
|
||||
)
|
||||
$zip_url = Get-PhalconReleaseAssetUrl $Semver
|
||||
if($zip_url) {
|
||||
Get-File -Url $zip_url -OutFile $ENV:RUNNER_TOOL_CACHE\phalcon.zip > $null 2>&1
|
||||
Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\phalcon.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\phalcon -Force > $null 2>&1
|
||||
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\phalcon\php_phalcon.dll" -Destination "$ext_dir\php_phalcon.dll"
|
||||
Enable-PhpExtension -Extension phalcon -Path $php_dir
|
||||
} else {
|
||||
throw "Unable to get Phalcon release from the GitHub release"
|
||||
}
|
||||
}
|
||||
|
||||
# Function to get phalcon semver.
|
||||
Function Get-PhalconSemver() {
|
||||
if($extension_version -eq '3') {
|
||||
return '3.4.5'
|
||||
} elseif (($extension_version -eq '4') -and ($version -eq '7.2')) {
|
||||
return '4.1.0'
|
||||
} elseif (($extension_version -eq '5') -and ($version -eq '7.4')) {
|
||||
return '5.4.0'
|
||||
}
|
||||
return Get-PeclPackageVersion phalcon $extension_version stable stable | Select-Object -First 1
|
||||
}
|
||||
|
||||
# Function to install phalcon
|
||||
Function Add-PhalconHelper() {
|
||||
$semver = Get-PhalconSemver
|
||||
if (($extension_version -eq '3') -or ($extension_version -eq '5')) {
|
||||
Add-PhalconFromGitHub $semver
|
||||
} elseif ($extension_version -eq '4') {
|
||||
Add-Extension -Extension phalcon -Stability stable -Extension_version $semver
|
||||
}
|
||||
}
|
||||
|
||||
# Function to add phalcon
|
||||
Function Add-Phalcon() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[ValidateSet('phalcon3', 'phalcon4')]
|
||||
[ValidateSet('phalcon3', 'phalcon4', 'phalcon5')]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
|
@ -1,13 +1,42 @@
|
||||
# Helper function to get phalcon version
|
||||
get_phalcon_version() {
|
||||
if [ "$extension" = "phalcon5" ]; then
|
||||
if [ "${version:?}" = "7.4" ]; then
|
||||
echo '5.4.0'
|
||||
else
|
||||
get_pecl_version phalcon stable 5
|
||||
fi
|
||||
elif [ "$extension" = "phalcon4" ]; then
|
||||
echo '4.1.2'
|
||||
elif [ "$extension" = "phalcon3" ]; then
|
||||
echo '3.4.5'
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to add phalcon from repo.
|
||||
add_phalcon_from_repo(){
|
||||
version=${version:?}
|
||||
if [ "$extension" = "phalcon5" ]; then
|
||||
PHALCON_PATH=build/phalcon
|
||||
else
|
||||
PHALCON_PATH=build/php"${version%.*}"/64bits
|
||||
fi
|
||||
PHALCON_CONFIGURE_OPTS="--enable-phalcon --with-php-config=$(command -v php-config)"
|
||||
export PHALCON_PATH
|
||||
export PHALCON_CONFIGURE_OPTS
|
||||
add_extension_from_source phalcon https://github.com phalcon cphalcon v"$(get_phalcon_version)" extension
|
||||
}
|
||||
|
||||
# Helper function to add phalcon.
|
||||
add_phalcon_helper() {
|
||||
status='Installed and enabled'
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
add_brew_extension "$extension" extension
|
||||
else
|
||||
packages=("php${version:?}-$extension")
|
||||
[ "$extension" = "phalcon4" ] && packages+=("php${version:?}-psr")
|
||||
package="php${version:?}-$extension"
|
||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||
check_package "${packages[0]}" && install_packages "${packages[@]}"
|
||||
[[ "$extension" =~ phalcon[4|5] ]] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0)
|
||||
(check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo
|
||||
fi
|
||||
}
|
||||
|
||||
@ -44,15 +73,28 @@ add_phalcon4() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to add phalcon5.
|
||||
add_phalcon5() {
|
||||
if shared_extension phalcon; then
|
||||
phalcon_version=$(php -d="extension=phalcon.so" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
|
||||
if [ "$phalcon_version" != "$extension_major_version" ]; then
|
||||
add_phalcon_helper
|
||||
else
|
||||
enable_extension phalcon extension
|
||||
fi
|
||||
else
|
||||
add_phalcon_helper
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to add phalcon.
|
||||
add_phalcon() {
|
||||
extension=$1
|
||||
local extension=$1
|
||||
status='Enabled'
|
||||
[ "$extension" = "phalcon" ] && extension=phalcon5
|
||||
extension_major_version=${extension: -1}
|
||||
if [ "$extension_major_version" = "4" ]; then
|
||||
add_phalcon4 >/dev/null 2>&1
|
||||
elif [ "$extension_major_version" = "3" ]; then
|
||||
add_phalcon3 >/dev/null 2>&1
|
||||
if [[ "$extension_major_version" =~ [3-5] ]]; then
|
||||
add_phalcon"$extension_major_version" >/dev/null 2>&1
|
||||
fi
|
||||
add_extension_log "phalcon" "$status"
|
||||
}
|
||||
|
150
src/scripts/extensions/relay.sh
Normal file
150
src/scripts/extensions/relay.sh
Normal file
@ -0,0 +1,150 @@
|
||||
# Get relay version
|
||||
get_relay_version() {
|
||||
local ext=$1
|
||||
if [[ "$ext" =~ ^relay$ ]]; then
|
||||
if [ "${version:?}" = "7.4" ]; then
|
||||
echo 'v0.7.0'
|
||||
else
|
||||
get -s -n "" "${relay_releases:?}"/latest 2<&1 | grep -m 1 -Eo "tag/(v[0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2
|
||||
fi
|
||||
else
|
||||
relay_version="${ext##*-}"
|
||||
echo "v${relay_version/v//}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Get OS suffix in relay artifact URL.
|
||||
get_os_suffix() {
|
||||
if [ "$os" = "Linux" ]; then
|
||||
if [[ "$ID" =~ ubuntu|debian ]]; then
|
||||
echo debian
|
||||
elif [ "$ID" = "centos" ]; then
|
||||
echo centos"$VERSION_ID"
|
||||
else
|
||||
echo "$ID"
|
||||
fi
|
||||
else
|
||||
echo darwin
|
||||
fi
|
||||
}
|
||||
|
||||
# Get openssl suffix in relay artifact URL.
|
||||
get_openssl_suffix() {
|
||||
openssl_3=$(php -r "echo strpos(OPENSSL_VERSION_TEXT, 'SSL 3') !== false;")
|
||||
[ "$openssl_3" = "1" ] && echo '+libssl3' || echo ''
|
||||
}
|
||||
|
||||
# Change library paths in relay binary.
|
||||
change_library_paths() {
|
||||
if [ "$os" = "Darwin" ]; then
|
||||
otool -L "${ext_dir:?}"/relay.so | grep -q 'ssl.1' && openssl_version='1.1' || openssl_version='3'
|
||||
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || brew install openssl@"$openssl_version"
|
||||
dylibs="$(otool -L "${ext_dir:?}"/relay.so | grep -Eo '.*\.dylib' | cut -f1 -d ' ')"
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libzstd.*dylib" | xargs)" "$brew_prefix"/opt/zstd/lib/libzstd.dylib "$ext_dir"/relay.so
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "liblz4.*dylib" | xargs)" "$brew_prefix"/opt/lz4/lib/liblz4.dylib "$ext_dir"/relay.so
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libssl.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libssl.dylib "$ext_dir"/relay.so
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libcrypto.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libcrypto.dylib "$ext_dir"/relay.so
|
||||
install_name_tool -change "$(echo "${dylibs}" | grep -E "libck.*dylib" | xargs)" "$brew_prefix"/opt/concurrencykit/lib/libck.dylib "$ext_dir"/relay.so
|
||||
fi
|
||||
}
|
||||
|
||||
# Add relay dependencies
|
||||
add_relay_dependencies() {
|
||||
add_extension json
|
||||
add_extension msgpack
|
||||
add_extension igbinary
|
||||
if [ "$os" = "Darwin" ]; then
|
||||
. "${0%/*}"/tools/brew.sh
|
||||
configure_brew
|
||||
brew install hiredis lz4 zstd concurrencykit
|
||||
fi
|
||||
}
|
||||
|
||||
# Initialize relay extension ini configuration
|
||||
init_relay_ini() {
|
||||
relay_ini=$1
|
||||
if [ -e "$relay_ini" ]; then
|
||||
if [[ -n "$RELAY_KEY" ]]; then
|
||||
sudo sed -i.bak "s/^; relay.key =.*/relay.key = $RELAY_KEY/" "$relay_ini"
|
||||
fi
|
||||
if [[ -n "$RELAY_ENVIRONMENT" ]]; then
|
||||
sudo sed -i.bak "s/^; relay.environment =.*/relay.environment = $RELAY_ENVIRONMENT/" "$relay_ini"
|
||||
fi
|
||||
if [[ -n "$RELAY_EVICTION_POLICY" ]]; then
|
||||
sudo sed -i.bak "s/^; relay.eviction_policy =.*/relay.eviction_policy = $RELAY_EVICTION_POLICY/" "$relay_ini"
|
||||
fi
|
||||
if [[ -n "$RELAY_MAX_MEMORY" ]]; then
|
||||
sudo sed -i.bak "s/^; relay.maxmemory =.*/relay.maxmemory = $RELAY_MAX_MEMORY/" "$relay_ini"
|
||||
fi
|
||||
sudo rm -rf "$relay_ini".bak
|
||||
fi
|
||||
}
|
||||
|
||||
# Enable relay extension
|
||||
enable_relay() {
|
||||
relay_ini=$1
|
||||
if [ -e "$relay_ini" ]; then
|
||||
init_relay_ini "$relay_ini"
|
||||
if [ "$os" = "Linux" ]; then
|
||||
sudo cp "$relay_ini" "${ini_dir:?}"/../mods-available/relay.ini
|
||||
sudo phpenmod -v "${version:?}" relay
|
||||
else
|
||||
sudo cp "${relay_ini}" "${scan_dir:?}"/60-relay.ini
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Patch binary id in relay extension
|
||||
init_relay_binary_id() {
|
||||
if [ -e "${ext_dir:?}"/relay.so ]; then
|
||||
sudo LC_ALL=C sed -i.bak "s/00000000-0000-0000-0000-000000000000/$(uuidgen)/" "$ext_dir"/relay.so || true
|
||||
fi
|
||||
}
|
||||
|
||||
# Configure relay extension
|
||||
configure_relay() {
|
||||
change_library_paths
|
||||
init_relay_binary_id
|
||||
enable_relay "${ext_dir}"/relay.ini
|
||||
}
|
||||
|
||||
# Helper function to add relay extension
|
||||
add_relay_helper() {
|
||||
arch="$(uname -m | sed 's/_/-/')"
|
||||
os_suffix="$(get_os_suffix)"
|
||||
openssl_suffix="$(get_openssl_suffix)"
|
||||
artifact_file_name="relay-$relay_version-php${version:?}-$os_suffix-$arch$openssl_suffix.tar.gz"
|
||||
url="$relay_trunk"/"$relay_version"/"$artifact_file_name"
|
||||
get -q -n /tmp/relay.tar.gz "$url"
|
||||
if (! [ -e /tmp/relay.tar.gz ] || ! file /tmp/relay.tar.gz | grep -q 'gzip'); then
|
||||
if [ "$openssl_suffix" = '+libssl3' ]; then
|
||||
get -q -n /tmp/relay.tar.gz "${url/+libssl3/}"
|
||||
else
|
||||
get -q -n /tmp/relay.tar.gz "${url/.tar/+libssl3.tar}"
|
||||
fi
|
||||
fi
|
||||
if [ -e /tmp/relay.tar.gz ] && file /tmp/relay.tar.gz | grep -q 'gzip'; then
|
||||
sudo tar --strip-components=1 -xzf /tmp/relay.tar.gz -C "${ext_dir:?}"
|
||||
sudo mv "${ext_dir:?}"/relay-pkg.so "${ext_dir:?}"/relay.so
|
||||
fi
|
||||
}
|
||||
|
||||
# Add relay extension
|
||||
add_relay() {
|
||||
local ext=$1
|
||||
local arch
|
||||
local url
|
||||
os=$(uname -s)
|
||||
relay_releases=https://github.com/cachewerk/relay/releases
|
||||
relay_trunk=https://builds.r2.relay.so
|
||||
relay_version=$(get_relay_version "$ext")
|
||||
add_relay_dependencies >/dev/null 2>&1
|
||||
if shared_extension relay; then
|
||||
message="Enabled"
|
||||
else
|
||||
add_relay_helper >/dev/null 2>&1
|
||||
message="Installed and enabled"
|
||||
fi
|
||||
configure_relay >/dev/null 2>&1
|
||||
add_extension_log relay "$message"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
# Function to parse extension environment variables
|
||||
parse_args() {
|
||||
local extension=$1
|
||||
local extension=${1%-*}
|
||||
suffix=$(echo "$2" | tr '[:lower:]' '[:upper:]')
|
||||
up_ext_name=$(echo "$extension" | tr '[:lower:]' '[:upper:]')
|
||||
var="${extension}_${suffix}"
|
||||
@ -10,6 +10,19 @@ parse_args() {
|
||||
echo "$output" | xargs -n 1 | sort | uniq | xargs
|
||||
}
|
||||
|
||||
# Function to parse configure options for pecl
|
||||
# Make sure we have all options in name="value" form i.e XML properties.
|
||||
parse_pecl_configure_options() {
|
||||
configure_opts=$(echo "$1" | sed -E -e "s#['\"]|--##g")
|
||||
IFS=' ' read -r -a opts_array <<< "$configure_opts"
|
||||
output_opts=()
|
||||
for opt in "${opts_array[@]}"; do
|
||||
[ "${opt##*=}" != "${opt%=*}" ] && value="${opt##*=}" || value=yes
|
||||
output_opts+=("${opt%=*}=\"$value\"")
|
||||
done
|
||||
echo "${output_opts[@]}"
|
||||
}
|
||||
|
||||
# Function to log if a library is installed
|
||||
add_lib_log() {
|
||||
local lib=$1
|
||||
@ -76,6 +89,8 @@ run_group() {
|
||||
|
||||
patch_extension() {
|
||||
local extension=$1
|
||||
# shellcheck source=.
|
||||
. "${scripts:?}"/extensions/patches/common.sh
|
||||
if [ -e "${scripts:?}"/extensions/patches/"$extension".sh ]; then
|
||||
# shellcheck source=.
|
||||
. "${scripts:?}"/extensions/patches/"$extension".sh
|
||||
@ -133,10 +148,11 @@ add_extension_from_source() {
|
||||
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
||||
else
|
||||
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
||||
[ "${debug:?}" = "debug" ] && suffix_opts="$suffix_opts --enable-debug"
|
||||
patch_extension "$extension" >/dev/null 2>&1
|
||||
run_group "phpize" "phpize"
|
||||
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
||||
run_group "sudo make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make"
|
||||
run_group "sudo $prefix_opts make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make"
|
||||
run_group "sudo make install" "make install"
|
||||
enable_extension "$extension" "$prefix"
|
||||
fi
|
||||
|
78
src/scripts/extensions/sqlsrv.ps1
Normal file
78
src/scripts/extensions/sqlsrv.ps1
Normal file
@ -0,0 +1,78 @@
|
||||
# Function to get sqlsrv extension version.
|
||||
Function Get-SqlsrvReleaseVersion() {
|
||||
if ($version -le '7.2') {
|
||||
# Use the releases from PECL for these versions
|
||||
return null;
|
||||
} elseif($version -eq '7.3') {
|
||||
return '5.9.0'
|
||||
} elseif ($version -eq '7.4') {
|
||||
return '5.10.1'
|
||||
} elseif ($version -eq '8.0') {
|
||||
return '5.11.1'
|
||||
} else {
|
||||
return 'latest'
|
||||
}
|
||||
}
|
||||
|
||||
# Function to get sqlsrv extension release URL.
|
||||
Function Get-SqlsrvReleaseUrl()
|
||||
{
|
||||
$extensionVersion = Get-SqlsrvReleaseVersion
|
||||
if($extensionVersion) {
|
||||
$repo = "$github/microsoft/msphpsql"
|
||||
if($extensionVersion -eq 'latest') {
|
||||
return "$repo/releases/latest/download/Windows-$version.zip"
|
||||
} else {
|
||||
return "$repo/releases/download/v$extensionVersion/Windows-$version.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Function to add sqlsrv extension from GitHub.
|
||||
Function Add-SqlsrvFromMSGithub()
|
||||
{
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
try {
|
||||
$zipUrl = SqlsrvReleaseUrl
|
||||
if($zipUrl) {
|
||||
$nts = if (!$installed.ThreadSafe) { "nts" } else { "ts" }
|
||||
$noDotVersion = $version.replace('.', '')
|
||||
$extensionFilePath = "Windows-$version\$arch\php_${extension}_${noDotVersion}_${nts}.dll"
|
||||
Get-File -Url $zipUrl -OutFile $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip > $null 2>&1
|
||||
Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\sqlsrv -Force > $null 2>&1
|
||||
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\sqlsrv\$extensionFilePath" -Destination "$ext_dir\php_$extension.dll"
|
||||
Enable-PhpExtension -Extension $extension -Path $php_dir
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
# Function to add sqlsrv extension.
|
||||
Function Add-Sqlsrv() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
$status = 'Enabled'
|
||||
if (Test-Path $ext_dir\php_$extension.dll) {
|
||||
Enable-PhpExtension -Extension $extension -Path $php_dir
|
||||
} else {
|
||||
try {
|
||||
Add-ExtensionFromGithub $extension > $null 2>&1
|
||||
} catch {}
|
||||
if (-not(Test-Extension $extension)) {
|
||||
Add-SqlsrvFromMSGithub $extension >$null 2>&1
|
||||
}
|
||||
if (-not(Test-Extension $extension)) {
|
||||
Add-Extension $extension >$null 2>&1
|
||||
}
|
||||
$status = 'Installed and enabled'
|
||||
}
|
||||
Add-ExtensionLog $extension $status
|
||||
}
|
@ -1,9 +1,14 @@
|
||||
# Function to get sqlsrv and pdo_sqlsrv version.
|
||||
get_sqlsrv_version() {
|
||||
if [[ "${version:?}" =~ 7.[0-2] ]]; then
|
||||
if [[ "${version:?}" =~ 7.[0-3] ]]; then
|
||||
echo '5.9.0'
|
||||
elif [[ "${version:?}" =~ 7.4 ]]; then
|
||||
echo '5.10.1'
|
||||
elif [[ "${version:?}" =~ 8.0 ]]; then
|
||||
echo '5.11.1'
|
||||
else
|
||||
echo '5.10.0beta2'
|
||||
# Return an empty string so that pecl will install the latest version.
|
||||
echo ''
|
||||
fi
|
||||
}
|
||||
|
||||
@ -11,5 +16,10 @@ get_sqlsrv_version() {
|
||||
add_sqlsrv() {
|
||||
ext=$1
|
||||
ext_version=$(get_sqlsrv_version)
|
||||
add_pecl_extension "$ext" "$ext_version" extension
|
||||
if [ "$(uname -s)" = 'Linux' ]; then
|
||||
install_packages unixodbc-dev
|
||||
add_pecl_extension "$ext" "$ext_version" extension
|
||||
else
|
||||
add_brew_extension "$ext" extension
|
||||
fi
|
||||
}
|
||||
|
84
src/scripts/extensions/zephir_parser.ps1
Normal file
84
src/scripts/extensions/zephir_parser.ps1
Normal file
@ -0,0 +1,84 @@
|
||||
# Function to get the url of the phalcon release asset.
|
||||
Function Get-ZephirParserReleaseAssetUrl() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$extension_version
|
||||
)
|
||||
$repo = 'zephir-lang/php-zephir-parser'
|
||||
$zp_releases = "$github/$repo/releases"
|
||||
$nts = if (!$installed.ThreadSafe) { "nts" } else { "ts" }
|
||||
try {
|
||||
$match = (Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/tags/$extension_version").assets | Select-String -Pattern "browser_download_url=.*(zephir_parser-php-${version}-$nts-windows.*.zip)"
|
||||
} catch {
|
||||
$match = (Get-File -Url "$zp_releases/expanded_assets/$extension_version").Links.href | Select-String -Pattern "(zephir_parser-php-${version}-$nts-windows.*.zip)"
|
||||
}
|
||||
if($NULL -ne $match) {
|
||||
return "$zp_releases/download/$extension_version/$($match.Matches[0].Groups[1].Value)"
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
# Function to get zephir parser version using GitHub releases.
|
||||
Function Get-ZephirParserVersion() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
$repo = 'zephir-lang/php-zephir-parser'
|
||||
$zp_releases = "$github/$repo/releases"
|
||||
if($extension -eq 'zephir_parser') {
|
||||
return (Get-File -Url $zp_releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1]
|
||||
} else {
|
||||
return 'v' + ($extension.split('-')[1] -replace 'v')
|
||||
}
|
||||
}
|
||||
|
||||
# Function to add zephir parser using GitHub releases.
|
||||
Function Add-ZephirParserFromGitHub() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
$extension_version = Get-ZephirParserVersion $extension
|
||||
$zip_url = Get-ZephirParserReleaseAssetUrl $extension_version
|
||||
if($zip_url) {
|
||||
Get-File -Url $zip_url -OutFile $ENV:RUNNER_TOOL_CACHE\zp.zip > $null 2>&1
|
||||
Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\zp.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\zp -Force > $null 2>&1
|
||||
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\zp\php_zephir_parser.dll" -Destination "$ext_dir\php_zephir_parser.dll"
|
||||
Enable-PhpExtension -Extension zephir_parser -Path $php_dir
|
||||
} else {
|
||||
throw "Unable to get zephir_parser release from the GitHub repo"
|
||||
}
|
||||
}
|
||||
|
||||
# Function to add zephir parser.
|
||||
Function Add-ZephirParser() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[string]
|
||||
$extension
|
||||
)
|
||||
try {
|
||||
$status = 'Enabled'
|
||||
if (Test-Path $ext_dir\php_zephir_parser.dll) {
|
||||
Enable-PhpExtension -Extension zephir_parser -Path $php_dir
|
||||
} else {
|
||||
$status = 'Installed and enabled'
|
||||
try {
|
||||
Add-ZephirParserFromGitHub $extension
|
||||
} catch {
|
||||
Add-Extension $extension >$null 2>&1
|
||||
}
|
||||
}
|
||||
Add-ExtensionLog zephir_parser $status
|
||||
} catch {
|
||||
Add-Log $cross $extension "Could not install $extension on PHP $($installed.FullVersion)"
|
||||
}
|
||||
}
|
42
src/scripts/extensions/zephir_parser.sh
Normal file
42
src/scripts/extensions/zephir_parser.sh
Normal file
@ -0,0 +1,42 @@
|
||||
# Get zephir_parser version
|
||||
get_zephir_parser_version() {
|
||||
local ext=$1
|
||||
if [[ "$ext" =~ ^zephir_parser$ ]]; then
|
||||
get -s -n "" "${zp_releases:?}"/latest 2<&1 | grep -m 1 -Eo "tag/(v?[0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2
|
||||
else
|
||||
zp_version="${ext##*-}"
|
||||
echo "v${zp_version/v//}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Add zephir_parser helper
|
||||
add_zephir_parser_helper() {
|
||||
local ext=$1
|
||||
nts="${ts:?}" && nts="${nts/z/}"
|
||||
ext_version=$(get_zephir_parser_version "$ext")
|
||||
[ "$(uname -s)" = "Linux" ] && os_suffix=ubuntu || os_suffix=macos
|
||||
build_name=$(get -s -n "" https://api.github.com/repos/"$repo"/releases/tags/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1)
|
||||
[ -z "$build_name" ] && build_name=$(get -s -n "" "$zp_releases"/expanded_assets/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1)
|
||||
if [ -n "$build_name" ]; then
|
||||
get -q -e "/tmp/zp.zip" "$zp_releases"/download/"$ext_version"/"$build_name"
|
||||
sudo unzip -o "/tmp/zp.zip" -d "${ext_dir:?}"
|
||||
enable_extension zephir_parser extension
|
||||
else
|
||||
pecl_install zephir_parser
|
||||
fi
|
||||
}
|
||||
|
||||
# Add zephir_parser
|
||||
add_zephir_parser() {
|
||||
ext=$1
|
||||
repo=zephir-lang/php-zephir-parser
|
||||
zp_releases=https://github.com/"$repo"/releases
|
||||
if ! shared_extension zephir_parser; then
|
||||
message='Installed and enabled'
|
||||
add_zephir_parser_helper "$ext" >/dev/null 2>&1
|
||||
else
|
||||
message='Enabled'
|
||||
enable_extension zephir_parser extension
|
||||
fi
|
||||
add_extension_log zephir_parser "$message"
|
||||
}
|
@ -2,7 +2,15 @@
|
||||
add_sudo() {
|
||||
if ! command -v sudo >/dev/null; then
|
||||
check_package sudo || apt-get update
|
||||
apt-get install -y sudo
|
||||
apt-get install -y sudo || (apt-get update && apt-get install -y sudo)
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to link apt-fast to apt-get
|
||||
link_apt_fast() {
|
||||
if ! command -v apt-fast >/dev/null; then
|
||||
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
||||
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
||||
fi
|
||||
}
|
||||
|
||||
@ -15,10 +23,19 @@ self_hosted_helper() {
|
||||
install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg
|
||||
}
|
||||
|
||||
# Function to fix broken packages.
|
||||
fix_broken_packages() {
|
||||
sudo apt --fix-broken install >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Function to install a package
|
||||
install_packages() {
|
||||
packages=("$@")
|
||||
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
||||
if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then
|
||||
echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1
|
||||
trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit
|
||||
fi
|
||||
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
||||
}
|
||||
|
||||
# Function to disable an extension.
|
||||
@ -29,8 +46,9 @@ disable_extension_helper() {
|
||||
if [ "$disable_dependents" = "true" ]; then
|
||||
disable_extension_dependents "$extension"
|
||||
fi
|
||||
sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file[@]}" "$pecl_file"
|
||||
sudo find "$ini_dir"/.. -name "*$extension.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true
|
||||
sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?\"?$/d" "${ini_file[@]}" "$pecl_file"
|
||||
sudo find "$ini_dir"/.. -name "*-$extension.ini" -not -path "*phar.ini" -not -path "*pecl.ini" -not -path "*mods-available*" -delete >/dev/null 2>&1 || true
|
||||
sudo rm -f /tmp/php"$version"_extensions
|
||||
mkdir -p /tmp/extdisabled/"$version"
|
||||
echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1
|
||||
}
|
||||
@ -74,9 +92,10 @@ check_package() {
|
||||
# Helper function to add an extension.
|
||||
add_extension_helper() {
|
||||
local extension=$1
|
||||
package=php"$version"-"$extension"
|
||||
packages=(php"$version"-"$extension")
|
||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||
(check_package "$package" && install_packages "$package") || pecl_install "$extension"
|
||||
[ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym)
|
||||
(check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension"
|
||||
add_extension_log "$extension" "Installed and enabled"
|
||||
sudo chmod 777 "${ini_file[@]}"
|
||||
}
|
||||
@ -87,14 +106,14 @@ add_devtools() {
|
||||
if ! command -v "$tool$version" >/dev/null; then
|
||||
install_packages "php$version-dev"
|
||||
fi
|
||||
add_extension xml extension >/dev/null 2>&1
|
||||
switch_version "phpize" "php-config"
|
||||
add_extension xml extension >/dev/null 2>&1
|
||||
add_log "${tick:?}" "$tool" "Added $tool $semver"
|
||||
}
|
||||
|
||||
# Function to setup the nightly build from shivammathur/php-builder
|
||||
setup_nightly() {
|
||||
run_script "php-builder" "${runner:?}" "$version"
|
||||
# Function to setup PHP from the shivammathur/php-builder builds.
|
||||
setup_php_builder() {
|
||||
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}"
|
||||
}
|
||||
|
||||
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
||||
@ -102,6 +121,11 @@ setup_old_versions() {
|
||||
run_script "php5-ubuntu" "$version"
|
||||
}
|
||||
|
||||
# Function to setup PHP from the cached builds.
|
||||
setup_cached_versions() {
|
||||
run_script "php-ubuntu" "$version" "${debug:?}" "${ts:?}"
|
||||
}
|
||||
|
||||
# Function to add PECL.
|
||||
add_pecl() {
|
||||
add_devtools phpize >/dev/null 2>&1
|
||||
@ -115,8 +139,14 @@ add_pecl() {
|
||||
|
||||
# Function to switch versions of PHP binaries.
|
||||
switch_version() {
|
||||
tools=("$@") && ! (( ${#tools[@]} )) && tools+=(pear pecl php phar phar.phar php-cgi php-config phpize phpdbg)
|
||||
tools=("$@")
|
||||
to_wait=()
|
||||
if ! (( ${#tools[@]} )); then
|
||||
tools+=(pear pecl php phar phar.phar php-cgi php-config phpize phpdbg)
|
||||
[ -e /usr/lib/cgi-bin/php"$version" ] && sudo update-alternatives --set php-cgi-bin /usr/lib/cgi-bin/php"$version" & to_wait+=($!)
|
||||
[ -e /usr/sbin/php-fpm"$version" ] && sudo update-alternatives --set php-fpm /usr/sbin/php-fpm"$version" & to_wait+=($!)
|
||||
[ -e /run/php/php"$version"-fpm.sock ] && sudo update-alternatives --set php-fpm.sock /run/php/php"$version"-fpm.sock & to_wait+=($!)
|
||||
fi
|
||||
for tool in "${tools[@]}"; do
|
||||
if [ -e "/usr/bin/$tool$version" ]; then
|
||||
sudo update-alternatives --set "$tool" /usr/bin/"$tool$version" &
|
||||
@ -126,16 +156,19 @@ switch_version() {
|
||||
wait "${to_wait[@]}"
|
||||
}
|
||||
|
||||
# Function to get packages to install
|
||||
get_php_packages() {
|
||||
sed "s/[^ ]*/php$version-&/g" "$src"/configs/php_packages | tr '\n' ' '
|
||||
if [ "${debug:?}" = "debug" ]; then
|
||||
sed "s/[^ ]*/php$version-&-dbgsym/g" "$src"/configs/php_debug_packages | tr '\n' ' '
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to install packaged PHP
|
||||
add_packaged_php() {
|
||||
if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||
IFS=' ' read -r -a packages <<<"$(sed "s/[^ ]*/php$version-&/g" "$src"/configs/php_packages | tr '\n' ' ')"
|
||||
install_packages "${packages[@]}"
|
||||
add_pecl
|
||||
else
|
||||
run_script "php-ubuntu" "$version"
|
||||
fi
|
||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
|
||||
install_packages "${packages[@]}"
|
||||
}
|
||||
|
||||
# Function to update PHP.
|
||||
@ -152,13 +185,18 @@ update_php() {
|
||||
|
||||
# Function to install PHP.
|
||||
add_php() {
|
||||
if [[ "$version" =~ ${nightly_versions:?} ]]; then
|
||||
setup_nightly
|
||||
if [ "${runner:?}" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
||||
if [[ "$version" =~ ${nightly_versions:?} || "$ts" = "zts" ]]; then
|
||||
setup_php_builder
|
||||
else
|
||||
add_packaged_php
|
||||
switch_version >/dev/null 2>&1
|
||||
add_pecl
|
||||
fi
|
||||
elif [[ "$version" =~ ${old_versions:?} ]]; then
|
||||
setup_old_versions
|
||||
else
|
||||
add_packaged_php
|
||||
switch_version >/dev/null 2>&1
|
||||
setup_cached_versions
|
||||
fi
|
||||
status="Installed"
|
||||
}
|
||||
@ -168,7 +206,10 @@ link_pecl_file() {
|
||||
echo '' | sudo tee "$pecl_file" >/dev/null 2>&1
|
||||
for file in "${ini_file[@]}"; do
|
||||
sapi_scan_dir="$(realpath -m "$(dirname "$file")")/conf.d"
|
||||
[ "$sapi_scan_dir" != "$scan_dir" ] && ! [ -h "$sapi_scan_dir" ] && sudo ln -sf "$pecl_file" "$sapi_scan_dir/99-pecl.ini"
|
||||
if [ "$sapi_scan_dir" != "$scan_dir" ] && ! [ -h "$sapi_scan_dir" ]; then
|
||||
sudo mkdir -p "$sapi_scan_dir"
|
||||
sudo ln -sf "$pecl_file" "$sapi_scan_dir/99-pecl.ini"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
@ -205,8 +246,9 @@ setup_php() {
|
||||
step_log "Setup PHP"
|
||||
sudo mkdir -m 777 -p /var/run /run/php
|
||||
php_config="$(command -v php-config)"
|
||||
check_pre_installed
|
||||
if [[ -z "$php_config" ]] || [ "$(php_semver | cut -c 1-3)" != "$version" ]; then
|
||||
if [ ! -e "/usr/bin/php$version" ]; then
|
||||
if [ ! -e "/usr/bin/php$version" ] || [ ! -e "/usr/bin/php-config$version" ]; then
|
||||
add_php >/dev/null 2>&1
|
||||
else
|
||||
if ! [[ "$version" =~ ${old_versions:?} ]]; then
|
||||
@ -248,7 +290,7 @@ setup_php() {
|
||||
}
|
||||
|
||||
# Variables
|
||||
version=${1:-'8.1'}
|
||||
version=${1:-'8.4'}
|
||||
ini=${2:-'production'}
|
||||
src=${0%/*}/..
|
||||
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
||||
@ -256,6 +298,7 @@ apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends"
|
||||
scripts="$src"/scripts
|
||||
|
||||
add_sudo >/dev/null 2>&1
|
||||
link_apt_fast >/dev/null 2>&1
|
||||
|
||||
. /etc/os-release
|
||||
# shellcheck source=.
|
||||
|
@ -1,7 +1,8 @@
|
||||
# Variables
|
||||
$composer_bin = "$env:APPDATA\Composer\vendor\bin"
|
||||
$composer_json = "$env:APPDATA\Composer\composer.json"
|
||||
$composer_lock = "$env:APPDATA\Composer\composer.lock"
|
||||
$composer_home = "$env:APPDATA\Composer"
|
||||
$composer_bin = "$composer_home\vendor\bin"
|
||||
$composer_json = "$composer_home\composer.json"
|
||||
$composer_lock = "$composer_home\composer.lock"
|
||||
|
||||
# Function to configure composer.
|
||||
Function Edit-ComposerConfig() {
|
||||
@ -16,17 +17,47 @@ Function Edit-ComposerConfig() {
|
||||
php -r "try {`$p=new Phar('$tool_path.phar', 0);exit(0);} catch(Exception `$e) {exit(1);}"
|
||||
if ($? -eq $False) {
|
||||
Add-Log "$cross" "composer" "Could not download composer"
|
||||
exit 1;
|
||||
Write-Error "Could not download composer" -ErrorAction Stop
|
||||
}
|
||||
New-Item -ItemType Directory -Path $composer_bin -Force > $null 2>&1
|
||||
if (-not(Test-Path $composer_json)) {
|
||||
Set-Content -Path $composer_json -Value "{}"
|
||||
}
|
||||
Add-EnvPATH $src\configs\composer.env
|
||||
Set-ComposerEnv
|
||||
Add-Path $composer_bin
|
||||
if (Test-Path env:COMPOSER_TOKEN) {
|
||||
Add-Env COMPOSER_AUTH ('{"github-oauth": {"github.com": "' + $env:COMPOSER_TOKEN + '"}}')
|
||||
Set-ComposerAuth
|
||||
}
|
||||
|
||||
# Function to setup authentication in composer.
|
||||
Function Set-ComposerAuth() {
|
||||
if(Test-Path env:COMPOSER_AUTH_JSON) {
|
||||
if(Test-Json -JSON $env:COMPOSER_AUTH_JSON) {
|
||||
Set-Content -Path $composer_home\auth.json -Value $env:COMPOSER_AUTH_JSON
|
||||
} else {
|
||||
Add-Log "$cross" "composer" "Could not parse COMPOSER_AUTH_JSON as valid JSON"
|
||||
}
|
||||
}
|
||||
$composer_auth = @()
|
||||
if(Test-Path env:PACKAGIST_TOKEN) {
|
||||
$composer_auth += '"http-basic": {"repo.packagist.com": { "username": "token", "password": "' + $env:PACKAGIST_TOKEN + '"}}'
|
||||
}
|
||||
if(-not(Test-Path env:GITHUB_TOKEN) -and (Test-Path env:COMPOSER_TOKEN)) {
|
||||
$env:GITHUB_TOKEN = $env:COMPOSER_TOKEN
|
||||
}
|
||||
if (Test-Path env:GITHUB_TOKEN) {
|
||||
$composer_auth += '"github-oauth": {"github.com": "' + $env:GITHUB_TOKEN + '"}'
|
||||
}
|
||||
if($composer_auth.length) {
|
||||
Add-Env COMPOSER_AUTH ('{' + ($composer_auth -join ',') + '}')
|
||||
}
|
||||
}
|
||||
|
||||
# Function to set composer environment variables.
|
||||
Function Set-ComposerEnv() {
|
||||
if ($env:COMPOSER_PROCESS_TIMEOUT) {
|
||||
(Get-Content $src\configs\composer.env -Raw) -replace '(?m)^COMPOSER_PROCESS_TIMEOUT=.*$', "COMPOSER_PROCESS_TIMEOUT=$env:COMPOSER_PROCESS_TIMEOUT" | Set-Content $src\configs\composer.env
|
||||
}
|
||||
Add-EnvPATH $src\configs\composer.env
|
||||
}
|
||||
|
||||
# Function to extract tool version.
|
||||
@ -34,10 +65,10 @@ Function Get-ToolVersion() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
$tool,
|
||||
[Parameter(Position = 1, Mandatory = $true)]
|
||||
[Parameter(Position = 1, Mandatory = $false)]
|
||||
$param
|
||||
)
|
||||
$alp = "[a-zA-Z0-9]"
|
||||
$alp = "[a-zA-Z0-9\.]"
|
||||
$version_regex = "[0-9]+((\.{1}$alp+)+)(\.{0})(-$alp+){0,1}"
|
||||
if($tool -eq 'composer') {
|
||||
$composer_branch_alias = Select-String -Pattern "const\sBRANCH_ALIAS_VERSION" -Path $bin_dir\composer -Raw | Select-String -Pattern $version_regex | ForEach-Object { $_.matches.Value }
|
||||
@ -49,7 +80,9 @@ Function Get-ToolVersion() {
|
||||
Set-Variable -Name 'composer_version' -Value $composer_version -Scope Global
|
||||
return "$composer_version"
|
||||
}
|
||||
return . $tool $param 2> $null | ForEach-Object { $_ -replace "composer $version_regex", '' } | Select-String -Pattern $version_regex | Select-Object -First 1 | ForEach-Object { $_.matches.Value }
|
||||
if($null -ne $param) {
|
||||
return . $tool $param 2> $null | ForEach-Object { $_ -replace "composer $version_regex", '' } | Select-String -Pattern $version_regex | Select-Object -First 1 | ForEach-Object { $_.matches.Value }
|
||||
}
|
||||
}
|
||||
|
||||
# Helper function to configure tools.
|
||||
@ -60,13 +93,22 @@ Function Add-ToolsHelper() {
|
||||
$tool
|
||||
)
|
||||
$extensions = @();
|
||||
if($tool -eq "codeception") {
|
||||
if($tool -eq "box") {
|
||||
$extensions += @('iconv', 'mbstring', 'phar', 'sodium')
|
||||
} elseif($tool -eq "codeception") {
|
||||
$extensions += @('json', 'mbstring')
|
||||
Copy-Item $env:codeception_bin\codecept.bat -Destination $env:codeception_bin\codeception.bat
|
||||
} elseif($tool -eq "composer") {
|
||||
Edit-ComposerConfig $bin_dir\$tool
|
||||
} elseif($tool -eq "cs2pr") {
|
||||
(Get-Content $bin_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $bin_dir/cs2pr
|
||||
} elseif($tool -eq "deployer") {
|
||||
if(Test-Path $composer_bin\deployer.phar.bat) {
|
||||
Copy-Item $composer_bin\deployer.phar.bat -Destination $composer_bin\dep.bat
|
||||
}
|
||||
if(Test-Path $composer_bin\dep.bat) {
|
||||
Copy-Item $composer_bin\dep.bat -Destination $composer_bin\deployer.bat
|
||||
}
|
||||
} elseif($tool -eq "phan") {
|
||||
$extensions += @('fileinfo', 'ast')
|
||||
} elseif($tool -eq "phinx") {
|
||||
@ -105,8 +147,7 @@ Function Add-Tool() {
|
||||
[Parameter(Position = 1, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
$tool,
|
||||
[Parameter(Position = 2, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
[Parameter(Position = 2, Mandatory = $false)]
|
||||
$ver_param
|
||||
)
|
||||
if (Test-Path $bin_dir\$tool) {
|
||||
@ -122,7 +163,7 @@ Function Add-Tool() {
|
||||
} catch {
|
||||
if($url -match '.*github.com.*releases.*latest.*') {
|
||||
try {
|
||||
$url = $url.replace("releases/latest/download", "releases/download/" + ([regex]::match((Invoke-WebRequest -Uri ($url.split('/release')[0] + "/releases")).Content, "([0-9]+\.[0-9]+\.[0-9]+)/" + ($url.Substring($url.LastIndexOf("/") + 1))).Groups[0].Value).split('/')[0])
|
||||
$url = $url.replace("releases/latest/download", "releases/download/" + ([regex]::match((Get-File -Url ($url.split('/release')[0] + "/releases")).Content, "([0-9]+\.[0-9]+\.[0-9]+)/" + ($url.Substring($url.LastIndexOf("/") + 1))).Groups[0].Value).split('/')[0])
|
||||
$status_code = (Invoke-WebRequest -Passthru -Uri $url -OutFile $tool_path).StatusCode
|
||||
} catch { }
|
||||
}
|
||||
@ -153,7 +194,7 @@ Function Add-Tool() {
|
||||
}
|
||||
}
|
||||
|
||||
Function Add-ComposertoolHelper() {
|
||||
Function Add-ComposerToolHelper() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[string]
|
||||
@ -171,10 +212,17 @@ Function Add-ComposertoolHelper() {
|
||||
[string]
|
||||
$composer_args
|
||||
)
|
||||
$tool_version = $release.split(':')[1]
|
||||
if($NULL -eq $tool_version) {
|
||||
$tool_version = '*'
|
||||
}
|
||||
if($scope -eq 'global') {
|
||||
if(Test-Path $composer_lock) {
|
||||
Remove-Item -Path $composer_lock -Force
|
||||
}
|
||||
if((composer global show $prefix$tool $tool_version -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
|
||||
composer global config --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
|
||||
}
|
||||
composer global require $prefix$release $composer_args >$null 2>&1
|
||||
return composer global show $prefix$tool 2>&1 | findstr '^versions'
|
||||
} else {
|
||||
@ -184,6 +232,10 @@ Function Add-ComposertoolHelper() {
|
||||
$unix_scoped_dir = $scoped_dir.replace('\', '/')
|
||||
if(-not(Test-Path $scoped_dir)) {
|
||||
New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1
|
||||
Set-Content -Path $scoped_dir\composer.json -Value "{}"
|
||||
if((composer show $prefix$tool $tool_version -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
|
||||
composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
|
||||
}
|
||||
composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1
|
||||
}
|
||||
[System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
|
||||
@ -193,7 +245,7 @@ Function Add-ComposertoolHelper() {
|
||||
}
|
||||
|
||||
# Function to setup a tool using composer.
|
||||
Function Add-Composertool() {
|
||||
Function Add-ComposerTool() {
|
||||
Param (
|
||||
[Parameter(Position = 0, Mandatory = $true)]
|
||||
[ValidateNotNull()]
|
||||
@ -216,6 +268,7 @@ Function Add-Composertool() {
|
||||
[string]
|
||||
$scope
|
||||
)
|
||||
$composer_args = ""
|
||||
if($composer_version.split('.')[0] -ne "1") {
|
||||
$composer_args = "--ignore-platform-req=ext-*"
|
||||
if($tool -match "prestissimo|composer-prefetcher") {
|
||||
@ -225,7 +278,7 @@ Function Add-Composertool() {
|
||||
}
|
||||
}
|
||||
Enable-PhpExtension -Extension curl, mbstring, openssl -Path $php_dir
|
||||
$log = Add-ComposertoolHelper $tool $release $prefix $scope $composer_args
|
||||
$log = Add-ComposerToolHelper $tool $release $prefix $scope $composer_args
|
||||
if(Test-Path $composer_bin\composer) {
|
||||
Copy-Item -Path "$bin_dir\composer" -Destination "$composer_bin\composer" -Force
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ export composer_lock="$composer_home/composer.lock"
|
||||
get_tool_version() {
|
||||
tool=$1
|
||||
param=$2
|
||||
alp="[a-zA-Z0-9]"
|
||||
alp="[a-zA-Z0-9\.]"
|
||||
version_regex="[0-9]+((\.{1}$alp+)+)(\.{0})(-$alp+){0,1}"
|
||||
if [ "$tool" = "composer" ]; then
|
||||
composer_alias_version="$(grep -Ea "const\sBRANCH_ALIAS_VERSION" "$tool_path_dir/composer" | grep -Eo "$version_regex")"
|
||||
@ -19,7 +19,7 @@ get_tool_version() {
|
||||
composer_version="$(grep -Ea "const\sVERSION" "$tool_path_dir/composer" | grep -Eo "$version_regex")"
|
||||
fi
|
||||
echo "$composer_version" | sudo tee /tmp/composer_version
|
||||
else
|
||||
elif [ -n "$param" ]; then
|
||||
$tool "$param" 2>/dev/null | sed -Ee "s/[Cc]omposer(.)?$version_regex//g" | grep -Eo "$version_regex" | head -n 1
|
||||
fi
|
||||
}
|
||||
@ -42,18 +42,51 @@ configure_composer() {
|
||||
echo '{}' | tee "$composer_json" >/dev/null
|
||||
chmod 644 "$composer_json"
|
||||
fi
|
||||
add_env_path "${src:?}"/configs/composer.env
|
||||
set_composer_env
|
||||
add_path "$composer_bin"
|
||||
if [ -n "$COMPOSER_TOKEN" ]; then
|
||||
add_env COMPOSER_AUTH '{"github-oauth": {"github.com": "'"$COMPOSER_TOKEN"'"}}'
|
||||
set_composer_auth
|
||||
}
|
||||
|
||||
# Function to setup authentication in composer.
|
||||
set_composer_auth() {
|
||||
if [ -n "$COMPOSER_AUTH_JSON" ]; then
|
||||
if php -r "json_decode('$COMPOSER_AUTH_JSON'); if(json_last_error() !== JSON_ERROR_NONE) { throw new Exception('invalid json'); }"; then
|
||||
echo "$COMPOSER_AUTH_JSON" | tee "$composer_home/auth.json" >/dev/null
|
||||
else
|
||||
add_log "${cross:?}" "composer" "Could not parse COMPOSER_AUTH_JSON as valid JSON"
|
||||
fi
|
||||
fi
|
||||
composer_auth=()
|
||||
if [ -n "$PACKAGIST_TOKEN" ]; then
|
||||
composer_auth+=( '"http-basic": {"repo.packagist.com": { "username": "token", "password": "'"$PACKAGIST_TOKEN"'"}}' )
|
||||
fi
|
||||
if [ -n "${GITHUB_TOKEN:-$COMPOSER_TOKEN}" ]; then
|
||||
composer_auth+=( '"github-oauth": {"github.com": "'"${GITHUB_TOKEN:-$COMPOSER_TOKEN}"'"}' )
|
||||
fi
|
||||
if ((${#composer_auth[@]})); then
|
||||
add_env COMPOSER_AUTH "{$(IFS=$','; echo "${composer_auth[*]}")}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to set composer environment variables.
|
||||
set_composer_env() {
|
||||
composer_env="${src:?}"/configs/composer.env
|
||||
if [ -n "$COMPOSER_PROCESS_TIMEOUT" ]; then
|
||||
sed_arg="s/COMPOSER_PROCESS_TIMEOUT.*/COMPOSER_PROCESS_TIMEOUT=$COMPOSER_PROCESS_TIMEOUT/"
|
||||
sed -i "$sed_arg" "$composer_env" 2>/dev/null || sed -i '' "$sed_arg" "$composer_env"
|
||||
fi
|
||||
add_env_path "$composer_env"
|
||||
}
|
||||
|
||||
# Helper function to configure tools.
|
||||
add_tools_helper() {
|
||||
tool=$1
|
||||
extensions=()
|
||||
if [ "$tool" = "codeception" ]; then
|
||||
if [ "$tool" = "blackfire-player" ]; then
|
||||
extensions+=(uuid)
|
||||
elif [ "$tool" = "box" ]; then
|
||||
extensions+=(iconv mbstring phar sodium)
|
||||
elif [ "$tool" = "codeception" ]; then
|
||||
extensions+=(json mbstring)
|
||||
sudo ln -s "$scoped_dir"/vendor/bin/codecept "$scoped_dir"/vendor/bin/codeception
|
||||
elif [ "$tool" = "composer" ]; then
|
||||
@ -61,6 +94,13 @@ add_tools_helper() {
|
||||
elif [ "$tool" = "cs2pr" ]; then
|
||||
sudo sed -i 's/\r$//; s/exit(9)/exit(0)/' "$tool_path" 2>/dev/null ||
|
||||
sudo sed -i '' 's/\r$//; s/exit(9)/exit(0)/' "$tool_path"
|
||||
elif [ "$tool" = "deployer" ]; then
|
||||
if [ -e "$composer_bin"/deployer.phar ]; then
|
||||
sudo ln -s "$composer_bin"/deployer.phar "$composer_bin"/dep
|
||||
fi
|
||||
if [ -e "$composer_bin"/dep ]; then
|
||||
sudo ln -s "$composer_bin"/dep "$composer_bin"/deployer
|
||||
fi
|
||||
elif [ "$tool" = "phan" ]; then
|
||||
extensions+=(fileinfo ast)
|
||||
elif [ "$tool" = "phinx" ]; then
|
||||
@ -102,6 +142,9 @@ add_tool() {
|
||||
tool=$2
|
||||
ver_param=$3
|
||||
tool_path="$tool_path_dir/$tool"
|
||||
if ! [ -d "$tool_path_dir" ]; then
|
||||
sudo mkdir -p "$tool_path_dir"
|
||||
fi
|
||||
add_path "$tool_path_dir"
|
||||
if [ -e "$tool_path" ]; then
|
||||
sudo cp -aL "$tool_path" /tmp/"$tool"
|
||||
@ -127,21 +170,29 @@ add_tool() {
|
||||
}
|
||||
|
||||
# Function to setup a tool using composer in a different scope.
|
||||
add_composertool_helper() {
|
||||
add_composer_tool_helper() {
|
||||
tool=$1
|
||||
release=$2
|
||||
prefix=$3
|
||||
scope=$4
|
||||
composer_args=$5
|
||||
enable_extensions curl mbstring openssl
|
||||
tool_version=${release##*:}; [ "$tool_version" = "$tool" ] && tool_version="*"
|
||||
if [ "$scope" = "global" ]; then
|
||||
sudo rm -f "$composer_lock" >/dev/null 2>&1 || true
|
||||
if composer global show "$prefix$tool" "$tool_version" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
||||
composer global config --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
||||
fi
|
||||
composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1
|
||||
composer global show "$prefix$tool" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
||||
else
|
||||
scoped_dir="$composer_bin/_tools/$tool-$(echo -n "$release" | shasum -a 256 | cut -d ' ' -f 1)"
|
||||
if ! [ -d "$scoped_dir" ]; then
|
||||
mkdir -p "$scoped_dir"
|
||||
echo '{}' | tee "$scoped_dir/composer.json" >/dev/null
|
||||
if composer show "$prefix$tool" "$tool_version" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
||||
composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
||||
fi
|
||||
composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1
|
||||
composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
||||
fi
|
||||
@ -150,12 +201,13 @@ add_composertool_helper() {
|
||||
}
|
||||
|
||||
# Function to setup a tool using composer.
|
||||
add_composertool() {
|
||||
add_composer_tool() {
|
||||
tool=$1
|
||||
release=$2
|
||||
prefix=$3
|
||||
scope=$4
|
||||
composer_major_version=$(cat /tmp/composer_version | cut -d'.' -f 1)
|
||||
composer_args=
|
||||
composer_major_version=$(cut -d'.' -f 1 /tmp/composer_version)
|
||||
if [ "$composer_major_version" != "1" ]; then
|
||||
composer_args="--ignore-platform-req=ext-*"
|
||||
if [[ "$tool" =~ prestissimo|composer-prefetcher ]]; then
|
||||
@ -164,7 +216,7 @@ add_composertool() {
|
||||
return
|
||||
fi
|
||||
fi
|
||||
add_composertool_helper "$tool" "$release" "$prefix" "$scope" "$composer_args"
|
||||
add_composer_tool_helper "$tool" "$release" "$prefix" "$scope" "$composer_args"
|
||||
tool_version=$(get_tool_version cat /tmp/composer.log)
|
||||
([ -s /tmp/composer.log ] && add_log "$tick" "$tool" "Added $tool $tool_version"
|
||||
) || add_log "$cross" "$tool" "Could not setup $tool"
|
||||
|
@ -6,7 +6,7 @@ Function Add-Blackfire() {
|
||||
}
|
||||
$cli_version = (Invoke-RestMethod https://blackfire.io/api/v1/releases).cli
|
||||
$url = "https://packages.blackfire.io/binaries/blackfire/${cli_version}/blackfire-windows_${arch_name}.zip"
|
||||
Invoke-WebRequest -Uri $url -OutFile $bin_dir\blackfire.zip >$null 2>&1
|
||||
Get-File -Url $url -OutFile $bin_dir\blackfire.zip >$null 2>&1
|
||||
Expand-Archive -Path $bin_dir\blackfire.zip -DestinationPath $bin_dir -Force >$null 2>&1
|
||||
Add-ToProfile $current_profile 'blackfire' "New-Alias blackfire $bin_dir\blackfire.exe"
|
||||
if ((Test-Path env:BLACKFIRE_SERVER_ID) -and (Test-Path env:BLACKFIRE_SERVER_TOKEN)) {
|
||||
|
84
src/scripts/tools/brew.sh
Normal file
84
src/scripts/tools/brew.sh
Normal file
@ -0,0 +1,84 @@
|
||||
# Function to fetch a brew tap.
|
||||
fetch_brew_tap() {
|
||||
tap=$1
|
||||
tap_user=$(dirname "$tap")
|
||||
tap_name=$(basename "$tap")
|
||||
mkdir -p "$tap_dir/$tap_user"
|
||||
branch="$(git ls-remote --symref "https://github.com/$tap" HEAD | grep -Eo 'refs/heads/.*' | tr '\t' '\n' | head -1 | cut -d '/' -f 3)"
|
||||
get -s -n "" "https://github.com/$tap/archive/$branch.tar.gz" | sudo tar -xzf - -C "$tap_dir/$tap_user"
|
||||
sudo mv "$tap_dir/$tap_user/$tap_name-$branch" "$tap_dir/$tap_user/$tap_name"
|
||||
}
|
||||
|
||||
# Function to add a brew tap.
|
||||
add_brew_tap() {
|
||||
tap=$1
|
||||
if ! [ -d "$tap_dir/$tap" ]; then
|
||||
if [ "${runner:?}" = "self-hosted" ]; then
|
||||
brew tap "$tap" >/dev/null 2>&1
|
||||
else
|
||||
fetch_brew_tap "$tap" >/dev/null 2>&1
|
||||
if ! [ -d "$tap_dir/$tap" ]; then
|
||||
brew tap "$tap" >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to get brew prefix.
|
||||
get_brew_prefix() {
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
echo /home/linuxbrew/.linuxbrew
|
||||
else
|
||||
if [ "$(uname -m)" = "arm64" ]; then
|
||||
echo /opt/homebrew
|
||||
else
|
||||
echo /usr/local
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to add brew's bin directories to the PATH.
|
||||
add_brew_bins_to_path() {
|
||||
local brew_prefix=${1:-$(get_brew_prefix)}
|
||||
add_path "$brew_prefix"/bin
|
||||
add_path "$brew_prefix"/sbin
|
||||
}
|
||||
|
||||
# Function to add brew.
|
||||
add_brew() {
|
||||
brew_prefix="$(get_brew_prefix)"
|
||||
if ! [ -d "$brew_prefix"/bin ]; then
|
||||
step_log "Setup Brew"
|
||||
get -s "" "/tmp/install.sh" "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" | bash -s >/dev/null 2>&1
|
||||
add_log "${tick:?}" "Brew" "Installed Homebrew"
|
||||
fi
|
||||
add_brew_bins_to_path "$brew_prefix"
|
||||
}
|
||||
|
||||
# Function to configure brew constants.
|
||||
configure_brew() {
|
||||
brew_path="$(command -v brew)"
|
||||
if [ -z "$brew_path" ]; then
|
||||
add_brew
|
||||
brew_path="$(command -v brew)"
|
||||
fi
|
||||
brew_opts=(-f)
|
||||
brew_path_dir="$(dirname "$brew_path")"
|
||||
brew_prefix="$brew_path_dir"/..
|
||||
brew_repo="$brew_path_dir/$(dirname "$(readlink "$brew_path")")"/..
|
||||
tap_dir="$brew_repo"/Library/Taps
|
||||
core_repo="$tap_dir"/homebrew/homebrew-core
|
||||
|
||||
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
export brew_opts
|
||||
export brew_path
|
||||
export brew_path_dir
|
||||
export brew_prefix
|
||||
export brew_repo
|
||||
export tap_dir
|
||||
export core_repo
|
||||
}
|
@ -7,9 +7,15 @@ Function Add-Msys2() {
|
||||
return $msys_location
|
||||
}
|
||||
|
||||
Function Add-Grpc_php_plugin() {
|
||||
Function Add-GrpcPhpPlugin() {
|
||||
$msys_location = Add-Msys2
|
||||
$logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" >$null 2>&1
|
||||
$arch = arch
|
||||
if($arch -eq 'arm64' -or $arch -eq 'aarch64') {
|
||||
$grpc_package = 'mingw-w64-clang-aarch64-grpc'
|
||||
} else {
|
||||
$grpc_package = 'mingw-w64-x86_64-grpc'
|
||||
}
|
||||
$logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm $grpc_package" >$null 2>&1
|
||||
$grpc_version = Get-ToolVersion 'Write-Output' "$logs"
|
||||
Add-Path $msys_location\mingw64\bin
|
||||
Set-Output grpc_php_plugin_path "$msys_location\mingw64\bin\grpc_php_plugin.exe"
|
||||
|
@ -22,8 +22,12 @@ get_grpc_tag() {
|
||||
}
|
||||
|
||||
add_grpc_php_plugin_brew() {
|
||||
. "${0%/*}"/tools/brew.sh
|
||||
configure_brew
|
||||
[ -e /usr/local/bin/protoc ] && sudo mv /usr/local/bin/protoc /tmp/protoc && sudo mv /usr/local/include/google /tmp
|
||||
brew install grpc
|
||||
brew link --force --overwrite grpc >/dev/null 2>&1
|
||||
[ -e /tmp/protoc ] && sudo mv /tmp/protoc /usr/local/bin/protoc && sudo mv /tmp/google /usr/local/include/
|
||||
grpc_tag="v$(brew info grpc | grep "grpc:" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")"
|
||||
license_path="$(brew --prefix grpc)/LICENSE"
|
||||
}
|
||||
|
@ -31,10 +31,6 @@ set_base_version() {
|
||||
else
|
||||
set_base_version_codename
|
||||
set_base_version_id
|
||||
|
||||
# Remove once PPAs start having bookworm releases
|
||||
[ "$VERSION_CODENAME" = 'bookworm' ] && VERSION_CODENAME="bullseye"
|
||||
|
||||
printf "ID=%s\nVERSION_ID=%s\nVERSION_CODENAME=%s\n" "$ID" "$VERSION_ID" "$VERSION_CODENAME" | tee /tmp/os-release >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
@ -58,8 +54,8 @@ update_lists() {
|
||||
status_file=/tmp/os_lists
|
||||
if [[ -n "$ppa" && -n "$ppa_search" ]]; then
|
||||
list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
|
||||
status_file=/tmp/"${ppa/\//_}"
|
||||
elif grep -Eq '^deb ' "$list_file"; then
|
||||
status_file=/tmp/"$(echo -n "$ppa_search" | shasum -a 256 | cut -d ' ' -f 1)"
|
||||
elif [ -e "$list_file" ] && grep -Eq '^deb |^Types deb' "$list_file"; then
|
||||
list="$list_file"
|
||||
fi
|
||||
if [ ! -e "$status_file" ]; then
|
||||
@ -71,7 +67,7 @@ update_lists() {
|
||||
# Function to get fingerprint from an Ubuntu PPA.
|
||||
ubuntu_fingerprint() {
|
||||
ppa=$1
|
||||
get -s -n "" "$lp_api"/~"${ppa%/*}"/+archive/"${ppa##*/}" | jq -r '.signing_key_fingerprint'
|
||||
get -s -n "" "${lp_api[@]/%//~${ppa%/*}/+archive/${ppa##*/}}" | jq -r '.signing_key_fingerprint'
|
||||
}
|
||||
|
||||
# Function to get fingerprint from a Debian PPA.
|
||||
@ -92,7 +88,7 @@ add_key() {
|
||||
key_source=$4
|
||||
key_file=$5
|
||||
key_urls=("$key_source")
|
||||
if [[ "$key_source" =~ launchpad.net|debian.org|setup-php.com ]]; then
|
||||
if [[ "$key_source" =~ launchpadcontent.net|debian.org ]]; then
|
||||
fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist")"
|
||||
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
|
||||
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
|
||||
@ -121,11 +117,11 @@ check_lists() {
|
||||
# Function to add a sources list.
|
||||
add_list() {
|
||||
ppa=${1-ondrej/php}
|
||||
ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
|
||||
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
||||
key_source=${3:-"$ppa_url"}
|
||||
package_dist=${4:-"$VERSION_CODENAME"}
|
||||
branches=${5:-main}
|
||||
ppa_search="deb .*$ppa_url $package_dist .*$branches"
|
||||
ppa_search="deb .*$ppa_url $package_dist .*$branches$"
|
||||
if check_lists "$ppa" "$ppa_search"; then
|
||||
echo "Repository $ppa already exists";
|
||||
return 1;
|
||||
@ -140,21 +136,58 @@ add_list() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# Function to check if a PPA exists
|
||||
check_ppa() {
|
||||
ppa=$1
|
||||
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
||||
package_dist=${3:-"$VERSION_CODENAME"}
|
||||
branches=${4:-main}
|
||||
ppa_search="deb .*$ppa_url $package_dist .*$branches$"
|
||||
if check_lists "$ppa" "$ppa_search"; then
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to remove a PPA.
|
||||
remove_list() {
|
||||
ppa=${1-ondrej/php}
|
||||
ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
|
||||
grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
|
||||
[ -n "$2" ] && ppa_urls=("$2") || ppa_urls=("$lp_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu")
|
||||
for ppa_url in "${ppa_urls[@]}"; do
|
||||
grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
|
||||
done
|
||||
sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring || true
|
||||
}
|
||||
|
||||
# Function to check if ubuntu ppa is up
|
||||
is_ubuntu_ppa_up() {
|
||||
ppa=${1:-ondrej/php}
|
||||
curl -s --connect-timeout 5 --max-time 5 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
|
||||
}
|
||||
|
||||
# Function to add the PPA mirror.
|
||||
add_ppa_sp_mirror() {
|
||||
ppa=$1
|
||||
ppa_name="$(basename "$ppa")"
|
||||
remove_list "$ppa" || true
|
||||
[ "${debug:?}" = "debug" ] && add_list sp/"$ppa_name" "$sp/$ppa/ubuntu" "$sp/$ppa/ubuntu/key.gpg" "$VERSION_CODENAME" "main/debug"
|
||||
add_list sp/"$ppa_name" "$sp/$ppa/ubuntu" "$sp/$ppa/ubuntu/key.gpg"
|
||||
}
|
||||
|
||||
# Function to add a PPA.
|
||||
add_ppa() {
|
||||
set_base_version
|
||||
ppa=${1:-ondrej/php}
|
||||
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||
add_list "$ppa"
|
||||
if is_ubuntu_ppa_up "$ppa" ; then
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lpc_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||
add_list "$ppa"
|
||||
else
|
||||
add_ppa_sp_mirror "$ppa"
|
||||
fi
|
||||
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug"
|
||||
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
||||
else
|
||||
add_list "$ppa"
|
||||
@ -168,7 +201,7 @@ add_ppa() {
|
||||
update_ppa() {
|
||||
set_base_version
|
||||
ppa=${1:-ondrej/php}
|
||||
ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
|
||||
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
||||
package_dist=${4:-"$VERSION_CODENAME"}
|
||||
branches=${5:-main}
|
||||
ppa_search="deb .*$ppa_url $package_dist .*$branches"
|
||||
@ -177,14 +210,20 @@ update_ppa() {
|
||||
}
|
||||
|
||||
# Variables
|
||||
list_file='/etc/apt/sources.list'
|
||||
list_dir="$list_file.d"
|
||||
list_dir='/etc/apt/sources.list.d'
|
||||
list_file="/etc/apt/sources.list.d/$ID.sources"
|
||||
[ -e "$list_file" ] || list_file='/etc/apt/sources.list'
|
||||
upstream_lsb='/etc/upstream-release/lsb-release'
|
||||
lp_api='https://api.launchpad.net/1.0'
|
||||
lp_api=(
|
||||
'https://api.launchpad.net/1.0'
|
||||
'https://api.launchpad.net/devel'
|
||||
)
|
||||
lp_ppa='http://ppa.launchpad.net'
|
||||
lpc_ppa='https://ppa.launchpadcontent.net'
|
||||
key_dir='/usr/share/keyrings'
|
||||
dist_info_dir='/usr/share/distro-info'
|
||||
sury='https://packages.sury.org'
|
||||
sp='https://setup-php.com'
|
||||
sks=(
|
||||
'https://keyserver.ubuntu.com'
|
||||
'https://pgp.mit.edu'
|
||||
|
@ -1,15 +1,17 @@
|
||||
Function Get-ProtobufTag() {
|
||||
$releases = 'https://github.com/protocolbuffers/protobuf/releases'
|
||||
if("$protobuf_tag" -eq "latest") {
|
||||
$protobuf_tag = (Invoke-RestMethod https://api.github.com/repos/protocolbuffers/protobuf/tags).Name | Where-Object { $_ -match "v\d+.\d+.\d+$" } | Select-Object -First 1
|
||||
$protobuf_tag = (Get-File -Url $releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1]
|
||||
} else {
|
||||
try {
|
||||
[net.httpWebRequest] $request = [net.webRequest]::create("https://github.com/protocolbuffers/protobuf/releases/tag/v$protobuf_tag")
|
||||
$req.Method = "HEAD"
|
||||
$protobuf_tag = $protobuf_tag -replace '^v', ''
|
||||
[net.httpWebRequest] $request = [net.webRequest]::create("$releases/tag/v$protobuf_tag")
|
||||
$request.Method = "HEAD"
|
||||
[net.httpWebResponse] $response = $request.getResponse()
|
||||
$response.Close()
|
||||
$protobuf_tag = "v$protobuf_tag"
|
||||
} catch {
|
||||
$protobuf_tag = (Invoke-RestMethod https://api.github.com/repos/protocolbuffers/protobuf/tags).Name | Where-Object { $_ -match "v\d+.\d+.\d+$" } | Select-Object -First 1
|
||||
$protobuf_tag = (Get-File -Url $releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1]
|
||||
}
|
||||
}
|
||||
return $protobuf_tag
|
||||
@ -18,7 +20,7 @@ Function Get-ProtobufTag() {
|
||||
Function Add-Protoc() {
|
||||
param(
|
||||
[Parameter(Mandatory = $true, Position = 0, HelpMessage = 'The PHP version to be installed')]
|
||||
[ValidatePattern('^latest$|^(v?)\d+\.\d+\.\d+$')]
|
||||
[ValidatePattern('^latest$|^(v?)\d+\.\d+(\.\d+)?$')]
|
||||
[string] $protobuf_tag
|
||||
)
|
||||
$protobuf_tag = Get-ProtobufTag
|
||||
@ -27,7 +29,7 @@ Function Add-Protoc() {
|
||||
$arch_num = '32'
|
||||
}
|
||||
$url = "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-$($protobuf_tag -replace 'v', '')-win$arch_num.zip"
|
||||
Invoke-WebRequest -Uri $url -OutFile $bin_dir\protoc.zip >$null 2>&1
|
||||
Get-File -Url $url -OutFile $bin_dir\protoc.zip >$null 2>&1
|
||||
Expand-Archive -Path $bin_dir\protoc.zip -DestinationPath $bin_dir\protoc -Force >$null 2>&1
|
||||
Move-Item -Path $bin_dir\protoc\bin\protoc.exe -Destination $bin_dir\protoc.exe
|
||||
Add-ToProfile $current_profile 'protoc' "New-Alias protoc $bin_dir\protoc.exe"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user