mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-04 14:13:16 +07:00
Compare commits
81 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
1
.github/workflows/node.yml
vendored
1
.github/workflows/node.yml
vendored
@ -52,7 +52,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Run npm audit
|
- name: Run npm audit
|
||||||
run: npm audit
|
run: npm audit
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Send Coverage
|
- name: Send Coverage
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
|
2
.github/workflows/php.yml
vendored
2
.github/workflows/php.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04, windows-2019, macos-latest]
|
operating-system: [ubuntu-22.04, 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']
|
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']
|
||||||
env:
|
env:
|
||||||
extensions: xml, opcache, xdebug, pcov, gd
|
extensions: xml, opcache, xdebug, pcov, gd
|
||||||
key: cache-v5
|
key: cache-v5
|
||||||
|
157
README.md
157
README.md
@ -10,7 +10,7 @@
|
|||||||
<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://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://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="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="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.3-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<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>
|
<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>
|
||||||
@ -42,6 +42,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
|||||||
- [Basic Setup](#basic-setup)
|
- [Basic Setup](#basic-setup)
|
||||||
- [Matrix Setup](#matrix-setup)
|
- [Matrix Setup](#matrix-setup)
|
||||||
- [Nightly Build Setup](#nightly-build-setup)
|
- [Nightly Build Setup](#nightly-build-setup)
|
||||||
|
- [Debug Build Setup](#debug-build-setup)
|
||||||
- [Thread Safe Setup](#thread-safe-setup)
|
- [Thread Safe Setup](#thread-safe-setup)
|
||||||
- [Force Update Setup](#force-update-setup)
|
- [Force Update Setup](#force-update-setup)
|
||||||
- [Verbose Setup](#verbose-setup)
|
- [Verbose Setup](#verbose-setup)
|
||||||
@ -70,16 +71,15 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
|||||||
|
|
||||||
### GitHub-Hosted Runners
|
### GitHub-Hosted Runners
|
||||||
|
|
||||||
| Virtual environment | YAML workflow label | Pre-installed PHP |
|
| Virtual environment | YAML workflow label | Pre-installed PHP |
|
||||||
|----------------------|------------------------------------|------------------------|
|
|---------------------|------------------------------------|------------------------|
|
||||||
| Ubuntu 22.04 | `ubuntu-22.04` | `PHP 8.1` |
|
| Ubuntu 22.04 | `ubuntu-latest` or `ubuntu-22.04` | `PHP 8.1` |
|
||||||
| Ubuntu 20.04 | `ubuntu-latest` or `ubuntu-20.04` | `PHP 7.4` to `PHP 8.1` |
|
| Ubuntu 20.04 | `ubuntu-20.04` | `PHP 7.4` to `PHP 8.2` |
|
||||||
| Ubuntu 18.04 | `ubuntu-18.04` | `PHP 7.2` to `PHP 8.1` |
|
| Ubuntu 18.04 | `ubuntu-18.04` | `PHP 7.2` to `PHP 8.2` |
|
||||||
| Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.1` |
|
| Windows Server 2022 | `windows-latest` or `windows-2022` | `PHP 8.2` |
|
||||||
| Windows Server 2019 | `windows-2019` | `PHP 8.1` |
|
| Windows Server 2019 | `windows-2019` | `PHP 8.2` |
|
||||||
| macOS Monterey 12.x | `macos-12` | `PHP 8.1` |
|
| macOS Monterey 12.x | `macos-12` | `PHP 8.2` |
|
||||||
| macOS Big Sur 11.x | `macos-latest` or `macos-11` | `PHP 8.1` |
|
| macOS Big Sur 11.x | `macos-latest` or `macos-11` | `PHP 8.2` |
|
||||||
| macOS Catalina 10.15 | `macos-10.15` | `PHP 8.1` |
|
|
||||||
|
|
||||||
### Self-Hosted Runners
|
### Self-Hosted Runners
|
||||||
|
|
||||||
@ -92,9 +92,9 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
|||||||
| Debian 10 | `self-hosted` or `Linux` |
|
| Debian 10 | `self-hosted` or `Linux` |
|
||||||
| Windows 7 and newer | `self-hosted` or `Windows` |
|
| Windows 7 and newer | `self-hosted` or `Windows` |
|
||||||
| Windows Server 2012 R2 and newer | `self-hosted` or `Windows` |
|
| Windows Server 2012 R2 and newer | `self-hosted` or `Windows` |
|
||||||
|
| macOS Ventura 13.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||||
| macOS Monterey 12.x x86_64/arm64 | `self-hosted` or `macOS` |
|
| macOS Monterey 12.x x86_64/arm64 | `self-hosted` or `macOS` |
|
||||||
| macOS Big Sur 11.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` |
|
|
||||||
|
|
||||||
- Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
|
- 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.
|
- Operating systems based on the above Ubuntu and Debian versions are also supported on best effort basis.
|
||||||
@ -102,10 +102,10 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
|
|||||||
|
|
||||||
## :tada: PHP Support
|
## :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.3 to PHP 8.3 on GitHub-hosted runners.
|
||||||
- PHP 5.6 to PHP 8.2 on self-hosted runners.
|
- PHP 5.6 to PHP 8.3 on self-hosted runners.
|
||||||
|
|
||||||
| PHP Version | Stability | Release Support | Runner Support |
|
| PHP Version | Stability | Release Support | Runner Support |
|
||||||
|-------------|-----------|-----------------------|--------------------------------|
|
|-------------|-----------|-----------------------|--------------------------------|
|
||||||
@ -117,13 +117,14 @@ 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.1` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `7.2` | `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.3` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `7.4` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
|
| `7.4` | `Stable` | `End of life` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `8.0` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
| `8.0` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `8.1` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
| `8.1` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||||
| `8.2` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
| `8.2` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
|
||||||
|
| `8.3` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
|
||||||
|
|
||||||
**Notes:**
|
**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.
|
- Specifying `8.3` in `php-version` input installs a nightly build of `PHP 8.3.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.
|
- To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
|
||||||
|
|
||||||
## :heavy_plus_sign: PHP Extension Support
|
## :heavy_plus_sign: PHP Extension Support
|
||||||
@ -136,7 +137,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
- name: Setup PHP with PECL extension
|
- name: Setup PHP with PECL extension
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
extensions: imagick, swoole
|
extensions: imagick, swoole
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -164,7 +165,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
- name: Setup PHP with pre-release PECL extension
|
- name: Setup PHP with pre-release PECL extension
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
extensions: xdebug-beta
|
extensions: xdebug-beta
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -176,7 +177,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
- name: Setup PHP and disable opcache
|
- name: Setup PHP and disable opcache
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
extensions: :opcache
|
extensions: :opcache
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -188,7 +189,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
- name: Setup PHP without any shared extensions except mbstring
|
- name: Setup PHP without any shared extensions except mbstring
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
extensions: none, mbstring
|
extensions: none, mbstring
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -198,16 +199,16 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
- name: Setup PHP with intl
|
- name: Setup PHP with intl
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
extensions: intl-70.1
|
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).
|
- 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:
|
- These extensions have custom support:
|
||||||
- `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`.
|
- `cubrid` and `pdo_cubrid` on `Ubuntu`.
|
||||||
- `geos` and `event` on `Ubuntu` and `macOS`.
|
- `event`, `gearman`, `geos` and `relay` on `Ubuntu` and `macOS`.
|
||||||
- `blackfire`, `couchbase`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_oci`, `pecl_http`, `phalcon3`, `phalcon4` and `phalcon5` on all supported OS.
|
- `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`.
|
- 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`.
|
||||||
|
|
||||||
@ -215,7 +216,7 @@ PHP extensions can be set up using the `extensions` input. It accepts a `string`
|
|||||||
- name: Setup PHP with fail-fast
|
- name: Setup PHP with fail-fast
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
extensions: oci8
|
extensions: oci8
|
||||||
env:
|
env:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
@ -225,13 +226,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.
|
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`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
[`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`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP with tools
|
- name: Setup PHP with tools
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: php-cs-fixer, phpunit
|
tools: php-cs-fixer, phpunit
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -241,7 +242,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
|||||||
- name: Setup PHP with tools
|
- name: Setup PHP with tools
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: vimeo/psalm
|
tools: vimeo/psalm
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -261,19 +262,19 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
|||||||
- name: Setup PHP with tools
|
- name: Setup PHP with tools
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: php-cs-fixer:3.5, phpunit:9.5
|
tools: php-cs-fixer:3.5, phpunit:9.5
|
||||||
env:
|
env:
|
||||||
GITHUB_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
|
```yaml
|
||||||
- name: Setup PHP with composer v2
|
- name: Setup PHP with composer v2
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: composer:v2
|
tools: composer:v2
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -283,7 +284,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
|||||||
- name: Setup PHP without composer
|
- name: Setup PHP without composer
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: none
|
tools: none
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -299,7 +300,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
|||||||
- name: Setup PHP with fail-fast
|
- name: Setup PHP with fail-fast
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: deployer
|
tools: deployer
|
||||||
env:
|
env:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
@ -309,6 +310,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
|||||||
- Input `tools` is useful to set up tools which are only used in CI workflows, thus keeping your `composer.json` tidy.
|
- 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.
|
- 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`.
|
- 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.
|
||||||
|
|
||||||
## :signal_strength: Coverage Support
|
## :signal_strength: Coverage Support
|
||||||
|
|
||||||
@ -321,7 +323,7 @@ Runs on all [PHP versions supported](#tada-php-support "List of PHP versions sup
|
|||||||
- name: Setup PHP with Xdebug
|
- name: Setup PHP with Xdebug
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
coverage: xdebug
|
coverage: xdebug
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -349,7 +351,7 @@ Runs on PHP 7.1 and newer PHP versions.
|
|||||||
- name: Setup PHP with PCOV
|
- name: Setup PHP with PCOV
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
ini-values: pcov.directory=api #optional, see above for usage.
|
ini-values: pcov.directory=api #optional, see above for usage.
|
||||||
coverage: pcov
|
coverage: pcov
|
||||||
```
|
```
|
||||||
@ -379,7 +381,7 @@ Disable coverage for these reasons:
|
|||||||
- name: Setup PHP with no coverage driver
|
- name: Setup PHP with no coverage driver
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
coverage: none
|
coverage: none
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -443,7 +445,7 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
|
|||||||
id: setup-php
|
id: setup-php
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
|
|
||||||
- name: Print PHP version
|
- name: Print PHP version
|
||||||
run: echo ${{ steps.setup-php.outputs.php-version }}
|
run: echo ${{ steps.setup-php.outputs.php-version }}
|
||||||
@ -462,7 +464,7 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
|
|||||||
|
|
||||||
#### `phpts` (optional)
|
#### `phpts` (optional)
|
||||||
|
|
||||||
- Specify to set up thread-safe version of PHP on Windows.
|
- Specify to set up a thread-safe build of PHP on Linux and Windows.
|
||||||
- Accepts `ts` and `nts`.
|
- Accepts `ts` and `nts`.
|
||||||
- By default, it is set to `nts`.
|
- By default, it is set to `nts`.
|
||||||
- See [thread safe setup](#thread-safe-setup) for more info.
|
- See [thread safe setup](#thread-safe-setup) for more info.
|
||||||
@ -485,7 +487,7 @@ steps:
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
extensions: mbstring, intl
|
extensions: mbstring, intl
|
||||||
ini-values: post_max_size=256M, max_execution_time=180
|
ini-values: post_max_size=256M, max_execution_time=180
|
||||||
coverage: xdebug
|
coverage: xdebug
|
||||||
@ -503,7 +505,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
|
operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
|
||||||
php-versions: ['7.4', '8.0', '8.1']
|
php-versions: ['8.0', '8.1', '8.2']
|
||||||
phpunit-versions: ['latest']
|
phpunit-versions: ['latest']
|
||||||
include:
|
include:
|
||||||
- operating-system: 'ubuntu-latest'
|
- operating-system: 'ubuntu-latest'
|
||||||
@ -522,7 +524,7 @@ jobs:
|
|||||||
|
|
||||||
### Nightly Build Setup
|
### Nightly Build Setup
|
||||||
|
|
||||||
> Set up a nightly build of `PHP 8.2`.
|
> Set up a nightly build of `PHP 8.3`.
|
||||||
|
|
||||||
- This PHP version is currently in active development and might contain bugs and breaking changes.
|
- This PHP version is currently in active development and might contain bugs and breaking changes.
|
||||||
- Some user space extensions might not support this version currently.
|
- Some user space extensions might not support this version currently.
|
||||||
@ -532,31 +534,48 @@ steps:
|
|||||||
- name: Setup nightly PHP
|
- name: Setup nightly PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.2'
|
php-version: '8.3'
|
||||||
extensions: mbstring
|
extensions: mbstring
|
||||||
ini-values: post_max_size=256M, max_execution_time=180
|
ini-values: post_max_size=256M, max_execution_time=180
|
||||||
coverage: xdebug
|
coverage: xdebug
|
||||||
tools: php-cs-fixer, phpunit
|
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.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- name: Setup PHP with debugging symbols
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.2'
|
||||||
|
env:
|
||||||
|
debug: true # specify true or false
|
||||||
|
```
|
||||||
|
|
||||||
### Thread Safe Setup
|
### Thread Safe Setup
|
||||||
|
|
||||||
> Set up `TS` or `NTS` PHP on `Windows`.
|
> Set up `TS` or `NTS` PHP on `Linux` and `Windows`.
|
||||||
|
|
||||||
- `NTS` versions are set up by default.
|
- `NTS` versions are set up by default.
|
||||||
- On `Ubuntu` and `macOS` only `NTS` versions are supported.
|
- On `macOS` only `NTS` versions are supported currently.
|
||||||
- On `Windows` both `TS` and `NTS` versions are supported.
|
- On `Linux` and `Windows` both `TS` and `NTS` versions are supported.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
runs-on: windows-latest
|
runs-on: [ubuntu-latest, windows-latest]
|
||||||
name: Setup PHP TS on Windows
|
name: Setup PHP TS
|
||||||
steps:
|
steps:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
env:
|
env:
|
||||||
phpts: ts # specify ts or nts
|
phpts: ts # specify ts or nts
|
||||||
```
|
```
|
||||||
@ -566,13 +585,14 @@ jobs:
|
|||||||
> Update to the latest patch of PHP versions.
|
> Update to the latest patch of PHP versions.
|
||||||
|
|
||||||
- Pre-installed PHP versions are not updated to their latest patch release by default.
|
- 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.
|
- You can specify the `update` environment variable to `true` for updating to the latest release.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Setup PHP with latest versions
|
- name: Setup PHP with latest versions
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
env:
|
env:
|
||||||
update: true # specify true or false
|
update: true # specify true or false
|
||||||
```
|
```
|
||||||
@ -587,14 +607,14 @@ To debug any issues, you can use the `verbose` tag instead of `v2`.
|
|||||||
- name: Setup PHP with logs
|
- name: Setup PHP with logs
|
||||||
uses: shivammathur/setup-php@verbose
|
uses: shivammathur/setup-php@verbose
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Multi-Arch Setup
|
### Multi-Arch Setup
|
||||||
|
|
||||||
> Set up PHP on multiple architecture on Ubuntu GitHub Runners.
|
> 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.2` 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`.
|
- 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).
|
- Currently, for `ARM` based setup, you will need [self-hosted runners](#self-hosted-setup).
|
||||||
|
|
||||||
@ -610,7 +630,7 @@ jobs:
|
|||||||
- name: Install PHP
|
- name: Install PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Self Hosted Setup
|
### Self Hosted Setup
|
||||||
@ -632,7 +652,7 @@ jobs:
|
|||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
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']
|
||||||
name: PHP ${{ matrix.php-versions }}
|
name: PHP ${{ matrix.php-versions }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
@ -660,7 +680,7 @@ jobs:
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
```
|
```
|
||||||
|
|
||||||
Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker images.
|
Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker images.
|
||||||
@ -696,7 +716,7 @@ For example to enable JIT in `tracing` mode with buffer size of `64 MB`.
|
|||||||
- name: Setup PHP with JIT in tracing mode
|
- name: Setup PHP with JIT in tracing mode
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
coverage: none
|
coverage: none
|
||||||
ini-values: opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=64M
|
ini-values: opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=64M
|
||||||
```
|
```
|
||||||
@ -713,10 +733,10 @@ If your project uses composer, you can persist the composer's internal cache dir
|
|||||||
```yaml
|
```yaml
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
@ -749,7 +769,7 @@ The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHU
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
@ -762,7 +782,7 @@ If you use Private Packagist for your private composer dependencies, you can set
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
env:
|
env:
|
||||||
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
|
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
|
||||||
```
|
```
|
||||||
@ -776,7 +796,7 @@ Please refer to the authentication section in [`composer documentation`](https:/
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
env:
|
env:
|
||||||
COMPOSER_AUTH_JSON: |
|
COMPOSER_AUTH_JSON: |
|
||||||
{
|
{
|
||||||
@ -799,7 +819,7 @@ Put the code in the run property of a step and specify the shell as `php {0}`.
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
|
|
||||||
- name: Run PHP code
|
- name: Run PHP code
|
||||||
shell: php {0}
|
shell: php {0}
|
||||||
@ -839,7 +859,7 @@ PHPStan supports error reporting in GitHub Actions, so it does not require probl
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: phpstan
|
tools: phpstan
|
||||||
|
|
||||||
- name: Run PHPStan
|
- name: Run PHPStan
|
||||||
@ -854,7 +874,7 @@ Psalm supports error reporting in GitHub Actions with an output format `github`.
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: psalm
|
tools: psalm
|
||||||
|
|
||||||
- name: Run Psalm
|
- name: Run Psalm
|
||||||
@ -864,7 +884,7 @@ Psalm supports error reporting in GitHub Actions with an output format `github`.
|
|||||||
#### Tools with checkstyle support
|
#### 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 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`.
|
> Here is an example with `phpcs`.
|
||||||
|
|
||||||
@ -872,7 +892,7 @@ For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-p
|
|||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.2'
|
||||||
tools: cs2pr, phpcs
|
tools: cs2pr, phpcs
|
||||||
|
|
||||||
- name: Run phpcs
|
- name: Run phpcs
|
||||||
@ -1039,6 +1059,7 @@ These companies generously provide setup-php their products and services to aid
|
|||||||
[`prestissimo`]: https://github.com/hirak/prestissimo
|
[`prestissimo`]: https://github.com/hirak/prestissimo
|
||||||
[`protoc`]: https://developers.google.com/protocol-buffers/
|
[`protoc`]: https://developers.google.com/protocol-buffers/
|
||||||
[`psalm`]: https://psalm.dev/
|
[`psalm`]: https://psalm.dev/
|
||||||
|
[`rector`]: https://getrector.org/
|
||||||
[`symfony`]: https://symfony.com/download
|
[`symfony`]: https://symfony.com/download
|
||||||
[`symfony-cli`]: https://symfony.com/download
|
[`symfony-cli`]: https://symfony.com/download
|
||||||
[`vapor`]: https://docs.vapor.build/
|
[`vapor`]: https://docs.vapor.build/
|
||||||
|
@ -25,6 +25,7 @@ describe('Extension tests', () => {
|
|||||||
${'sqlsrv-1.2.3preview1'} | ${'7.4'} | ${'Add-Extension sqlsrv devel 1.2.3'}
|
${'sqlsrv-1.2.3preview1'} | ${'7.4'} | ${'Add-Extension sqlsrv devel 1.2.3'}
|
||||||
${'Xdebug'} | ${'7.4'} | ${'Add-Extension xdebug'}
|
${'Xdebug'} | ${'7.4'} | ${'Add-Extension xdebug'}
|
||||||
${'xdebug2'} | ${'7.2'} | ${'Add-Extension xdebug stable 2.9.8'}
|
${'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',
|
'checking addExtensionOnWindows for extension $extension on version $version',
|
||||||
async ({extension, version, output}) => {
|
async ({extension, version, output}) => {
|
||||||
@ -59,11 +60,14 @@ describe('Extension tests', () => {
|
|||||||
${'pdo_sqlsrv'} | ${'7.4'} | ${'add_sqlsrv pdo_sqlsrv'}
|
${'pdo_sqlsrv'} | ${'7.4'} | ${'add_sqlsrv pdo_sqlsrv'}
|
||||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||||
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
|
${'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'}
|
${'sqlite'} | ${'7.4'} | ${'add_extension sqlite3'}
|
||||||
${'sqlsrv-1.2.3-beta1'} | ${'7.4'} | ${'add_pecl_extension sqlsrv 1.2.3beta1 extension'}
|
${'sqlsrv-1.2.3-beta1'} | ${'7.4'} | ${'add_pecl_extension sqlsrv 1.2.3beta1 extension'}
|
||||||
${'Xdebug'} | ${'7.4'} | ${'add_extension xdebug'}
|
${'Xdebug'} | ${'7.4'} | ${'add_extension xdebug'}
|
||||||
${'xdebug-alpha'} | ${'7.4'} | ${'add_unstable_extension xdebug alpha zend_extension'}
|
${'xdebug-alpha'} | ${'7.4'} | ${'add_unstable_extension xdebug alpha zend_extension'}
|
||||||
${'xdebug2'} | ${'7.2'} | ${'add_pecl_extension xdebug 2.9.8 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',
|
'checking addExtensionOnLinux for extension $extension on version $version',
|
||||||
async ({extension, version, output}) => {
|
async ({extension, version, output}) => {
|
||||||
@ -92,8 +96,9 @@ describe('Extension tests', () => {
|
|||||||
${'pcov'} | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
|
${'pcov'} | ${'5.6'} | ${'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'}
|
||||||
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
|
||||||
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
${'pecl_http'} | ${'7.3'} | ${'add_http'}
|
||||||
|
${'relay-1.2.3'} | ${'7.4'} | ${'add_relay relay-1.2.3'}
|
||||||
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
|
${'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',
|
'checking addExtensionOnDarwin for extension $extension on version $version',
|
||||||
async ({extension, version, output}) => {
|
async ({extension, version, output}) => {
|
||||||
@ -112,10 +117,11 @@ describe('Extension tests', () => {
|
|||||||
const [formula, extension]: string[] = line.split('=');
|
const [formula, extension]: string[] = line.split('=');
|
||||||
const prefix: string =
|
const prefix: string =
|
||||||
extension == 'xdebug' ? 'zend_extension' : 'extension';
|
extension == 'xdebug' ? 'zend_extension' : 'extension';
|
||||||
|
const ext_name = extension.replace(/\d+|(pdo|pecl)[_-]/, '');
|
||||||
const output: string = fs.existsSync(
|
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}`;
|
: `add_brew_extension ${formula} ${prefix}`;
|
||||||
return [formula, formula === 'phalcon3' ? '7.3' : '7.4', output];
|
return [formula, formula === 'phalcon3' ? '7.3' : '7.4', output];
|
||||||
});
|
});
|
||||||
|
@ -222,11 +222,11 @@ describe('Tools tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
os | script | scope
|
os | script | scope
|
||||||
${'linux'} | ${'add_composertool tool tool:1.2.3 user/ global'} | ${'global'}
|
${'linux'} | ${'add_composer_tool tool tool:1.2.3 user/ global'} | ${'global'}
|
||||||
${'darwin'} | ${'add_composertool tool tool:1.2.3 user/ scoped'} | ${'scoped'}
|
${'darwin'} | ${'add_composer_tool tool tool:1.2.3 user/ scoped'} | ${'scoped'}
|
||||||
${'win32'} | ${'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'}
|
${'openbsd'} | ${'Platform openbsd is not supported'} | ${'global'}
|
||||||
`('checking addPackage: $os, $scope', async ({os, script, scope}) => {
|
`('checking addPackage: $os, $scope', async ({os, script, scope}) => {
|
||||||
const data = getData({
|
const data = getData({
|
||||||
tool: 'tool',
|
tool: 'tool',
|
||||||
@ -265,8 +265,9 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
it.each`
|
it.each`
|
||||||
version | php_version | url
|
version | php_version | url
|
||||||
${'latest'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player.phar'}
|
${'latest'} | ${'8.1'} | ${'https://get.blackfire.io/blackfire-player.phar'}
|
||||||
${'1.2.3'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player-v1.2.3.phar'}
|
${'1.2.3'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player-v1.2.3.phar'}
|
||||||
|
${'latest'} | ${'7.4'} | ${'https://get.blackfire.io/blackfire-player-v1.22.0.phar'}
|
||||||
${'latest'} | ${'5.5'} | ${'https://get.blackfire.io/blackfire-player-v1.9.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'}
|
${'latest'} | ${'7.0'} | ${'https://get.blackfire.io/blackfire-player-v1.9.3.phar'}
|
||||||
`(
|
`(
|
||||||
@ -376,30 +377,30 @@ describe('Tools tests', () => {
|
|||||||
[
|
[
|
||||||
'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_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_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/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_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_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/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/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.2.1/php-cs-fixer.phar php-cs-fixer "-V"',
|
||||||
'add_tool https://github.com/phpDocumentor/phpDocumentor/releases/latest/download/phpDocumentor.phar phpDocumentor "--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://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.phar phpunit "--version"',
|
||||||
'add_pecl',
|
'add_pecl',
|
||||||
'add_tool https://www.phing.info/get/phing-latest.phar phing "-v"',
|
'add_tool https://www.phing.info/get/phing-latest.phar phing "-v"',
|
||||||
'add_composertool phinx phinx robmorgan/ scoped',
|
'add_composer_tool phinx phinx robmorgan/ scoped',
|
||||||
'add_composertool phinx phinx:1.2.3 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_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_composer_tool phpunit-bridge phpunit-bridge symfony/ global',
|
||||||
'add_composertool phpunit-polyfills phpunit-polyfills yoast/ 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_tool https://github.com/laravel/pint/releases/latest/download/pint.phar pint "-V"',
|
||||||
'add_devtools php-config',
|
'add_devtools php-config',
|
||||||
'add_devtools phpize',
|
'add_devtools phpize',
|
||||||
'add_protoc latest',
|
'add_protoc latest',
|
||||||
'add_symfony 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"'
|
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@ -412,24 +413,24 @@ describe('Tools tests', () => {
|
|||||||
|
|
||||||
it.each([
|
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-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, rector, symfony-cli, vapor-cli, wp-cli',
|
||||||
[
|
[
|
||||||
'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_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_composertool behat behat behat/ scoped',
|
'add_composer_tool behat behat behat/ scoped',
|
||||||
'add_blackfire',
|
'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/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_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_composer_tool composer-require-checker composer-require-checker maglnet/ scoped',
|
||||||
'add_composertool composer-unused composer-unused icanhazstring/ 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_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_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/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/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://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,https://github.com/phingofficial/phing/releases/download/1.2.3/phing-1.2.3.phar phing "-v"',
|
'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_composertool phinx phinx robmorgan/ scoped',
|
'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_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive',
|
||||||
'add_devtools php-config',
|
'add_devtools php-config',
|
||||||
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcbf.phar phpcbf "--version"',
|
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcbf.phar phpcbf "--version"',
|
||||||
@ -439,12 +440,13 @@ describe('Tools tests', () => {
|
|||||||
'add_devtools phpize',
|
'add_devtools phpize',
|
||||||
'add_tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"',
|
'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_tool https://github.com/phpspec/phpspec/releases/latest/download/phpspec.phar phpspec "-V"',
|
||||||
'add_composertool phpunit-bridge phpunit-bridge:5.6.* symfony/ global',
|
'add_composer_tool phpunit-bridge phpunit-bridge:5.6.* symfony/ global',
|
||||||
'add_composertool phpunit-polyfills phpunit-polyfills:1.0.1 yoast/ global',
|
'add_composer_tool phpunit-polyfills phpunit-polyfills:1.0.1 yoast/ global',
|
||||||
'add_protoc 1.2.3',
|
'add_protoc 1.2.3',
|
||||||
'add_tool https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm "-v"',
|
'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_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"'
|
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@ -466,13 +468,13 @@ describe('Tools tests', () => {
|
|||||||
'Add-Tool https://github.com/bmitch/churn-php/releases/latest/download/churn.phar churn "-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"',
|
'Add-Tool https://deployer.org/deployer.phar deployer "-V"',
|
||||||
'Tool does_not_exist is not supported',
|
'Tool does_not_exist is not supported',
|
||||||
'Add-Composertool flex flex symfony/ global',
|
'Add-ComposerTool flex flex symfony/ global',
|
||||||
'Add-Composertool phinx phinx robmorgan/ scoped',
|
'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"',
|
'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',
|
'php-config is not a windows tool',
|
||||||
'phpize 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-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-Symfony',
|
||||||
'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
|
'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"'
|
||||||
]
|
]
|
||||||
@ -489,13 +491,13 @@ 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',
|
'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://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-1.phar,https://getcomposer.org/composer-1.phar composer',
|
'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 codeception codeception codeception/ global',
|
||||||
'Add-Composertool prestissimo prestissimo hirak/ global',
|
'Add-ComposerTool prestissimo prestissimo hirak/ global',
|
||||||
'Add-Composertool automatic-composer-prefetcher automatic-composer-prefetcher narrowspark/ 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/ scoped',
|
||||||
'Add-Composertool phinx phinx:^1.2 robmorgan/ global',
|
'Add-ComposerTool phinx phinx:^1.2 robmorgan/ global',
|
||||||
'Add-Composertool tool tool:1.2.3 user/ global',
|
'Add-ComposerTool tool tool:1.2.3 user/ global',
|
||||||
'Add-Composertool tool tool:~1.2 user/ global'
|
'Add-ComposerTool tool tool:~1.2 user/ global'
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
|
@ -109,6 +109,9 @@ describe('Utils tests', () => {
|
|||||||
expect(
|
expect(
|
||||||
await utils.CSVArray('a=E_ALL, b=E_ALL & ~ E_ALL, c="E_ALL", d=\'E_ALL\'')
|
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']);
|
).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([]);
|
||||||
expect(await utils.CSVArray(' ')).toEqual([]);
|
expect(await utils.CSVArray(' ')).toEqual([]);
|
||||||
});
|
});
|
||||||
@ -190,6 +193,7 @@ describe('Utils tests', () => {
|
|||||||
expect(await utils.getCommand('linux', 'tool')).toBe('add_tool ');
|
expect(await utils.getCommand('linux', 'tool')).toBe('add_tool ');
|
||||||
expect(await utils.getCommand('darwin', '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')).toBe('Add-Tool ');
|
||||||
|
expect(await utils.getCommand('win32', 'tool_name')).toBe('Add-ToolName ');
|
||||||
expect(await utils.getCommand('openbsd', 'tool')).toContain(
|
expect(await utils.getCommand('openbsd', 'tool')).toContain(
|
||||||
'Platform openbsd is not supported'
|
'Platform openbsd is not supported'
|
||||||
);
|
);
|
||||||
|
@ -7,7 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
php-version:
|
php-version:
|
||||||
description: 'Setup PHP version.'
|
description: 'Setup PHP version.'
|
||||||
default: '8.1'
|
default: '8.2'
|
||||||
required: true
|
required: true
|
||||||
extensions:
|
extensions:
|
||||||
description: 'Setup PHP extensions.'
|
description: 'Setup PHP extensions.'
|
||||||
|
959
dist/index.js
vendored
959
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -47,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -86,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -120,7 +120,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -47,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -86,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -120,7 +120,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -23,7 +23,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -57,7 +57,7 @@ jobs:
|
|||||||
extensions: mbstring, intl
|
extensions: mbstring, intl
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
@ -91,7 +91,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -56,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -56,7 +56,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -55,7 +55,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get yarn cache
|
- name: Get yarn cache
|
||||||
id: 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@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -25,7 +25,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -51,7 +51,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -51,7 +51,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get composer cache directory
|
- name: Get composer cache directory
|
||||||
id: composer-cache
|
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
|
- name: Cache composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
4278
package-lock.json
generated
4278
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
36
package.json
36
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-php",
|
"name": "setup-php",
|
||||||
"version": "2.21.0",
|
"version": "2.24.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Setup PHP for use with GitHub Actions",
|
"description": "Setup PHP for use with GitHub Actions",
|
||||||
"main": "lib/install.js",
|
"main": "lib/install.js",
|
||||||
@ -34,28 +34,28 @@
|
|||||||
"author": "shivammathur",
|
"author": "shivammathur",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.9.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.2"
|
"@actions/io": "^1.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^28.1.6",
|
"@types/jest": "^29.4.0",
|
||||||
"@types/node": "^18.0.6",
|
"@types/node": "^18.11.18",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
||||||
"@typescript-eslint/parser": "^5.30.7",
|
"@typescript-eslint/parser": "^5.49.0",
|
||||||
"@vercel/ncc": "^0.34.0",
|
"@vercel/ncc": "^0.36.1",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.32.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-jest": "^26.6.0",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"jest": "^28.1.3",
|
"jest": "^29.4.1",
|
||||||
"jest-circus": "^28.1.3",
|
"jest-circus": "^29.4.1",
|
||||||
"nock": "^13.2.8",
|
"nock": "^13.3.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.3",
|
||||||
"simple-git-hooks": "^2.8.0",
|
"simple-git-hooks": "^2.8.1",
|
||||||
"ts-jest": "^28.0.7",
|
"ts-jest": "^29.0.5",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.9.4"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
amqp=amqp
|
amqp=amqp
|
||||||
apcu=apcu
|
apcu=apcu
|
||||||
|
ast=ast
|
||||||
couchbase=couchbase
|
couchbase=couchbase
|
||||||
|
ds=ds
|
||||||
event=event
|
event=event
|
||||||
expect=expect
|
expect=expect
|
||||||
|
gearman=gearman
|
||||||
gnupg=gnupg
|
gnupg=gnupg
|
||||||
grpc=grpc
|
grpc=grpc
|
||||||
igbinary=igbinary
|
igbinary=igbinary
|
||||||
imagick=imagick
|
imagick=imagick
|
||||||
imap=imap
|
imap=imap
|
||||||
|
lua=lua
|
||||||
mailparse=mailparse
|
mailparse=mailparse
|
||||||
mcrypt=mcrypt
|
mcrypt=mcrypt
|
||||||
memcache=memcache
|
memcache=memcache
|
||||||
@ -15,6 +19,7 @@ memcached=memcached
|
|||||||
mongodb=mongodb
|
mongodb=mongodb
|
||||||
msgpack=msgpack
|
msgpack=msgpack
|
||||||
pcov=pcov
|
pcov=pcov
|
||||||
|
pdo_sqlsrv=pdo_sqlsrv
|
||||||
pecl_http=http
|
pecl_http=http
|
||||||
phalcon3=phalcon
|
phalcon3=phalcon
|
||||||
phalcon4=phalcon
|
phalcon4=phalcon
|
||||||
@ -25,8 +30,10 @@ psr=psr
|
|||||||
raphf=raphf
|
raphf=raphf
|
||||||
rdkafka=rdkafka
|
rdkafka=rdkafka
|
||||||
redis=redis
|
redis=redis
|
||||||
|
sqlsrv=sqlsrv
|
||||||
ssh2=ssh2
|
ssh2=ssh2
|
||||||
swoole=swoole
|
swoole=swoole
|
||||||
|
v8js=v8js
|
||||||
vips=vips
|
vips=vips
|
||||||
xdebug=xdebug
|
xdebug=xdebug
|
||||||
xdebug2=xdebug
|
xdebug2=xdebug
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
COMPOSER_PROCESS_TIMEOUT=0
|
COMPOSER_PROCESS_TIMEOUT=0
|
||||||
COMPOSER_NO_INTERACTION=1
|
COMPOSER_NO_INTERACTION=1
|
||||||
|
COMPOSER_NO_AUDIT=1
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"latest": "8.1",
|
"latest": "8.2",
|
||||||
"nightly": "8.2",
|
"nightly": "8.3",
|
||||||
"5.x": "5.6",
|
"5.x": "5.6",
|
||||||
"7.x": "7.4",
|
"7.x": "7.4",
|
||||||
"8.x": "8.1"
|
"8.x": "8.2"
|
||||||
}
|
}
|
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
|
@ -7,6 +7,14 @@
|
|||||||
"version_prefix": "",
|
"version_prefix": "",
|
||||||
"version_parameter": "-V"
|
"version_parameter": "-V"
|
||||||
},
|
},
|
||||||
|
"composer-unused": {
|
||||||
|
"type": "phar",
|
||||||
|
"repository": "composer-unused/composer-unused",
|
||||||
|
"extension": ".phar",
|
||||||
|
"domain": "https://github.com",
|
||||||
|
"version_prefix": "",
|
||||||
|
"version_parameter": "-V"
|
||||||
|
},
|
||||||
"composer-normalize": {
|
"composer-normalize": {
|
||||||
"type": "phar",
|
"type": "phar",
|
||||||
"repository": "ergebnis/composer-normalize",
|
"repository": "ergebnis/composer-normalize",
|
||||||
@ -110,7 +118,7 @@
|
|||||||
"repository": "laravel/pint",
|
"repository": "laravel/pint",
|
||||||
"extension": ".phar",
|
"extension": ".phar",
|
||||||
"domain": "https://github.com",
|
"domain": "https://github.com",
|
||||||
"version_prefix": "Pint ",
|
"version_prefix": "v",
|
||||||
"version_parameter": "-V"
|
"version_parameter": "-V"
|
||||||
},
|
},
|
||||||
"psalm": {
|
"psalm": {
|
||||||
@ -142,11 +150,6 @@
|
|||||||
"repository": "maglnet/composer-require-checker",
|
"repository": "maglnet/composer-require-checker",
|
||||||
"scope": "scoped"
|
"scope": "scoped"
|
||||||
},
|
},
|
||||||
"composer-unused": {
|
|
||||||
"type": "composer",
|
|
||||||
"repository": "icanhazstring/composer-unused",
|
|
||||||
"scope": "scoped"
|
|
||||||
},
|
|
||||||
"flex": {
|
"flex": {
|
||||||
"type": "composer",
|
"type": "composer",
|
||||||
"repository": "symfony/flex",
|
"repository": "symfony/flex",
|
||||||
@ -184,6 +187,11 @@
|
|||||||
"repository": "laravel/vapor-cli",
|
"repository": "laravel/vapor-cli",
|
||||||
"scope": "scoped"
|
"scope": "scoped"
|
||||||
},
|
},
|
||||||
|
"rector": {
|
||||||
|
"type": "composer",
|
||||||
|
"repository": "rector/rector",
|
||||||
|
"scope": "scoped"
|
||||||
|
},
|
||||||
"blackfire": {
|
"blackfire": {
|
||||||
"type": "custom-package",
|
"type": "custom-package",
|
||||||
"alias": "blackfire-agent"
|
"alias": "blackfire-agent"
|
||||||
|
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 extension
|
||||||
* @param version
|
* @param version
|
||||||
@ -30,9 +30,8 @@ export async function addCoverageXdebug(
|
|||||||
pipe: string
|
pipe: string
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
let script = '\n';
|
let script = '\n';
|
||||||
let message: string = await checkXdebugError(extension, version);
|
const error: string = await checkXdebugError(extension, version);
|
||||||
let status = '$cross';
|
if (!error) {
|
||||||
if (!message) {
|
|
||||||
script +=
|
script +=
|
||||||
(await extensions.addExtension(':pcov:false', version, os, true)) + pipe;
|
(await extensions.addExtension(':pcov:false', version, os, true)) + pipe;
|
||||||
extension = extension == 'xdebug3' ? 'xdebug' : extension;
|
extension = extension == 'xdebug3' ? 'xdebug' : extension;
|
||||||
@ -43,15 +42,17 @@ export async function addCoverageXdebug(
|
|||||||
'php -r "echo phpversion(\'xdebug\');"',
|
'php -r "echo phpversion(\'xdebug\');"',
|
||||||
os
|
os
|
||||||
);
|
);
|
||||||
message = 'Xdebug $xdebug_version enabled as coverage driver';
|
script +=
|
||||||
status = '$tick';
|
(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;
|
return script;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to setup PCOV
|
* Function to set up PCOV
|
||||||
*
|
*
|
||||||
* @param version
|
* @param version
|
||||||
* @param os
|
* @param os
|
||||||
@ -76,14 +77,9 @@ export async function addCoveragePCOV(
|
|||||||
'php -r "echo phpversion(\'pcov\');"',
|
'php -r "echo phpversion(\'pcov\');"',
|
||||||
os
|
os
|
||||||
);
|
);
|
||||||
// success
|
script +=
|
||||||
script += await utils.addLog(
|
(await utils.getCommand(os, 'extension_log')) +
|
||||||
'$tick',
|
'pcov "PCOV $pcov_version enabled as coverage driver"';
|
||||||
'coverage: pcov',
|
|
||||||
'PCOV $pcov_version enabled as coverage driver',
|
|
||||||
os
|
|
||||||
);
|
|
||||||
// version is not supported
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case /5\.[3-6]|7\.0/.test(version):
|
case /5\.[3-6]|7\.0/.test(version):
|
||||||
|
@ -31,15 +31,18 @@ export async function addExtensionDarwin(
|
|||||||
case /.+-.+\/.+@.+/.test(extension):
|
case /.+-.+\/.+@.+/.test(extension):
|
||||||
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
||||||
return;
|
return;
|
||||||
// match 5.3blackfire...8.1blackfire
|
// match 7.4relay...8.2relay
|
||||||
|
// match 5.3blackfire...8.2blackfire
|
||||||
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
||||||
// match couchbase, event, geos, pdo_oci, oci8, http, pecl_http
|
// match couchbase, event, geos, pdo_oci, oci8, http, pecl_http
|
||||||
// match 5.3ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.2phalcon5
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.2phalcon5
|
||||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
// match 7.0zephir_parser...8.2zephir_parser
|
||||||
|
case /^(7\.4|8\.[0-2])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
|
||||||
|
case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^couchbase|^event|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||||
extension
|
extension
|
||||||
):
|
):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
@ -47,6 +50,9 @@ export async function addExtensionDarwin(
|
|||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||||
|
case /^(7\.[0-4]|8\.[0-2])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||||
|
version_extension
|
||||||
|
):
|
||||||
add_script += await utils.customPackage(
|
add_script += await utils.customPackage(
|
||||||
ext_name,
|
ext_name,
|
||||||
'extensions',
|
'extensions',
|
||||||
@ -76,16 +82,14 @@ export async function addExtensionDarwin(
|
|||||||
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
|
case /(5\.[3-6]|7\.0)pcov/.test(version_extension):
|
||||||
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
|
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
|
||||||
return;
|
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 brew extensions
|
||||||
// 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|mcrypt|memcache|memcached|mongodb|msgpack|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(
|
case /(?<!5\.[3-5])(amqp|apcu|expect|gnupg|grpc|igbinary|imagick|imap|mailparse|mcrypt|memcache|memcached|mongodb|msgpack|protobuf|psr|raphf|rdkafka|redis|ssh2|swoole|xdebug|xdebug2|yaml|zmq)/.test(
|
||||||
version_extension
|
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]|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(
|
add_script += await utils.joins(
|
||||||
'\nadd_brew_extension',
|
'\nadd_brew_extension',
|
||||||
ext_name,
|
ext_name,
|
||||||
@ -130,13 +134,14 @@ export async function addExtensionWindows(
|
|||||||
case /^none$/.test(ext_name):
|
case /^none$/.test(ext_name):
|
||||||
add_script += '\nDisable-AllShared';
|
add_script += '\nDisable-AllShared';
|
||||||
break;
|
break;
|
||||||
// match 5.3blackfire...8.1blackfire
|
// match 5.3blackfire...8.2blackfire
|
||||||
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
||||||
// match pdo_oci and oci8
|
// match pdo_oci and oci8
|
||||||
// match 5.3ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.2phalcon5
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.2phalcon5
|
||||||
// match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
|
// match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
|
||||||
case /^(5\.[3-6]|7\.[0-4]|8\.1)blackfire(-\d+\.\d+\.\d+)?$/.test(
|
// match 7.0zephir_parser...8.2zephir_parser
|
||||||
|
case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
|
case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
|
||||||
@ -145,6 +150,9 @@ export async function addExtensionWindows(
|
|||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^(7\.[1-4]|8\.1)(pecl_)?http/.test(version_extension):
|
case /^(7\.[1-4]|8\.1)(pecl_)?http/.test(version_extension):
|
||||||
|
case /^(7\.[0-4]|8\.[0-2])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||||
|
version_extension
|
||||||
|
):
|
||||||
add_script += await utils.customPackage(
|
add_script += await utils.customPackage(
|
||||||
ext_name,
|
ext_name,
|
||||||
'extensions',
|
'extensions',
|
||||||
@ -254,13 +262,16 @@ export async function addExtensionLinux(
|
|||||||
case /.+-.+\/.+@.+/.test(extension):
|
case /.+-.+\/.+@.+/.test(extension):
|
||||||
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
add_script += await utils.parseExtensionSource(extension, ext_prefix);
|
||||||
return;
|
return;
|
||||||
// match 5.3blackfire...8.1blackfire
|
// match 7.4relay...8.2relay
|
||||||
|
// match 5.3blackfire...8.2blackfire
|
||||||
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
// match 5.3blackfire-(semver)...8.1blackfire-(semver)
|
||||||
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
||||||
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
// match couchbase, geos, pdo_oci, oci8, http, pecl_http
|
||||||
// match 5.3ioncube...7.4ioncube
|
// match 5.3ioncube...7.4ioncube
|
||||||
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.2phalcon5
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.2phalcon5
|
||||||
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
// match 7.0zephir_parser...8.2zephir_parser
|
||||||
|
case /^(7\.4|8\.[0-2])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
|
||||||
|
case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(
|
case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(
|
||||||
@ -269,12 +280,15 @@ export async function addExtensionLinux(
|
|||||||
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
||||||
extension
|
extension
|
||||||
):
|
):
|
||||||
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
|
case /(?<!5\.[3-5])intl-\d+\.\d+$/.test(version_extension):
|
||||||
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
|
||||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-2])phalcon5$/.test(
|
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-2])phalcon5$/.test(
|
||||||
version_extension
|
version_extension
|
||||||
):
|
):
|
||||||
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
||||||
|
case /^(7\.[0-4]|8\.[0-2])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
||||||
|
version_extension
|
||||||
|
):
|
||||||
add_script += await utils.customPackage(
|
add_script += await utils.customPackage(
|
||||||
ext_name,
|
ext_name,
|
||||||
'extensions',
|
'extensions',
|
||||||
|
@ -1,16 +1,7 @@
|
|||||||
# 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
|
||||||
disable_dependency_extensions() {
|
disable_dependency_extensions() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
formula_file="$tap_dir/$ext_tap/Formula/$extension@${version:?}.rb"
|
formula_file="${tap_dir:?}/$ext_tap/Formula/$extension@${version:?}.rb"
|
||||||
if [ -e "$formula_file" ]; then
|
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' ' ')"
|
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
|
for dependency_extension in "${dependency_extensions[@]}"; do
|
||||||
@ -33,38 +24,11 @@ disable_extension_helper() {
|
|||||||
echo '' | sudo tee /tmp/extdisabled/"$version"/"$extension" >/dev/null 2>&1
|
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 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 extension name from brew formula.
|
# Function to get extension name from brew formula.
|
||||||
get_extension_from_formula() {
|
get_extension_from_formula() {
|
||||||
local formula=$1
|
local formula=$1
|
||||||
local extension
|
local extension
|
||||||
extension=$(grep "$formula=" "$src"/configs/brew_extensions | cut -d '=' -f 2)
|
extension=$(grep -E "^$formula=" "$src"/configs/brew_extensions | cut -d '=' -f 2)
|
||||||
[[ -z "$extension" ]] && extension="$(echo "$formula" | sed -E "s/pecl_|[0-9]//g")"
|
[[ -z "$extension" ]] && extension="$(echo "$formula" | sed -E "s/pecl_|[0-9]//g")"
|
||||||
echo "$extension"
|
echo "$extension"
|
||||||
}
|
}
|
||||||
@ -76,7 +40,7 @@ copy_brew_extensions() {
|
|||||||
deps="$(grep -Eo 'depends_on "shivammathur[^"]+' "$formula_file" | cut -d '/' -f 3 | tr '\n' ' ')"
|
deps="$(grep -Eo 'depends_on "shivammathur[^"]+' "$formula_file" | cut -d '/' -f 3 | tr '\n' ' ')"
|
||||||
IFS=' ' read -r -a deps <<< "$formula@$version $deps"
|
IFS=' ' read -r -a deps <<< "$formula@$version $deps"
|
||||||
for dependency in "${deps[@]}"; do
|
for dependency in "${deps[@]}"; do
|
||||||
extension_file="$brew_prefix/opt/$dependency/$(get_extension_from_formula "${dependency%@*}").so"
|
extension_file="${brew_prefix:?}/opt/$dependency/$(get_extension_from_formula "${dependency%@*}").so"
|
||||||
[ -e "$extension_file" ] && sudo cp "$extension_file" "$ext_dir"
|
[ -e "$extension_file" ] && sudo cp "$extension_file" "$ext_dir"
|
||||||
done
|
done
|
||||||
sudo find -- "$brew_prefix"/Cellar/"$formula"@"$version" -name "*.dylib" -exec cp {} "$ext_dir" \;
|
sudo find -- "$brew_prefix"/Cellar/"$formula"@"$version" -name "*.dylib" -exec cp {} "$ext_dir" \;
|
||||||
@ -93,7 +57,7 @@ add_brew_extension() {
|
|||||||
else
|
else
|
||||||
add_brew_tap "$php_tap"
|
add_brew_tap "$php_tap"
|
||||||
add_brew_tap "$ext_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
|
update_dependencies >/dev/null 2>&1
|
||||||
disable_dependency_extensions "$extension" >/dev/null 2>&1
|
disable_dependency_extensions "$extension" >/dev/null 2>&1
|
||||||
brew install -f "$ext_tap/$formula@$version" >/dev/null 2>&1
|
brew install -f "$ext_tap/$formula@$version" >/dev/null 2>&1
|
||||||
@ -142,7 +106,7 @@ link_libraries() {
|
|||||||
|
|
||||||
# Patch brew to overwrite packages.
|
# Patch brew to overwrite packages.
|
||||||
patch_brew() {
|
patch_brew() {
|
||||||
formula_installer="$brew_repo"/Library/Homebrew/formula_installer.rb
|
formula_installer="${brew_repo:?}"/Library/Homebrew/formula_installer.rb
|
||||||
code=" keg.link\(verbose: verbose\?"
|
code=" keg.link\(verbose: verbose\?"
|
||||||
sudo sed -Ei '' "s/$code.*/$code, overwrite: true\)/" "$formula_installer"
|
sudo sed -Ei '' "s/$code.*/$code, overwrite: true\)/" "$formula_installer"
|
||||||
# shellcheck disable=SC2064
|
# shellcheck disable=SC2064
|
||||||
@ -161,10 +125,13 @@ update_dependencies() {
|
|||||||
patch_brew
|
patch_brew
|
||||||
if ! [ -e /tmp/update_dependencies ]; then
|
if ! [ -e /tmp/update_dependencies ]; then
|
||||||
if [ "${runner:?}" != "self-hosted" ] && [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
|
if [ "${runner:?}" != "self-hosted" ] && [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
|
||||||
while read -r dependency; do
|
deps_file="$tap_dir/$php_tap/.github/deps/${ImageOS:?}_${ImageVersion:?}"
|
||||||
update_dependencies_helper "$dependency" &
|
if [ -e "$deps_file" ]; then
|
||||||
to_wait+=($!)
|
while read -r dependency; do
|
||||||
done <"$tap_dir/$php_tap/.github/deps/${ImageOS:?}_${ImageVersion:?}"
|
update_dependencies_helper "$dependency" &
|
||||||
|
to_wait+=($!)
|
||||||
|
done <"$deps_file"
|
||||||
|
fi
|
||||||
wait "${to_wait[@]}"
|
wait "${to_wait[@]}"
|
||||||
else
|
else
|
||||||
git -C "$core_repo" fetch origin master && git -C "$core_repo" reset --hard origin/master
|
git -C "$core_repo" fetch origin master && git -C "$core_repo" reset --hard origin/master
|
||||||
@ -200,6 +167,7 @@ add_php() {
|
|||||||
existing_version=$2
|
existing_version=$2
|
||||||
add_brew_tap "$php_tap"
|
add_brew_tap "$php_tap"
|
||||||
update_dependencies
|
update_dependencies
|
||||||
|
[ "${debug:?}" = "debug" ] && php_formula="$php_formula-debug"
|
||||||
if [ "$existing_version" != "false" ]; then
|
if [ "$existing_version" != "false" ]; then
|
||||||
([ "$action" = "upgrade" ] && brew upgrade -f "$php_formula") || brew unlink "$php_formula"
|
([ "$action" = "upgrade" ] && brew upgrade -f "$php_formula") || brew unlink "$php_formula"
|
||||||
else
|
else
|
||||||
@ -276,16 +244,10 @@ setup_php() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
version=${1:-'8.1'}
|
version=${1:-'8.2'}
|
||||||
ini=${2:-'production'}
|
ini=${2:-'production'}
|
||||||
src=${0%/*}/..
|
src=${0%/*}/..
|
||||||
php_formula=shivammathur/php/php@"$version"
|
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
|
scripts="$src"/scripts
|
||||||
ext_tap=shivammathur/homebrew-extensions
|
ext_tap=shivammathur/homebrew-extensions
|
||||||
php_tap=shivammathur/homebrew-php
|
php_tap=shivammathur/homebrew-php
|
||||||
@ -298,9 +260,11 @@ export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
|||||||
|
|
||||||
# shellcheck source=.
|
# shellcheck source=.
|
||||||
. "${scripts:?}"/unix.sh
|
. "${scripts:?}"/unix.sh
|
||||||
|
. "${scripts:?}"/tools/brew.sh
|
||||||
. "${scripts:?}"/tools/add_tools.sh
|
. "${scripts:?}"/tools/add_tools.sh
|
||||||
. "${scripts:?}"/extensions/source.sh
|
. "${scripts:?}"/extensions/source.sh
|
||||||
. "${scripts:?}"/extensions/add_extensions.sh
|
. "${scripts:?}"/extensions/add_extensions.sh
|
||||||
|
configure_brew
|
||||||
read_env
|
read_env
|
||||||
self_hosted_setup
|
self_hosted_setup
|
||||||
setup_php
|
setup_php
|
||||||
|
@ -1,3 +1,20 @@
|
|||||||
|
Function Add-ExtensionLog() {
|
||||||
|
Param (
|
||||||
|
[Parameter(Position = 0, Mandatory = $true)]
|
||||||
|
[ValidateNotNull()]
|
||||||
|
$extension,
|
||||||
|
[Parameter(Position = 1, Mandatory = $true)]
|
||||||
|
[ValidateNotNull()]
|
||||||
|
$message
|
||||||
|
)
|
||||||
|
$extension_info = Get-PhpExtension -Path $php_dir | Where-Object { $_.Name -eq $extension -or $_.Handle -eq $extension }
|
||||||
|
if ($null -ne $extension_info -and ($extension_info.State -eq 'Enabled' -or $extension_info.State -eq 'Builtin')) {
|
||||||
|
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 to link dependencies to PHP directory.
|
||||||
Function Set-ExtensionPrerequisites
|
Function Set-ExtensionPrerequisites
|
||||||
{
|
{
|
||||||
@ -6,8 +23,9 @@ Function Set-ExtensionPrerequisites
|
|||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateLength(1, [int]::MaxValue)]
|
[ValidateLength(1, [int]::MaxValue)]
|
||||||
[string]
|
[string]
|
||||||
$deps_dir
|
$extension
|
||||||
)
|
)
|
||||||
|
$deps_dir = "$ext_dir\$extension-vc$($installed.VCVersion)-$arch"
|
||||||
$deps = Get-ChildItem -Recurse -Path $deps_dir
|
$deps = Get-ChildItem -Recurse -Path $deps_dir
|
||||||
if ($deps.Count -ne 0) {
|
if ($deps.Count -ne 0) {
|
||||||
# Symlink dependencies instead of adding the directory to PATH ...
|
# Symlink dependencies instead of adding the directory to PATH ...
|
||||||
@ -20,6 +38,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-NightlyExtension {
|
||||||
|
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"
|
||||||
|
Invoke-WebRequest -UseBasicParsing -Uri $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 to add PHP extensions.
|
||||||
Function Add-Extension {
|
Function Add-Extension {
|
||||||
Param (
|
Param (
|
||||||
@ -52,31 +105,32 @@ Function Add-Extension {
|
|||||||
Add-Log $tick $extension "Enabled"
|
Add-Log $tick $extension "Enabled"
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
Enable-ExtensionDependencies $extension
|
Enable-Extension $extension_info.Handle
|
||||||
Enable-PhpExtension -Extension $extension_info.Handle -Path $php_dir
|
|
||||||
Set-ExtensionPrerequisites $deps_dir
|
|
||||||
Add-Log $tick $extension "Enabled"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Patch till PHP 8.1 DLLs are released as stable.
|
if(($version -match $nightly_versions) -and (Select-String -Path $src\configs\windows_extensions -Pattern $extension -SimpleMatch -Quiet)) {
|
||||||
$minimumStability = $stability
|
Add-NightlyExtension $extension
|
||||||
if($version -eq '8.1' -and $stability -eq 'stable') {
|
} else {
|
||||||
$minimumStability = 'snapshot'
|
# Patch till DLLs for PHP 8.1 and 8.2 are released as stable.
|
||||||
}
|
$minimumStability = $stability
|
||||||
|
if ($version -match '8.[1-2]' -and $stability -eq 'stable') {
|
||||||
|
$minimumStability = 'snapshot'
|
||||||
|
}
|
||||||
|
|
||||||
$params = @{ Extension = $extension; MinimumStability = $minimumStability; MaximumStability = $stability; Path = $php_dir; AdditionalFilesPath = $deps_dir; NoDependencies = $true }
|
$params = @{ Extension = $extension; MinimumStability = $minimumStability; MaximumStability = $stability; Path = $php_dir; AdditionalFilesPath = $deps_dir; NoDependencies = $true }
|
||||||
if($extension_version -ne '') {
|
if ($extension_version -ne '')
|
||||||
$params["Version"] = $extension_version
|
{
|
||||||
|
$params["Version"] = $extension_version
|
||||||
|
}
|
||||||
|
Install-PhpExtension @params
|
||||||
|
Set-ExtensionPrerequisites $extension
|
||||||
}
|
}
|
||||||
Install-PhpExtension @params
|
|
||||||
Set-ExtensionPrerequisites $deps_dir
|
|
||||||
Add-Log $tick $extension "Installed and enabled"
|
Add-Log $tick $extension "Installed and enabled"
|
||||||
}
|
}
|
||||||
}
|
} catch {
|
||||||
catch {
|
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
|
||||||
Add-Log $cross $extension "Could not install $extension on PHP $($installed.FullVersion)"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ disable_all_shared() {
|
|||||||
|
|
||||||
# Function to configure PECL.
|
# Function to configure PECL.
|
||||||
configure_pecl() {
|
configure_pecl() {
|
||||||
|
[ -z "${pecl_file:-${ini_file[@]}}" ] && return
|
||||||
if ! [ -e /tmp/pecl_config ]; then
|
if ! [ -e /tmp/pecl_config ]; then
|
||||||
for script in pear pecl; do
|
for script in pear pecl; do
|
||||||
sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}"
|
sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}"
|
||||||
@ -144,14 +145,18 @@ add_extension() {
|
|||||||
# Function to get the PECL version of an extension.
|
# Function to get the PECL version of an extension.
|
||||||
get_pecl_version() {
|
get_pecl_version() {
|
||||||
local extension=$1
|
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]+'}
|
major_version=${3:-'[0-9]+'}
|
||||||
pecl_rest='https://pecl.php.net/rest/r/'
|
pecl_rest='https://pecl.php.net/rest/r/'
|
||||||
response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml)
|
response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml)
|
||||||
pecl_version=$(echo "$response" | grep -m 1 -Eio "($major_version\.[0-9]+\.[0-9]+${stability}[0-9]+<)" | cut -d '<' -f 1)
|
for state in "${states[@]}"; do
|
||||||
if [ ! "$pecl_version" ]; then
|
pecl_version=$(echo "$response" | grep -m 1 -Eio "($major_version\.[0-9]+\.[0-9]+${state}[0-9]+<)" | cut -d '<' -f 1)
|
||||||
pecl_version=$(echo "$response" | grep -m 1 -Eo "($major_version\.[0-9]+\.[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)
|
||||||
fi
|
[ -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"
|
echo "$pecl_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,8 +190,11 @@ add_pecl_extension() {
|
|||||||
add_log "${tick:?}" "$extension" "Enabled"
|
add_log "${tick:?}" "$extension" "Enabled"
|
||||||
else
|
else
|
||||||
disable_extension_helper "$extension" >/dev/null 2>&1
|
disable_extension_helper "$extension" >/dev/null 2>&1
|
||||||
pecl_install "$extension-$pecl_version"
|
[ -n "$pecl_version" ] && pecl_version="-$pecl_version"
|
||||||
add_extension_log "$extension-$pecl_version" "Installed and enabled"
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,3 +206,8 @@ add_unstable_extension() {
|
|||||||
pecl_version=$(get_pecl_version "$extension" "$stability")
|
pecl_version=$(get_pecl_version "$extension" "$stability")
|
||||||
add_pecl_extension "$extension" "$pecl_version" "$prefix"
|
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
|
||||||
|
}
|
||||||
|
@ -5,7 +5,7 @@ add_couchbase_clibs() {
|
|||||||
if [[ "$ext" =~ couchbase-2.+ ]]; then
|
if [[ "$ext" =~ couchbase-2.+ ]]; then
|
||||||
release="2.10.9"
|
release="2.10.9"
|
||||||
else
|
else
|
||||||
release="$(curl -sL $trunk/latest | grep -Eo "libcouchbase-[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -d'-' -f 2)"
|
release=$(get -s -n "" "$trunk"/latest | grep -Eo -m 1 "[0-9]+\.[0-9]+\.[0-9]+" | head -n 1)
|
||||||
fi
|
fi
|
||||||
[ "$VERSION_ID" = "22.04" ] && vid=20.04 || vid="$VERSION_ID"
|
[ "$VERSION_ID" = "22.04" ] && vid=20.04 || vid="$VERSION_ID"
|
||||||
[ "$VERSION_CODENAME" = "jammy" ] && vcn=focal || vcn="$VERSION_CODENAME"
|
[ "$VERSION_CODENAME" = "jammy" ] && vcn=focal || vcn="$VERSION_CODENAME"
|
||||||
@ -69,7 +69,7 @@ add_couchbase() {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -e "${ext_dir:?}"/libcouchbase_php_core.dylib ]; then
|
if [ -e "${ext_dir:?}"/libcouchbase_php_core.dylib ]; then
|
||||||
sudo cp "${ext_dir:?}"/libcouchbase_php_core.dylib ${brew_prefix:?}/lib
|
sudo cp "${ext_dir:?}"/libcouchbase_php_core.dylib "${brew_prefix:?}"/lib
|
||||||
fi
|
fi
|
||||||
add_brew_extension couchbase extension
|
add_brew_extension couchbase extension
|
||||||
fi
|
fi
|
||||||
|
@ -4,7 +4,7 @@ Function Add-Choco() {
|
|||||||
# Source: https://docs.chocolatey.org/en-us/choco/setup
|
# Source: https://docs.chocolatey.org/en-us/choco/setup
|
||||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
[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 { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
add_firebird_client_darwin() {
|
add_firebird_client_darwin() {
|
||||||
firebird_tag='R3_0_7'
|
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)
|
pkg_name=$(get -s -n "" https://api.github.com/repos/FirebirdSQL/firebird/releases/tags/"$firebird_tag" | grep -Eo "Firebird-.*.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-.*.pkg" | head -n 1)
|
||||||
get -q -e "/tmp/firebird.pkg" https://github.com/FirebirdSQL/firebird/releases/download/"$firebird_tag"/"$pkg_name"
|
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 installer -pkg /tmp/firebird.pkg -target /
|
||||||
sudo mkdir -p /opt/firebird/include /opt/firebird/lib
|
sudo mkdir -p /opt/firebird/include /opt/firebird/lib
|
||||||
|
@ -17,6 +17,10 @@ add_gearman_helper() {
|
|||||||
# Function to add gearman extension.
|
# Function to add gearman extension.
|
||||||
add_gearman() {
|
add_gearman() {
|
||||||
status="Enabled"
|
status="Enabled"
|
||||||
add_gearman_helper >/dev/null 2>&1
|
if [ "$(uname -s)" = 'Linux' ]; then
|
||||||
add_extension_log "gearman" "$status"
|
add_gearman_helper >/dev/null 2>&1
|
||||||
|
add_extension_log "gearman" "$status"
|
||||||
|
else
|
||||||
|
add_brew_extension gearman extension
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
@ -47,10 +47,5 @@ Function Add-Http() {
|
|||||||
}
|
}
|
||||||
Add-Extension pecl_http >$null 2>&1
|
Add-Extension pecl_http >$null 2>&1
|
||||||
Repair-ICU
|
Repair-ICU
|
||||||
try {
|
Add-ExtensionLog http "Installed and enabled"
|
||||||
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 )"
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,3 +1,34 @@
|
|||||||
|
# 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'
|
||||||
|
if($extension_version -match '[3-4]') {
|
||||||
|
$nts = if (!$installed.ThreadSafe) { "_nts" } else { "" }
|
||||||
|
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 {
|
||||||
|
$match = (Invoke-WebRequest -Uri "$github/$releases/expanded_assets/v$Semver").Links.href | Select-String -Pattern "(phalcon_${arch}_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)"
|
||||||
|
}
|
||||||
|
} 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=.*(phalcon-php${version}${nts}-windows.*-x64.zip)"
|
||||||
|
} catch {
|
||||||
|
$match = (Invoke-WebRequest -Uri "$github/$releases/expanded_assets/v$Semver").Links.href | Select-String -Pattern "(phalcon-php${version}${nts}-windows.*-x64.zip)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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 to add phalcon using GitHub releases.
|
||||||
Function Add-PhalconFromGitHub() {
|
Function Add-PhalconFromGitHub() {
|
||||||
Param (
|
Param (
|
||||||
@ -6,16 +37,9 @@ Function Add-PhalconFromGitHub() {
|
|||||||
[string]
|
[string]
|
||||||
$Semver
|
$Semver
|
||||||
)
|
)
|
||||||
$domain = 'https://github.com'
|
$zip_url = Get-PhalconReleaseAssetUrl $Semver
|
||||||
$nts = if (!$installed.ThreadSafe) { "_nts" } else { "" }
|
if($zip_url) {
|
||||||
$match = Invoke-WebRequest -Uri "$domain/phalcon/cphalcon/releases/v$Semver" | Select-String -Pattern "href=`"(.*phalcon_x64_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)`""
|
Invoke-WebRequest -Uri $zip_url -OutFile $ENV:RUNNER_TOOL_CACHE\phalcon.zip > $null 2>&1
|
||||||
if($NULL -eq $match) {
|
|
||||||
$nts = if (!$installed.ThreadSafe) { "-nts" } else { "-ts" }
|
|
||||||
$match = Invoke-WebRequest -Uri "$domain/phalcon/cphalcon/releases/v$Semver" | Select-String -Pattern "href=`"(.*phalcon-php${version}${nts}-windows.*-x64.zip)`""
|
|
||||||
}
|
|
||||||
if($NULL -ne $match) {
|
|
||||||
$zip_file = $match.Matches[0].Groups[1].Value
|
|
||||||
Invoke-WebRequest -Uri $domain/$zip_file -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
|
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"
|
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\phalcon\php_phalcon.dll" -Destination "$ext_dir\php_phalcon.dll"
|
||||||
Enable-PhpExtension -Extension phalcon -Path $php_dir
|
Enable-PhpExtension -Extension phalcon -Path $php_dir
|
||||||
@ -23,17 +47,28 @@ Function Add-PhalconFromGitHub() {
|
|||||||
throw "Unable to get Phalcon release from the GitHub release"
|
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'
|
||||||
|
}
|
||||||
|
return Get-PeclPackageVersion phalcon $extension_version stable stable | Select-Object -First 1
|
||||||
|
}
|
||||||
|
|
||||||
# Function to install phalcon
|
# Function to install phalcon
|
||||||
Function Add-PhalconHelper() {
|
Function Add-PhalconHelper() {
|
||||||
if ($extension_version -eq '5') {
|
$semver = Get-PhalconSemver
|
||||||
Add-PhalconFromGitHub -Semver (Get-PeclPackageVersion phalcon 5 snapshot stable | Select-Object -First 1)
|
if (($extension_version -eq '3') -or ($extension_version -eq '5')) {
|
||||||
|
Add-PhalconFromGitHub $semver
|
||||||
} elseif ($extension_version -eq '4') {
|
} elseif ($extension_version -eq '4') {
|
||||||
Install-Phpextension -Extension phalcon -MinimumStability stable -Path $php_dir
|
Add-Extension -Extension phalcon -Stability stable -Extension_version $semver
|
||||||
} elseif ($extension_version -eq '3') {
|
|
||||||
Add-PhalconFromGitHub -Semver 3.4.5
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to add phalcon
|
||||||
Function Add-Phalcon() {
|
Function Add-Phalcon() {
|
||||||
Param (
|
Param (
|
||||||
[Parameter(Position = 0, Mandatory = $true)]
|
[Parameter(Position = 0, Mandatory = $true)]
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
# Helper function to get phalcon version
|
# Helper function to get phalcon version
|
||||||
get_phalcon_version() {
|
get_phalcon_version() {
|
||||||
if [ "$extension" = "phalcon5" ]; then
|
if [ "$extension" = "phalcon5" ]; then
|
||||||
semver="$(get_pecl_version phalcon stable 5)"
|
get_pecl_version phalcon stable 5
|
||||||
([ -n "$semver" ] && echo "$semver") || get_pecl_version phalcon rc 5
|
|
||||||
elif [ "$extension" = "phalcon4" ]; then
|
elif [ "$extension" = "phalcon4" ]; then
|
||||||
echo '4.1.3'
|
echo '4.1.2'
|
||||||
elif [ "$extension" = "phalcon3" ]; then
|
elif [ "$extension" = "phalcon3" ]; then
|
||||||
echo '3.4.5'
|
echo '3.4.5'
|
||||||
fi
|
fi
|
||||||
@ -33,7 +32,7 @@ add_phalcon_helper() {
|
|||||||
package="php${version:?}-$extension"
|
package="php${version:?}-$extension"
|
||||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
[ "$extension" = "phalcon4" ] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0)
|
[ "$extension" = "phalcon4" ] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0)
|
||||||
(check_package "$package" && install_packages "$package") || add_phalcon_from_repo
|
(check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +85,7 @@ add_phalcon5() {
|
|||||||
|
|
||||||
# Function to add phalcon.
|
# Function to add phalcon.
|
||||||
add_phalcon() {
|
add_phalcon() {
|
||||||
extension=$1
|
local extension=$1
|
||||||
status='Enabled'
|
status='Enabled'
|
||||||
extension_major_version=${extension: -1}
|
extension_major_version=${extension: -1}
|
||||||
if [[ "$extension_major_version" =~ [3-5] ]]; then
|
if [[ "$extension_major_version" =~ [3-5] ]]; then
|
||||||
|
143
src/scripts/extensions/relay.sh
Normal file
143
src/scripts/extensions/relay.sh
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
# Get relay version
|
||||||
|
get_relay_version() {
|
||||||
|
local ext=$1
|
||||||
|
if [[ "$ext" =~ ^relay$ ]]; then
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
grep -aq 00000000 "${ext_dir:?}"/relay.so && \
|
||||||
|
sudo LC_ALL=C sed -i.bak "s/00000000-0000-0000-0000-000000000000/$(uuidgen)/" "$ext_dir"/relay.so
|
||||||
|
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_releases"/download/"$relay_version"/"$artifact_file_name"
|
||||||
|
fallback_url="$relay_trunk"/"$artifact_file_name"
|
||||||
|
get -q -n /tmp/relay.tar.gz "$url" "$fallback_url"
|
||||||
|
if [ "$openssl_suffix" = '.libssl3' ] && (! [ -e /tmp/relay.tar.gz ] || ! file /tmp/relay.tar.gz | grep -q 'gzip'); then
|
||||||
|
get -q -n /tmp/relay.tar.gz "${url/.libssl3/}" "${fallback_url/.libssl3/}"
|
||||||
|
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"
|
||||||
|
}
|
@ -13,7 +13,7 @@ parse_args() {
|
|||||||
# Function to parse configure options for pecl
|
# Function to parse configure options for pecl
|
||||||
# Make sure we have all options in name="value" form i.e XML properties.
|
# Make sure we have all options in name="value" form i.e XML properties.
|
||||||
parse_pecl_configure_options() {
|
parse_pecl_configure_options() {
|
||||||
configure_opts=$(echo "$1" | sed -r -e "s#['\"]|--##g")
|
configure_opts=$(echo "$1" | sed -E -e "s#['\"]|--##g")
|
||||||
IFS=' ' read -r -a opts_array <<< "$configure_opts"
|
IFS=' ' read -r -a opts_array <<< "$configure_opts"
|
||||||
output_opts=()
|
output_opts=()
|
||||||
for opt in "${opts_array[@]}"; do
|
for opt in "${opts_array[@]}"; do
|
||||||
@ -146,6 +146,7 @@ add_extension_from_source() {
|
|||||||
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
||||||
else
|
else
|
||||||
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
||||||
|
[ "${debug:?}" = "debug" ] && suffix_opts="$suffix_opts --enable-debug"
|
||||||
patch_extension "$extension" >/dev/null 2>&1
|
patch_extension "$extension" >/dev/null 2>&1
|
||||||
run_group "phpize" "phpize"
|
run_group "phpize" "phpize"
|
||||||
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
||||||
|
@ -3,15 +3,7 @@ get_sqlsrv_version() {
|
|||||||
if [[ "${version:?}" =~ 7.[0-3] ]]; then
|
if [[ "${version:?}" =~ 7.[0-3] ]]; then
|
||||||
echo '5.9.0'
|
echo '5.9.0'
|
||||||
else
|
else
|
||||||
echo '5.10.0'
|
echo '5.10.1'
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
add_unixodbc() {
|
|
||||||
if [ "$(uname -s)" = 'Linux' ]; then
|
|
||||||
install_packages unixodbc-dev
|
|
||||||
else
|
|
||||||
brew install unixodbc
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,6 +11,10 @@ add_unixodbc() {
|
|||||||
add_sqlsrv() {
|
add_sqlsrv() {
|
||||||
ext=$1
|
ext=$1
|
||||||
ext_version=$(get_sqlsrv_version)
|
ext_version=$(get_sqlsrv_version)
|
||||||
add_unixodbc >/dev/null 2>&1
|
if [ "$(uname -s)" = 'Linux' ]; then
|
||||||
add_pecl_extension "$ext" "$ext_version" extension
|
install_packages unixodbc-dev
|
||||||
|
add_pecl_extension "$ext" "$ext_version" extension
|
||||||
|
else
|
||||||
|
add_brew_extension "$ext" extension
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
79
src/scripts/extensions/zephir_parser.ps1
Normal file
79
src/scripts/extensions/zephir_parser.ps1
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# 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"
|
||||||
|
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}.*windows.*.zip)"
|
||||||
|
} catch {
|
||||||
|
$match = (Invoke-WebRequest -Uri "$zp_releases/expanded_assets/$extension_version").Links.href | Select-String -Pattern "(zephir_parser-php-${version}.*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 (Invoke-WebRequest -UseBasicParsing -Uri $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) {
|
||||||
|
Invoke-WebRequest -Uri $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'
|
||||||
|
Add-ZephirParserFromGitHub $extension
|
||||||
|
}
|
||||||
|
Add-ExtensionLog zephir_parser $status
|
||||||
|
} catch {
|
||||||
|
Add-Log $cross $extension "Could not install $extension on PHP $($installed.FullVersion)"
|
||||||
|
}
|
||||||
|
}
|
37
src/scripts/extensions/zephir_parser.sh
Normal file
37
src/scripts/extensions/zephir_parser.sh
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# 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
|
||||||
|
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:?}.*$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:?}.*$os_suffix-.*.zip" | head -n 1)
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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,7 @@
|
|||||||
add_sudo() {
|
add_sudo() {
|
||||||
if ! command -v sudo >/dev/null; then
|
if ! command -v sudo >/dev/null; then
|
||||||
check_package sudo || apt-get update
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,9 +75,10 @@ check_package() {
|
|||||||
# Helper function to add an extension.
|
# Helper function to add an extension.
|
||||||
add_extension_helper() {
|
add_extension_helper() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
package=php"$version"-"$extension"
|
packages=(php"$version"-"$extension")
|
||||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
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"
|
add_extension_log "$extension" "Installed and enabled"
|
||||||
sudo chmod 777 "${ini_file[@]}"
|
sudo chmod 777 "${ini_file[@]}"
|
||||||
}
|
}
|
||||||
@ -88,14 +89,14 @@ add_devtools() {
|
|||||||
if ! command -v "$tool$version" >/dev/null; then
|
if ! command -v "$tool$version" >/dev/null; then
|
||||||
install_packages "php$version-dev"
|
install_packages "php$version-dev"
|
||||||
fi
|
fi
|
||||||
add_extension xml extension >/dev/null 2>&1
|
|
||||||
switch_version "phpize" "php-config"
|
switch_version "phpize" "php-config"
|
||||||
|
add_extension xml extension >/dev/null 2>&1
|
||||||
add_log "${tick:?}" "$tool" "Added $tool $semver"
|
add_log "${tick:?}" "$tool" "Added $tool $semver"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup the nightly build from shivammathur/php-builder
|
# Function to setup the nightly build from shivammathur/php-builder
|
||||||
setup_nightly() {
|
setup_nightly() {
|
||||||
run_script "php-builder" "${runner:?}" "$version"
|
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" ${ts:?}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
||||||
@ -133,15 +134,22 @@ switch_version() {
|
|||||||
wait "${to_wait[@]}"
|
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
|
# Function to install packaged PHP
|
||||||
add_packaged_php() {
|
add_packaged_php() {
|
||||||
if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
||||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
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' ' ')"
|
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
|
||||||
install_packages "${packages[@]}"
|
install_packages "${packages[@]}"
|
||||||
add_pecl
|
|
||||||
else
|
else
|
||||||
run_script "php-ubuntu" "$version"
|
run_script "php-ubuntu" "$version" "${debug:?}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,13 +167,14 @@ update_php() {
|
|||||||
|
|
||||||
# Function to install PHP.
|
# Function to install PHP.
|
||||||
add_php() {
|
add_php() {
|
||||||
if [[ "$version" =~ ${nightly_versions:?} ]]; then
|
if [[ "$version" =~ ${nightly_versions:?} ]] || [[ "${ts:?}" = "zts" ]]; then
|
||||||
setup_nightly
|
setup_nightly
|
||||||
elif [[ "$version" =~ ${old_versions:?} ]]; then
|
elif [[ "$version" =~ ${old_versions:?} ]]; then
|
||||||
setup_old_versions
|
setup_old_versions
|
||||||
else
|
else
|
||||||
add_packaged_php
|
add_packaged_php
|
||||||
switch_version >/dev/null 2>&1
|
switch_version >/dev/null 2>&1
|
||||||
|
add_pecl
|
||||||
fi
|
fi
|
||||||
status="Installed"
|
status="Installed"
|
||||||
}
|
}
|
||||||
@ -258,7 +267,7 @@ setup_php() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
version=${1:-'8.1'}
|
version=${1:-'8.2'}
|
||||||
ini=${2:-'production'}
|
ini=${2:-'production'}
|
||||||
src=${0%/*}/..
|
src=${0%/*}/..
|
||||||
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
||||||
|
@ -183,7 +183,7 @@ Function Add-Tool() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Function Add-ComposertoolHelper() {
|
Function Add-ComposerToolHelper() {
|
||||||
Param (
|
Param (
|
||||||
[Parameter(Position = 0, Mandatory = $true)]
|
[Parameter(Position = 0, Mandatory = $true)]
|
||||||
[string]
|
[string]
|
||||||
@ -201,11 +201,15 @@ Function Add-ComposertoolHelper() {
|
|||||||
[string]
|
[string]
|
||||||
$composer_args
|
$composer_args
|
||||||
)
|
)
|
||||||
|
$tool_version = $release.split(':')[1]
|
||||||
|
if($NULL -eq $tool_version) {
|
||||||
|
$tool_version = '*'
|
||||||
|
}
|
||||||
if($scope -eq 'global') {
|
if($scope -eq 'global') {
|
||||||
if(Test-Path $composer_lock) {
|
if(Test-Path $composer_lock) {
|
||||||
Remove-Item -Path $composer_lock -Force
|
Remove-Item -Path $composer_lock -Force
|
||||||
}
|
}
|
||||||
if((composer global show $prefix$tool -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
|
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 config --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
|
||||||
}
|
}
|
||||||
composer global require $prefix$release $composer_args >$null 2>&1
|
composer global require $prefix$release $composer_args >$null 2>&1
|
||||||
@ -215,11 +219,12 @@ Function Add-ComposertoolHelper() {
|
|||||||
$scoped_dir_suffix = (Get-FileHash -InputStream $release_stream -Algorithm sha256).Hash
|
$scoped_dir_suffix = (Get-FileHash -InputStream $release_stream -Algorithm sha256).Hash
|
||||||
$scoped_dir = "$composer_bin\_tools\$tool-$scoped_dir_suffix"
|
$scoped_dir = "$composer_bin\_tools\$tool-$scoped_dir_suffix"
|
||||||
$unix_scoped_dir = $scoped_dir.replace('\', '/')
|
$unix_scoped_dir = $scoped_dir.replace('\', '/')
|
||||||
if((composer show $prefix$tool -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$release" true >$null 2>&1
|
|
||||||
}
|
|
||||||
if(-not(Test-Path $scoped_dir)) {
|
if(-not(Test-Path $scoped_dir)) {
|
||||||
New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1
|
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
|
composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1
|
||||||
}
|
}
|
||||||
[System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
|
[System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
|
||||||
@ -229,7 +234,7 @@ Function Add-ComposertoolHelper() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup a tool using composer.
|
# Function to setup a tool using composer.
|
||||||
Function Add-Composertool() {
|
Function Add-ComposerTool() {
|
||||||
Param (
|
Param (
|
||||||
[Parameter(Position = 0, Mandatory = $true)]
|
[Parameter(Position = 0, Mandatory = $true)]
|
||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
@ -262,7 +267,7 @@ Function Add-Composertool() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Enable-PhpExtension -Extension curl, mbstring, openssl -Path $php_dir
|
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) {
|
if(Test-Path $composer_bin\composer) {
|
||||||
Copy-Item -Path "$bin_dir\composer" -Destination "$composer_bin\composer" -Force
|
Copy-Item -Path "$bin_dir\composer" -Destination "$composer_bin\composer" -Force
|
||||||
}
|
}
|
||||||
|
@ -153,16 +153,17 @@ add_tool() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup a tool using composer in a different scope.
|
# Function to setup a tool using composer in a different scope.
|
||||||
add_composertool_helper() {
|
add_composer_tool_helper() {
|
||||||
tool=$1
|
tool=$1
|
||||||
release=$2
|
release=$2
|
||||||
prefix=$3
|
prefix=$3
|
||||||
scope=$4
|
scope=$4
|
||||||
composer_args=$5
|
composer_args=$5
|
||||||
enable_extensions curl mbstring openssl
|
enable_extensions curl mbstring openssl
|
||||||
|
tool_version=${release##*:}; [ "$tool_version" = "$tool" ] && tool_version="*"
|
||||||
if [ "$scope" = "global" ]; then
|
if [ "$scope" = "global" ]; then
|
||||||
sudo rm -f "$composer_lock" >/dev/null 2>&1 || true
|
sudo rm -f "$composer_lock" >/dev/null 2>&1 || true
|
||||||
if composer global show "$prefix$tool" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
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
|
composer global config --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1
|
composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1
|
||||||
@ -172,7 +173,7 @@ add_composertool_helper() {
|
|||||||
if ! [ -d "$scoped_dir" ]; then
|
if ! [ -d "$scoped_dir" ]; then
|
||||||
mkdir -p "$scoped_dir"
|
mkdir -p "$scoped_dir"
|
||||||
echo '{}' | tee "$scoped_dir/composer.json" >/dev/null
|
echo '{}' | tee "$scoped_dir/composer.json" >/dev/null
|
||||||
if composer show "$prefix$tool" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
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
|
composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1
|
composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1
|
||||||
@ -183,7 +184,7 @@ add_composertool_helper() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup a tool using composer.
|
# Function to setup a tool using composer.
|
||||||
add_composertool() {
|
add_composer_tool() {
|
||||||
tool=$1
|
tool=$1
|
||||||
release=$2
|
release=$2
|
||||||
prefix=$3
|
prefix=$3
|
||||||
@ -198,7 +199,7 @@ add_composertool() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
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)
|
tool_version=$(get_tool_version cat /tmp/composer.log)
|
||||||
([ -s /tmp/composer.log ] && add_log "$tick" "$tool" "Added $tool $tool_version"
|
([ -s /tmp/composer.log ] && add_log "$tick" "$tool" "Added $tool $tool_version"
|
||||||
) || add_log "$cross" "$tool" "Could not setup $tool"
|
) || add_log "$cross" "$tool" "Could not setup $tool"
|
||||||
|
83
src/scripts/tools/brew.sh
Normal file
83
src/scripts/tools/brew.sh
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# 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_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_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 brew_path
|
||||||
|
export brew_path_dir
|
||||||
|
export brew_prefix
|
||||||
|
export brew_repo
|
||||||
|
export tap_dir
|
||||||
|
export core_repo
|
||||||
|
}
|
@ -7,7 +7,7 @@ Function Add-Msys2() {
|
|||||||
return $msys_location
|
return $msys_location
|
||||||
}
|
}
|
||||||
|
|
||||||
Function Add-Grpc_php_plugin() {
|
Function Add-GrpcPhpPlugin() {
|
||||||
$msys_location = Add-Msys2
|
$msys_location = Add-Msys2
|
||||||
$logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" >$null 2>&1
|
$logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" >$null 2>&1
|
||||||
$grpc_version = Get-ToolVersion 'Write-Output' "$logs"
|
$grpc_version = Get-ToolVersion 'Write-Output' "$logs"
|
||||||
|
@ -22,6 +22,8 @@ get_grpc_tag() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_grpc_php_plugin_brew() {
|
add_grpc_php_plugin_brew() {
|
||||||
|
. "${0%/*}"/tools/brew.sh
|
||||||
|
configure_brew
|
||||||
brew install grpc
|
brew install grpc
|
||||||
brew link --force --overwrite grpc >/dev/null 2>&1
|
brew link --force --overwrite grpc >/dev/null 2>&1
|
||||||
grpc_tag="v$(brew info grpc | grep "grpc:" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")"
|
grpc_tag="v$(brew info grpc | grep "grpc:" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")"
|
||||||
|
@ -140,6 +140,20 @@ add_list() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to check if a PPA exists
|
||||||
|
check_ppa() {
|
||||||
|
ppa=$1
|
||||||
|
ppa_url=${2:-"$lp_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.
|
# Function to remove a PPA.
|
||||||
remove_list() {
|
remove_list() {
|
||||||
ppa=${1-ondrej/php}
|
ppa=${1-ondrej/php}
|
||||||
@ -153,8 +167,10 @@ add_ppa() {
|
|||||||
set_base_version
|
set_base_version
|
||||||
ppa=${1:-ondrej/php}
|
ppa=${1:-ondrej/php}
|
||||||
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||||
|
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lp_ppa/$ppa/ubuntu" "$lp_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||||
add_list "$ppa"
|
add_list "$ppa"
|
||||||
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
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
|
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
||||||
else
|
else
|
||||||
add_list "$ppa"
|
add_list "$ppa"
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
Function Get-ProtobufTag() {
|
Function Get-ProtobufTag() {
|
||||||
|
$releases = 'https://github.com/protocolbuffers/protobuf/releases'
|
||||||
if("$protobuf_tag" -eq "latest") {
|
if("$protobuf_tag" -eq "latest") {
|
||||||
$protobuf_tag = (Invoke-RestMethod https://api.github.com/repos/protocolbuffers/protobuf/releases).tag_name | Where-Object { $_ -match "v\d+.\d+.\d+$" } | Select-Object -First 1
|
$protobuf_tag = (Invoke-WebRequest -UseBasicParsing -Uri $releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1]
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
[net.httpWebRequest] $request = [net.webRequest]::create("https://github.com/protocolbuffers/protobuf/releases/tag/v$protobuf_tag")
|
$protobuf_tag = $protobuf_tag -replace '^v', ''
|
||||||
$req.Method = "HEAD"
|
[net.httpWebRequest] $request = [net.webRequest]::create("$releases/tag/v$protobuf_tag")
|
||||||
|
$request.Method = "HEAD"
|
||||||
[net.httpWebResponse] $response = $request.getResponse()
|
[net.httpWebResponse] $response = $request.getResponse()
|
||||||
$response.Close()
|
$response.Close()
|
||||||
$protobuf_tag = "v$protobuf_tag"
|
$protobuf_tag = "v$protobuf_tag"
|
||||||
} catch {
|
} catch {
|
||||||
$protobuf_tag = (Invoke-RestMethod https://api.github.com/repos/protocolbuffers/protobuf/releases).tag_name | Where-Object { $_ -match "v\d+.\d+.\d+$" } | Select-Object -First 1
|
$protobuf_tag = (Invoke-WebRequest -UseBasicParsing -Uri $releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $protobuf_tag
|
return $protobuf_tag
|
||||||
@ -18,7 +20,7 @@ Function Get-ProtobufTag() {
|
|||||||
Function Add-Protoc() {
|
Function Add-Protoc() {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $true, Position = 0, HelpMessage = 'The PHP version to be installed')]
|
[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
|
[string] $protobuf_tag
|
||||||
)
|
)
|
||||||
$protobuf_tag = Get-ProtobufTag
|
$protobuf_tag = Get-ProtobufTag
|
||||||
|
@ -1,12 +1,35 @@
|
|||||||
add_symfony() {
|
add_symfony_with_brew() {
|
||||||
|
add_brew_tap symfony-cli/homebrew-tap
|
||||||
|
brew install symfony-cli/tap/symfony-cli
|
||||||
|
}
|
||||||
|
|
||||||
|
get_symfony_artifact_url() {
|
||||||
|
arch=$(dpkg --print-architecture)
|
||||||
|
url=$(get -s -n "" https://raw.githubusercontent.com/symfony-cli/homebrew-tap/main/Formula/symfony-cli.rb 2<&1 | grep -m 1 "url.*linux.*${arch}" | cut -d\" -f 2)
|
||||||
|
if [ -z "$url" ]; then
|
||||||
|
url=$(get -s -n "" https://api.github.com/repos/symfony-cli/symfony-cli/releases 2<&1 | grep -m 1 "url.*linux.*${arch}.*gz\"" | cut -d\" -f 4)
|
||||||
|
fi
|
||||||
|
echo "$url"
|
||||||
|
}
|
||||||
|
|
||||||
|
add_symfony_helper() {
|
||||||
if [ "$(uname -s)" = "Linux" ]; then
|
if [ "$(uname -s)" = "Linux" ]; then
|
||||||
echo 'deb [trusted=yes] https://repo.symfony.com/apt/ /' | sudo tee /etc/apt/sources.list.d/symfony-cli.list >/dev/null 2>&1
|
url="$(get_symfony_artifact_url)"
|
||||||
update_lists symfony repo.symfony.com
|
if [ -z "$url" ]; then
|
||||||
install_packages symfony-cli
|
. "${0%/*}"/tools/brew.sh
|
||||||
|
configure_brew
|
||||||
|
add_symfony_with_brew
|
||||||
|
else
|
||||||
|
get -s -n "" "$url" | sudo tar -xz -C "${tool_path_dir:?}" 2>/dev/null
|
||||||
|
sudo chmod a+x /usr/local/bin/symfony
|
||||||
|
fi
|
||||||
elif [ "$(uname -s)" = "Darwin" ]; then
|
elif [ "$(uname -s)" = "Darwin" ]; then
|
||||||
add_brew_tap symfony-cli/homebrew-tap
|
add_symfony_with_brew
|
||||||
brew install symfony-cli/tap/symfony-cli >/dev/null 2>&1
|
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_symfony() {
|
||||||
|
add_symfony_helper >/dev/null 2>&1
|
||||||
symfony_path="$(command -v symfony)"
|
symfony_path="$(command -v symfony)"
|
||||||
if [[ -n "$symfony_path" ]]; then
|
if [[ -n "$symfony_path" ]]; then
|
||||||
sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli
|
sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli
|
||||||
|
@ -4,7 +4,7 @@ export cross="✗"
|
|||||||
export curl_opts=(-sL)
|
export curl_opts=(-sL)
|
||||||
export old_versions="5.[3-5]"
|
export old_versions="5.[3-5]"
|
||||||
export jit_versions="8.[0-9]"
|
export jit_versions="8.[0-9]"
|
||||||
export nightly_versions="8.[2-9]"
|
export nightly_versions="8.[3-9]"
|
||||||
export xdebug3_versions="7.[2-4]|8.[0-9]"
|
export xdebug3_versions="7.[2-4]|8.[0-9]"
|
||||||
export latest="releases/latest/download"
|
export latest="releases/latest/download"
|
||||||
export github="https://github.com/shivammathur"
|
export github="https://github.com/shivammathur"
|
||||||
@ -43,13 +43,15 @@ set_output() {
|
|||||||
name=$1
|
name=$1
|
||||||
value=$2
|
value=$2
|
||||||
if [ "${GITHUB_ACTIONS}" = "true" ]; then
|
if [ "${GITHUB_ACTIONS}" = "true" ]; then
|
||||||
echo "::set-output name=${name}::${value}"
|
echo "${name}=${value}" | tee -a "$GITHUB_OUTPUT" >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to read env inputs.
|
# Function to read env inputs.
|
||||||
read_env() {
|
read_env() {
|
||||||
update="${update:-${UPDATE:-false}}"
|
update="${update:-${UPDATE:-false}}"
|
||||||
|
[ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release
|
||||||
|
[ "${phpts:-${PHPTS:-nts}}" = "ts" ] && ts=zts && update=true || ts=nts
|
||||||
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
||||||
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
||||||
runner="${runner:-${RUNNER:-$_runner}}"
|
runner="${runner:-${RUNNER:-$_runner}}"
|
||||||
@ -58,6 +60,16 @@ read_env() {
|
|||||||
fail_fast=true
|
fail_fast=true
|
||||||
add_log "$cross" "Runner" "Runner set as github in self-hosted environment"
|
add_log "$cross" "Runner" "Runner set as github in self-hosted environment"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set Update to true if the ubuntu github image does not have PHP PPA.
|
||||||
|
if [[ "$runner" = "github" && "${ImageOS}" =~ ubuntu.* ]]; then
|
||||||
|
check_ppa ondrej/php || update=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
export fail_fast
|
||||||
|
export runner
|
||||||
|
export update
|
||||||
|
export ts
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to download a file using cURL.
|
# Function to download a file using cURL.
|
||||||
|
@ -3,7 +3,7 @@ param (
|
|||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateLength(1, [int]::MaxValue)]
|
[ValidateLength(1, [int]::MaxValue)]
|
||||||
[string]
|
[string]
|
||||||
$version = '8.1',
|
$version = '8.2',
|
||||||
[Parameter(Position = 1, Mandatory = $true)]
|
[Parameter(Position = 1, Mandatory = $true)]
|
||||||
[ValidateNotNull()]
|
[ValidateNotNull()]
|
||||||
[ValidateLength(1, [int]::MaxValue)]
|
[ValidateLength(1, [int]::MaxValue)]
|
||||||
@ -43,7 +43,7 @@ Function Set-Output() {
|
|||||||
$value
|
$value
|
||||||
)
|
)
|
||||||
if ($env:GITHUB_ACTIONS -eq 'true') {
|
if ($env:GITHUB_ACTIONS -eq 'true') {
|
||||||
Write-Output "::set-output name=$output::$value"
|
Add-Content "$output=$value" -Path $env:GITHUB_OUTPUT -Encoding utf8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,10 +218,22 @@ Function Add-PhpConfig {
|
|||||||
# Function to get PHP from GitHub releases cache
|
# Function to get PHP from GitHub releases cache
|
||||||
Function Set-PhpCache {
|
Function Set-PhpCache {
|
||||||
try {
|
try {
|
||||||
$release = Invoke-RestMethod https://api.github.com/repos/shivammathur/php-builder-windows/releases/tags/php$version
|
try {
|
||||||
$asset = $release.assets | ForEach-Object {
|
$release = Invoke-RestMethod https://api.github.com/repos/shivammathur/php-builder-windows/releases/tags/php$version
|
||||||
if($_.name -match "php-$version.[0-9]+$env:PHPTS-Win32-.*-$arch.zip") {
|
$asset = $release.assets | ForEach-Object {
|
||||||
return $_.name
|
if($_.name -match "php-$version.[0-9]+$env:PHPTS-Win32-.*-$arch.zip") {
|
||||||
|
return $_.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($null -eq $asset) {
|
||||||
|
throw "Asset not found"
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
$release = Invoke-WebRequest $php_builder/releases/expanded_assets/php$version
|
||||||
|
$asset = $release.links.href | ForEach-Object {
|
||||||
|
if($_ -match "php-$version.[0-9]+$env:PHPTS-Win32-.*-$arch.zip") {
|
||||||
|
return $_.split('/')[-1]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset
|
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset
|
||||||
@ -229,6 +241,20 @@ Function Set-PhpCache {
|
|||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to add debug symbols to PHP.
|
||||||
|
Function Add-DebugSymbols {
|
||||||
|
$release = Invoke-RestMethod https://api.github.com/repos/shivammathur/php-builder-windows/releases/tags/php$version
|
||||||
|
$dev = if ($version -match $nightly_versions) { '-dev' } else { '' }
|
||||||
|
$asset = $release.assets | ForEach-Object {
|
||||||
|
if($_.name -match "php-debug-pack-$version.[0-9]+$dev$env:PHPTS-Win32-.*-$arch.zip") {
|
||||||
|
return $_.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset
|
||||||
|
Expand-Archive -Path $php_dir\$asset -DestinationPath $php_dir -Force
|
||||||
|
Get-ChildItem -Path $php_dir -Filter php_*.pdb | Move-Item -Destination $ext_dir
|
||||||
|
}
|
||||||
|
|
||||||
# Function to install nightly version of PHP
|
# Function to install nightly version of PHP
|
||||||
Function Install-PhpNightly {
|
Function Install-PhpNightly {
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
|
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
|
||||||
@ -351,6 +377,10 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
|
|||||||
Add-PhpConfig
|
Add-PhpConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($env:DEBUG -eq 'true') {
|
||||||
|
Add-DebugSymbols
|
||||||
|
}
|
||||||
|
|
||||||
$installed = Get-Php -Path $php_dir
|
$installed = Get-Php -Path $php_dir
|
||||||
if($installed.MajorMinorVersion -ne $version) {
|
if($installed.MajorMinorVersion -ne $version) {
|
||||||
Add-Log $cross "PHP" "Could not setup PHP $version"
|
Add-Log $cross "PHP" "Could not setup PHP $version"
|
||||||
|
13
src/tools.ts
13
src/tools.ts
@ -201,7 +201,7 @@ export async function addArchive(data: RS): Promise<string> {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export async function addPackage(data: RS): Promise<string> {
|
export async function addPackage(data: RS): Promise<string> {
|
||||||
const command = await utils.getCommand(data['os'], 'composertool');
|
const command = await utils.getCommand(data['os'], 'composer_tool');
|
||||||
const parts: string[] = data['repository'].split('/');
|
const parts: string[] = data['repository'].split('/');
|
||||||
const args: string = await utils.joins(
|
const args: string = await utils.joins(
|
||||||
parts[1],
|
parts[1],
|
||||||
@ -218,11 +218,12 @@ export async function addPackage(data: RS): Promise<string> {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export async function addBlackfirePlayer(data: RS): Promise<string> {
|
export async function addBlackfirePlayer(data: RS): Promise<string> {
|
||||||
if (
|
if (data['version'] == 'latest') {
|
||||||
/5\.[5-6]|7\.0/.test(data['php_version']) &&
|
if (/5\.[5-6]|7\.0/.test(data['php_version'])) {
|
||||||
data['version'] == 'latest'
|
data['version'] = '1.9.3';
|
||||||
) {
|
} else if (/7\.[1-4]|8\.0/.test(data['php_version'])) {
|
||||||
data['version'] = '1.9.3';
|
data['version'] = '1.22.0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data['url'] = await getPharUrl(data);
|
data['url'] = await getPharUrl(data);
|
||||||
return addArchive(data);
|
return addArchive(data);
|
||||||
|
12
src/utils.ts
12
src/utils.ts
@ -246,7 +246,8 @@ export async function CSVArray(values_csv: string): Promise<Array<string>> {
|
|||||||
return value
|
return value
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/^["']|["']$|(?<==)["']/g, '')
|
.replace(/^["']|["']$|(?<==)["']/g, '')
|
||||||
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'");
|
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'")
|
||||||
|
.replace(/=(.*?)(=.*)/, "='$1$2'");
|
||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
@ -319,7 +320,14 @@ export async function getCommand(os: string, suffix: string): Promise<string> {
|
|||||||
case 'darwin':
|
case 'darwin':
|
||||||
return 'add_' + suffix + ' ';
|
return 'add_' + suffix + ' ';
|
||||||
case 'win32':
|
case 'win32':
|
||||||
return 'Add-' + suffix.charAt(0).toUpperCase() + suffix.slice(1) + ' ';
|
return (
|
||||||
|
'Add-' +
|
||||||
|
suffix
|
||||||
|
.split('_')
|
||||||
|
.map((part: string) => part.charAt(0).toUpperCase() + part.slice(1))
|
||||||
|
.join('') +
|
||||||
|
' '
|
||||||
|
);
|
||||||
default:
|
default:
|
||||||
return await log('Platform ' + os + ' is not supported', os, 'error');
|
return await log('Platform ' + os + ' is not supported', os, 'error');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user