Compare commits

..

1 Commits

Author SHA1 Message Date
2ed2e6e7ad Release v2-verbose 2025-09-18 22:52:31 +05:30
63 changed files with 804 additions and 1375 deletions

11
.github/SECURITY.md vendored
View File

@ -2,20 +2,23 @@
## Supported Versions ## Supported Versions
The latest patch version of `v2` release of this project is supported for security updates. The latest patch versions of `v1` and `v2` releases of this project are supported for security updates.
## Supported PHP Versions ## Supported PHP Versions
This security policy only applies to the latest patch releases of the following PHP versions. This security policy only applies to the latest patches of the following PHP versions.
| Version | Supported | | Version | Supported |
|---------|--------------------| |---------|--------------------|
| 8.1 | :white_check_mark: | | 8.1 | :white_check_mark: |
| 8.2 | :white_check_mark: | | 8.2 | :white_check_mark: |
| 8.3 | :white_check_mark: | | 8.3 | :white_check_mark: |
| 8.4 | :white_check_mark: |
## Reporting a Vulnerability ## Reporting a Vulnerability
If you have found any issues that might have security implications in the versions supported, please send a report privately to [contact@setup-php.com](mailto:contact@setup-php.com). If you have found any issues that might have security implications in the versions supported, please send a report privately to [contact@shivammathur.com](mailto:contact@shivammathur.com).
Do not report security reports publicly. Do not report security reports publicly.
## Tidelift
If you use this GitHub Action through a Tidelift subscription, please refer to [https://tidelift.com/security](https://tidelift.com/security).

View File

@ -21,13 +21,13 @@ jobs:
fetch-depth: 2 fetch-depth: 2
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v4 uses: github/codeql-action/init@v3
with: with:
config-file: ./.github/codeql/codeql-configuration.yml config-file: ./.github/codeql/codeql-configuration.yml
languages: javascript languages: javascript
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v4 uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4 uses: github/codeql-action/analyze@v3

View File

@ -16,8 +16,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
operating-system: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-15-intel] operating-system: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-13]
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
steps: steps:
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
@ -88,7 +88,7 @@ jobs:
Remove-Item "$env:file.all" -Force Remove-Item "$env:file.all" -Force
Remove-Item "$env:file.builtin" -Force Remove-Item "$env:file.builtin" -Force
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v5 uses: actions/upload-artifact@v4
with: with:
name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
@ -105,7 +105,7 @@ jobs:
with: with:
repository: ${{ github.repository }}.wiki repository: ${{ github.repository }}.wiki
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v6 uses: actions/download-artifact@v5
with: with:
path: ${{ github.workspace }}/lists path: ${{ github.workspace }}/lists
pattern: lists-* pattern: lists-*
@ -116,11 +116,11 @@ jobs:
git config --local user.name "${{ github.repository_owner }}" git config --local user.name "${{ github.repository_owner }}"
- name: Combine - name: Combine
run: | run: |
for os in ubuntu-24.04 ubuntu-22.04 windows-2025 windows-2022 windows-2019 macos-13 macos-14 macos-15 macos-26; do for os in ubuntu-24.04 ubuntu-22.04 windows-2022 windows-2019 macos-13 macos-14 macos-15; do
echo "These are extensions which are loaded by default on the following PHP versions. More extensions which are available as packages and available on pecl are supported by setup-php. Refer to [php extension support](https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support) for more details." > Php-extensions-loaded-on-"$os".md echo "These are extensions which are loaded by default on the following PHP versions. More extensions which are available as packages and available on pecl are supported by setup-php. Refer to [php extension support](https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support) for more details." > Php-extensions-loaded-on-"$os".md
for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 8.6; do for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5; do
if [[ "${os%-*}" = "macos" ]]; then if [[ "${os%-*}" = "macos" ]]; then
cat lists/php"$version"-macos-15-intel.md >> Php-extensions-loaded-on-"$os".md cat lists/php"$version"-macos-13.md >> Php-extensions-loaded-on-"$os".md
elif [ "${os%-*}" = "windows" ]; then elif [ "${os%-*}" = "windows" ]; then
cat lists/php"$version"-windows-2022.md >> Php-extensions-loaded-on-"$os".md cat lists/php"$version"-windows-2022.md >> Php-extensions-loaded-on-"$os".md
else else

View File

@ -34,7 +34,7 @@ jobs:
fetch-depth: 2 fetch-depth: 2
- name: Setup Node.js 20.x - name: Setup Node.js 20.x
uses: actions/setup-node@v6 uses: actions/setup-node@v5
with: with:
node-version: 20.x node-version: 20.x

View File

@ -28,8 +28,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
operating-system: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-15-intel] operating-system: [ubuntu-24.04, ubuntu-22.04, windows-2022, macos-13]
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
include: include:
- operating-system: ubuntu-24.04 - operating-system: ubuntu-24.04
php-versions: '' php-versions: ''

View File

@ -28,7 +28,7 @@ jobs:
ref: ${{ github.event.inputs.tag }} ref: ${{ github.event.inputs.tag }}
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v6 uses: actions/setup-node@v5
with: with:
node-version: '20.x' node-version: '20.x'
registry-url: https://registry.npmjs.org registry-url: https://registry.npmjs.org
@ -46,7 +46,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Change to GitHub Packages registry - name: Change to GitHub Packages registry
uses: actions/setup-node@v6 uses: actions/setup-node@v5
with: with:
registry-url: https://npm.pkg.github.com registry-url: https://npm.pkg.github.com
scope: '@shivammathur' scope: '@shivammathur'

View File

@ -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/main/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a> <a href="https://github.com/shivammathur/setup-php/blob/main/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.6-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.5-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>
@ -69,7 +69,7 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
### GitHub-Hosted Runners ### GitHub-Hosted Runners
| Virtual environment | Arch | YAML workflow label | Pre-installed PHP | | Virtual environment | Arch | YAML workflow label | Pre-installed PHP |
|---------------------|---------|------------------------------------|-------------------| |---------------------|---------|------------------------------------|------------------------|
| Ubuntu 24.04 | x86_64 | `ubuntu-latest` or `ubuntu-24.04` | `PHP 8.3` | | Ubuntu 24.04 | x86_64 | `ubuntu-latest` or `ubuntu-24.04` | `PHP 8.3` |
| Ubuntu 22.04 | x86_64 | `ubuntu-22.04` | `PHP 8.1` | | Ubuntu 22.04 | x86_64 | `ubuntu-22.04` | `PHP 8.1` |
| Ubuntu 24.04 | aarch64 | `ubuntu-24.04-arm` | `PHP 8.3` | | Ubuntu 24.04 | aarch64 | `ubuntu-24.04-arm` | `PHP 8.3` |
@ -80,7 +80,6 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
| macOS Tahoe 26.x | arm64 | `macos-26` | - | | macOS Tahoe 26.x | arm64 | `macos-26` | - |
| macOS Sequoia 15.x | arm64 | `macos-latest` or `macos-15` | - | | macOS Sequoia 15.x | arm64 | `macos-latest` or `macos-15` | - |
| macOS Sonoma 14.x | arm64 | `macos-14` | - | | macOS Sonoma 14.x | arm64 | `macos-14` | - |
| macOS Sequoia 15.x | x86_64 | `macos-15-intel` | `PHP 8.3` |
| macOS Ventura 13.x | x86_64 | `macos-13` | `PHP 8.3` | | macOS Ventura 13.x | x86_64 | `macos-13` | `PHP 8.3` |
### Self-Hosted Runners ### Self-Hosted Runners
@ -104,11 +103,11 @@ 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 can be set up 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.6 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14). - PHP 5.3 to PHP 8.5 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14).
- PHP 5.6 to PHP 8.6 on GitHub-hosted macOS ARM64 runners (macos-14). - PHP 5.6 to PHP 8.5 on GitHub-hosted macOS ARM64 runners (macos-14).
- PHP 5.6 to PHP 8.6 on self-hosted runners. - PHP 5.6 to PHP 8.5 on self-hosted runners.
| PHP Version | Stability | Release Support | Runner Support | | PHP Version | Stability | Release Support | Runner Support |
|-------------|-----------|-----------------------|--------------------------------| |-------------|-----------|-----------------------|--------------------------------|
@ -126,12 +125,11 @@ On all supported OS/Platforms, the following PHP versions can be set up as per t
| `8.2` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` | | `8.2` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
| `8.3` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` | | `8.3` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
| `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` | | `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
| `8.5` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` | | `8.5` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
| `8.6` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
> [!Note] > [!Note]
> - Specifying `8.6` in `php-version` input installs a nightly build of `PHP 8.6.0-dev` from the master branch of PHP. See [nightly build setup](#nightly-build-setup) for more information. > - Specifying `8.5` in `php-version` input installs a nightly build of `PHP 8.5.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
> - To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section. > - 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
@ -215,7 +213,7 @@ This disables all core and third-party shared extensions and thus, can break som
- These extensions have custom support: - These extensions have custom support:
- `cubrid` and `pdo_cubrid` on `Ubuntu`. - `cubrid` and `pdo_cubrid` on `Ubuntu`.
- `event`, `gearman`, `geos` and `relay` on `Ubuntu` and `macOS`. - `event`, `gearman`, `geos` and `relay` on `Ubuntu` and `macOS`.
- `blackfire`, `couchbase`, `ibm_db2`, `ioncube`, `oci8`, `pdo_firebird`, `pdo_ibm`, `pdo_oci`, `pecl_http`, `phalcon3`, `phalcon4`, `phalcon5`, and `zephir_parser` 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`.
@ -563,17 +561,17 @@ jobs:
### Nightly Build Setup ### Nightly Build Setup
> Set up a nightly build of `PHP 8.6`. > Set up a nightly build of `PHP 8.5`.
- These PHP versions are currently in active development and might contain bugs and breaking changes. - These PHP versions are currently in active development and might contain bugs and breaking changes.
- Some user space extensions might not support these versions currently. - Some user space extensions might not support this version currently.
```yaml ```yaml
steps: steps:
- name: Setup nightly PHP - name: Setup nightly PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '8.6' php-version: '8.5'
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
@ -1002,14 +1000,18 @@ Examples of using `setup-php` with various PHP frameworks and packages.
## :sparkling_heart: Support This Project ## :sparkling_heart: Support This Project
- Please star the project and share it. If you blog, please share your experience of using `setup-php`.
- Please [reach out](mailto:contact@setup-php.com) if you have any questions about sponsoring setup-php.
Many users and organisations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
<a href="https://github.com/sponsors/shivammathur"><img src="https://setup-php.com/sponsors.svg?" alt="Sponsor shivammathur"></a>
These companies generously provide setup-php their products and services to aid in the development of this project. These companies generously provide setup-php their products and services to aid in the development of this project.
<p> <p>
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-light-mode-only"> <a target="_blank" href="https://www.jetbrains.com/?from=setup-php">
<img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140" height="100"> <img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140" height="80">
</a>
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140" height="100">
</a> </a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only"> <a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only">
@ -1026,22 +1028,11 @@ These companies generously provide setup-php their products and services to aid
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200" height="80"> <img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200" height="80">
</a> </a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-light-mode-only"> <a target="_blank" href="#">
<img src="https://setup-php.com/sponsors/digitalocean.svg" alt="Digitalocean" width="100" height="100"> <img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="94" height="80">
</a>
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/digitalocean-white.svg" alt="Digitalocean" width="100" height="100">
</a> </a>
</p> </p>
Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
<a href="https://github.com/sponsors/shivammathur"><img src="https://setup-php.com/sponsors.svg?" alt="Sponsor shivammathur"></a>
- If you use setup-php, please consider starring the project and share it.
- If you blog, please share your experience of using `setup-php`.
- Please [reach out](mailto:contact@setup-php.com) if you have any questions about sponsoring setup-php.
## :package: Dependencies ## :package: Dependencies
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies") - [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
@ -1084,7 +1075,7 @@ Many users and organizations support setup-php via [GitHub Sponsors](https://git
[`cs2pr`]: https://github.com/staabm/annotate-pull-request-from-checkstyle [`cs2pr`]: https://github.com/staabm/annotate-pull-request-from-checkstyle
[`deployer`]: https://deployer.org/ [`deployer`]: https://deployer.org/
[`ecs`]: https://github.com/easy-coding-standard/easy-coding-standard [`ecs`]: https://github.com/easy-coding-standard/easy-coding-standard
[`flex`]: https://github.com/symfony/flex [`flex`]: https://flex.symfony.com/
[`grpc_php_plugin`]: https://grpc.io/ [`grpc_php_plugin`]: https://grpc.io/
[`infection`]: https://infection.github.io/ [`infection`]: https://infection.github.io/
[`mago`]: https://github.com/carthage-software/mago [`mago`]: https://github.com/carthage-software/mago

View File

@ -18,8 +18,6 @@ describe('Extension tests', () => {
${'oci8'} | ${'7.4'} | ${'Add-Oci oci8'} ${'oci8'} | ${'7.4'} | ${'Add-Oci oci8'}
${'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.4'} | ${'Add-Oci pdo_oci'} ${'pdo_oci'} | ${'7.4'} | ${'Add-Oci pdo_oci'}
${'ibm_db2'} | ${'7.4'} | ${'Add-Ibm ibm_db2'}
${'pdo_ibm'} | ${'7.4'} | ${'Add-Ibm pdo_ibm'}
${'pecl_http'} | ${'7.4'} | ${'Add-Http'} ${'pecl_http'} | ${'7.4'} | ${'Add-Http'}
${'pdo_sqlsrv'} | ${'7.4'} | ${'Add-Sqlsrv pdo_sqlsrv'} ${'pdo_sqlsrv'} | ${'7.4'} | ${'Add-Sqlsrv pdo_sqlsrv'}
${'phalcon3'} | ${'7.2'} | ${'Add-Phalcon phalcon3'} ${'phalcon3'} | ${'7.2'} | ${'Add-Phalcon phalcon3'}
@ -58,13 +56,11 @@ describe('Extension tests', () => {
${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'} ${'mongodb-mongodb/mongo-php-driver@master'} | ${'7.3'} | ${'add_extension_from_source mongodb https://github.com mongodb mongo-php-driver master extension'}
${'oci8'} | ${'7.3'} | ${'add_oci oci8'} ${'oci8'} | ${'7.3'} | ${'add_oci oci8'}
${'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'}
${'ibm_db2'} | ${'7.3'} | ${'add_ibm ibm_db2'}
${'pdo-odbc'} | ${'7.4'} | ${'add_pdo_extension odbc'} ${'pdo-odbc'} | ${'7.4'} | ${'add_pdo_extension odbc'}
${'pdo_cubrid'} | ${'7.0'} | ${'add_cubrid pdo_cubrid'} ${'pdo_cubrid'} | ${'7.0'} | ${'add_cubrid pdo_cubrid'}
${'pdo_cubrid'} | ${'7.4'} | ${'add_pdo_extension cubrid'} ${'pdo_cubrid'} | ${'7.4'} | ${'add_pdo_extension cubrid'}
${'pdo_mysql'} | ${'7.4'} | ${'add_pdo_extension mysql'} ${'pdo_mysql'} | ${'7.4'} | ${'add_pdo_extension mysql'}
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'} ${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
${'pdo_ibm'} | ${'7.3'} | ${'add_ibm pdo_ibm'}
${'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'}

View File

@ -244,19 +244,6 @@ describe('Tools tests', () => {
} }
); );
it('checking getUrl handles undefined version without double slash', async () => {
const data = getData({
tool: 'cs2pr',
repository: 'staabm/annotate-pull-request-from-checkstyle',
domain: 'https://github.com'
});
data['extension'] = '';
delete data['version'];
expect(await tools.getUrl(data)).toBe(
'https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/cs2pr'
);
});
it.each` it.each`
version | version_prefix | url version | version_prefix | url
${'latest'} | ${''} | ${'https://example.com/tool.phar'} ${'latest'} | ${''} | ${'https://example.com/tool.phar'}
@ -396,8 +383,8 @@ describe('Tools tests', () => {
${'preview'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-preview.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'} ${'preview'} | ${'7.1'} | ${'true'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-preview.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
${'1'} | ${'7.1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-1.phar'} | ${'https://getcomposer.org/composer-1.phar'} ${'1'} | ${'7.1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-1.phar'} | ${'https://getcomposer.org/composer-1.phar'}
${'2'} | ${'7.1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-2.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'} ${'2'} | ${'7.1'} | ${'false'} | ${'https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.1-2.phar'} | ${'https://getcomposer.org/download/latest-2.2.x/composer.phar'}
${'1.2.3'} | ${'7.4'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3/composer.phar'} | ${'https://getcomposer.org/download/1.2.3/composer.phar'} ${'1.2.3'} | ${'7.4'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3.phar'}
${'1.2.3-RC1'} | ${'7.4'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3-RC1/composer.phar'} | ${'https://getcomposer.org/download/1.2.3-RC1/composer.phar'} ${'1.2.3-RC1'} | ${'7.4'} | ${'false'} | ${'https://github.com/composer/composer/releases/download/1.2.3-RC1/composer.phar'} | ${'https://getcomposer.org/composer-1.2.3-RC1.phar'}
`( `(
'checking addComposer: $version, $php_version, $no_tool_cache', 'checking addComposer: $version, $php_version, $no_tool_cache',
async ({version, php_version, no_tool_cache, cache_url, source_url}) => { async ({version, php_version, no_tool_cache, cache_url, source_url}) => {

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -19,7 +19,7 @@ jobs:
# blackfire-player supports PHP >= 5.5 # blackfire-player supports PHP >= 5.5
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -19,7 +19,7 @@ jobs:
# Blackfire supports PHP >= 5.3 on Ubuntu and macOS, and PHP >= 5.4 on Windows # Blackfire supports PHP >= 5.3 on Ubuntu and macOS, and PHP >= 5.4 on Windows
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -28,7 +28,7 @@ jobs:
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP
@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP
@ -108,7 +108,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -28,7 +28,7 @@ jobs:
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP
@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP
@ -108,7 +108,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP
@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP
@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -37,7 +37,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -39,7 +39,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -12,7 +12,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -37,7 +37,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -39,7 +39,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -12,7 +12,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -36,7 +36,7 @@ jobs:
# php-versions: ['7.0', '7.1', '7.2', '7.3'] # php-versions: ['7.0', '7.1', '7.2', '7.3']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -37,7 +37,7 @@ jobs:
# php-versions: ['7.0', '7.1', '7.2', '7.3'] # php-versions: ['7.0', '7.1', '7.2', '7.3']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -12,10 +12,10 @@ jobs:
node-versions: ['16'] node-versions: ['16']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v5 uses: actions/setup-node@v1
with: with:
node-version: ${{ matrix.node-versions }} node-version: ${{ matrix.node-versions }}

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -23,7 +23,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -23,7 +23,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -12,7 +12,7 @@ jobs:
php-versions: ['7.4', '8.0', '8.1'] php-versions: ['7.4', '8.0', '8.1']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
# Docs: https://github.com/shivammathur/setup-php # Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP - name: Setup PHP

View File

@ -29,10 +29,10 @@ jobs:
php-versions: ['7.4', '8.0'] php-versions: ['7.4', '8.0']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
- name: Set Node.js 10.x - name: Set Node.js 10.x
uses: actions/setup-node@v5 uses: actions/setup-node@v1
with: with:
node-version: 10.x node-version: 10.x

View File

@ -29,10 +29,10 @@ jobs:
php-versions: ['7.4', '8.0'] php-versions: ['7.4', '8.0']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v4
- name: Set Node.js 10.x - name: Set Node.js 10.x
uses: actions/setup-node@v5 uses: actions/setup-node@v1
with: with:
node-version: 10.x node-version: 10.x

1109
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -36,34 +36,33 @@
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/io": "^2.0.0", "@actions/io": "^1.1.3",
"compare-versions": "^6.1.1" "compare-versions": "^6.1.1"
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^2.0.0", "@eslint/compat": "^1.3.2",
"@eslint/js": "9.39.1", "@eslint/js": "9.35.0",
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",
"@types/node": "^24.10.1", "@types/node": "^24.3.1",
"@typescript-eslint/eslint-plugin": "^8.47.0", "@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.47.0", "@typescript-eslint/parser": "^8.43.0",
"@vercel/ncc": "^0.38.4", "@vercel/ncc": "^0.38.3",
"eslint": "9.39.1", "eslint": "9.35.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.1.0", "eslint-plugin-jest": "^29.0.1",
"eslint-plugin-prettier": "^5.5.4", "eslint-plugin-prettier": "^5.5.4",
"globals": "^16.5.0", "globals": "^16.3.0",
"jest": "^30.2.0", "jest": "^30.1.3",
"jest-circus": "^30.2.0", "jest-circus": "^30.1.3",
"nock": "^14.0.10", "nock": "^14.0.10",
"prettier": "^3.6.2", "prettier": "^3.6.2",
"simple-git-hooks": "^2.13.1", "simple-git-hooks": "^2.13.1",
"ts-jest": "^29.4.5", "ts-jest": "^29.4.1",
"typescript": "^5.9.3" "typescript": "^5.9.2"
}, },
"overrides": { "overrides": {
"test-exclude": "^7.0.1", "test-exclude": "^7.0.1"
"glob": "^11.1.0"
}, },
"bugs": { "bugs": {
"url": "https://github.com/shivammathur/setup-php/issues" "url": "https://github.com/shivammathur/setup-php/issues"

View File

@ -29,7 +29,6 @@ protobuf=protobuf
psr=psr psr=psr
raphf=raphf raphf=raphf
rdkafka=rdkafka rdkafka=rdkafka
phpredis=redis
redis=redis redis=redis
snmp=snmp snmp=snmp
sqlsrv=sqlsrv sqlsrv=sqlsrv

View File

@ -1,22 +0,0 @@
amqp=rabbitmq-c
decimal=mpdecimal
ev=libev
event=libevent
geoip=geoip
gmagick=graphicsmagick
gnupg=gpgme
grpc=grpc protobuf
imagick=imagemagick
memcached=libmemcached libevent
protobuf=protobuf
rdkafka=librdkafka
snappy=snappy
sodium=libsodium
ssh2=libssh2
uv=libuv
uuid=util-linux
vips=vips
yaz=yaz
yaml=libyaml
zstd=zstd
zmq=zeromq

View File

@ -1,22 +0,0 @@
amqp=librabbitmq-dev
decimal=libmpdec-dev
ev=libev-dev
event=libevent-dev
geoip=libgeoip-dev
gmagick=graphicsmagick-libmagick-dev-compat
gnupg=libgpgme-dev
grpc=libgrpc-dev libprotobuf-dev protobuf-compiler
imagick=libmagickwand-dev libmagickcore-dev
memcached=libmemcached-dev libevent-dev
protobuf=libprotobuf-dev protobuf-compiler
rdkafka=librdkafka-dev
snappy=libsnappy-dev
sodium=libsodium-dev
ssh2=libssh2-1-dev
uv=libuv1-dev
uuid=uuid-dev
vips=libvips-dev
yaz=libyaz-dev
yaml=libyaml-dev
zstd=libzstd-dev
zmq=libzmq3-dev

View File

@ -1,10 +1,9 @@
{ {
"lowest": "8.1", "lowest": "8.1",
"highest": "8.5", "highest": "8.4",
"latest": "8.5", "latest": "8.4",
"nightly": "8.6", "nightly": "8.5",
"master": "8.6",
"5.x": "5.6", "5.x": "5.6",
"7.x": "7.4", "7.x": "7.4",
"8.x": "8.5" "8.x": "8.4"
} }

View File

@ -266,8 +266,7 @@
"type": "custom-package", "type": "custom-package",
"repository": "symfony-cli/symfony-cli", "repository": "symfony-cli/symfony-cli",
"domain": "https://github.com", "domain": "https://github.com",
"version_prefix": "v", "version_prefix": "-V"
"version_parameter": "-V"
}, },
"blackfire-player": { "blackfire-player": {
"type": "custom-function", "type": "custom-function",

View File

@ -32,19 +32,17 @@ export async function addExtensionDarwin(
add_script += await utils.parseExtensionSource(extension, ext_prefix); add_script += await utils.parseExtensionSource(extension, ext_prefix);
return; return;
// match 7.4relay...8.5relay // match 7.4relay...8.5relay
// match 5.3blackfire...8.5blackfire // match 5.3blackfire...8.4blackfire
// match 5.3blackfire-(semver)...8.5blackfire-(semver) // match 5.3blackfire-(semver)...8.4blackfire-(semver)
// match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http // match couchbase, event, geos, pdo_oci, oci8, http, pecl_http
// match 5.3ioncube...8.4ioncube // match 5.3ioncube...8.4ioncube
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5 // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
// match 7.0zephir_parser...8.4zephir_parser // match 7.0zephir_parser...8.4zephir_parser
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test( case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
version_extension version_extension
): ):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test( case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
version_extension
):
case /^couchbase|^event|^gearman$|^geos$|^ibm_db2$|^pdo_ibm$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
extension extension
): ):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
@ -136,19 +134,17 @@ 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.5blackfire // match 5.3blackfire...8.4blackfire
// match 5.3blackfire-(semver)...8.5blackfire-(semver) // match 5.3blackfire-(semver)...8.4blackfire-(semver)
// match ibm_db2, pdo_ibm, pdo_oci and oci8 // match pdo_oci and oci8
// match 5.3ioncube...8.4ioncube // match 5.3ioncube...8.4ioncube
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5 // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
// match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http // match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
// match 7.0zephir_parser...8.4zephir_parser // match 7.0zephir_parser...8.4zephir_parser
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test( case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
version_extension version_extension
): ):
case /^ibm_db2$|^pdo_ibm$|^pdo_oci$|^oci8$|^pdo_firebird$/.test( case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
extension
):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test( case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test(
version_extension version_extension
@ -268,23 +264,21 @@ export async function addExtensionLinux(
add_script += await utils.parseExtensionSource(extension, ext_prefix); add_script += await utils.parseExtensionSource(extension, ext_prefix);
return; return;
// match 7.4relay...8.5relay // match 7.4relay...8.5relay
// match 5.3blackfire...8.5blackfire // match 5.3blackfire...8.4blackfire
// match 5.3blackfire-(semver)...8.5blackfire-(semver) // match 5.3blackfire-(semver)...8.4blackfire-(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, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http // match couchbase, geos, pdo_oci, oci8, http, pecl_http
// match 5.3ioncube...8.4ioncube // match 5.3ioncube...8.4ioncube
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5 // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5
// match 7.0zephir_parser...8.4zephir_parser // match 7.0zephir_parser...8.4zephir_parser
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test( case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
version_extension case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])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(
version_extension version_extension
): ):
case /^couchbase|^event|^gearman$|^geos$|^ibm_db2$|^pdo_ibm$|^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):

View File

@ -39,21 +39,10 @@ get_extension_from_formula() {
local formula=$1 local formula=$1
local extension local extension
extension=$(grep -E "^$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_|php|[0-9]//g")" [[ -z "$extension" ]] && extension="$(echo "$formula" | sed -E "s/pecl_|[0-9]//g")"
echo "$extension" echo "$extension"
} }
# Function to get renamed formula.
get_renamed_formula() {
local formula=$1
formula_renames_json="$tap_dir/$ext_tap/formula_renames.json"
if [ -e "$formula_renames_json" ] && grep -q "$formula@$version\":" "$formula_renames_json"; then
grep "$formula@$version\":" "$formula_renames_json" | cut -d ':' -f 2 | tr -d ' ",' | cut -d '@' -f 1
else
echo $formula
fi
}
# Function to copy extension binaries to the extension directory. # Function to copy extension binaries to the extension directory.
copy_brew_extensions() { copy_brew_extensions() {
local formula=$1 local formula=$1
@ -80,7 +69,6 @@ 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"
formula="$(get_renamed_formula "$formula")"
update_dependencies update_dependencies
handle_dependency_extensions "$formula" "$extension" handle_dependency_extensions "$formula" "$extension"
(brew install "${brew_opts[@]}" "$ext_tap/$formula@$version" && copy_brew_extensions "$formula") || pecl_install "$extension" (brew install "${brew_opts[@]}" "$ext_tap/$formula@$version" && copy_brew_extensions "$formula") || pecl_install "$extension"
@ -160,9 +148,9 @@ get_brewed_php() {
cellar="$brew_prefix"/Cellar cellar="$brew_prefix"/Cellar
php_cellar="$cellar"/php php_cellar="$cellar"/php
if [ -d "$cellar" ] && ! [[ "$(find "$cellar" -maxdepth 1 -name "php@$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then if [ -d "$cellar" ] && ! [[ "$(find "$cellar" -maxdepth 1 -name "php@$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
php_semver php_semver | cut -c 1-3
elif [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then elif [ -d "$php_cellar" ] && ! [[ "$(find "$php_cellar" -maxdepth 1 -name "$version*" | wc -l 2>/dev/null)" -eq 0 ]]; then
php_semver php_semver | cut -c 1-3
else else
echo 'false'; echo 'false';
fi fi
@ -172,25 +160,17 @@ get_brewed_php() {
add_php() { add_php() {
action=$1 action=$1
existing_version=$2 existing_version=$2
suffix="$(get_php_formula_suffix)"
php_keg="php@$version$suffix"
php_formula="shivammathur/php/$php_keg"
if [[ "$existing_version" = "false" || -n "$suffix" || "$action" = "upgrade" ]]; then
update_dependencies
add_brew_tap "$php_tap" add_brew_tap "$php_tap"
fi update_dependencies
suffix="$(get_php_formula_suffix)"
php_formula="shivammathur/php/php@$version$suffix"
if [[ "$existing_version" != "false" && -z "$suffix" ]]; then if [[ "$existing_version" != "false" && -z "$suffix" ]]; then
if [ "$action" = "upgrade" ]; then ([ "$action" = "upgrade" ] && brew upgrade -f --overwrite "$php_formula") || brew unlink "$php_formula"
brew install --only-dependencies "$php_formula"
brew upgrade -f --overwrite "$php_formula"
else else
brew unlink "$php_keg" brew install -f --overwrite "$php_formula"
fi fi
else sudo chown -R "$(id -un)":"$(id -gn)" "$brew_prefix"
brew install --only-dependencies "$php_formula" brew link --force --overwrite "$php_formula"
brew install -f --overwrite "$php_formula" || brew upgrade -f --overwrite "$php_formula"
fi
brew link --force --overwrite "$php_keg"
} }
# Function to get formula suffix # Function to get formula suffix
@ -242,18 +222,18 @@ setup_php() {
update=true update=true
check_pre_installed check_pre_installed
existing_version=$(get_brewed_php) existing_version=$(get_brewed_php)
status="Found"
if [[ "$version" =~ ${old_versions:?} ]]; then if [[ "$version" =~ ${old_versions:?} ]]; then
run_script "php5-darwin" "${version/./}" run_script "php5-darwin" "${version/./}"
status="Installed" status="Installed"
elif [ "${existing_version:0:3}" != "$version" ]; then elif [ "$existing_version" != "$version" ]; then
add_php "install" "$existing_version" add_php "install" "$existing_version"
status="Installed" status="Installed"
elif [[ "${existing_version:0:3}" = "$version" && "${update:?}" = "true" ]]; then elif [ "$existing_version" = "$version" ]; then
brew_php_version="$(brew info --json "php@$version" 2>/dev/null | jq -r '.[].versions.stable')" if [ "${update:?}" = "true" ]; then
if [ "$brew_php_version" != "$existing_version" ]; then
add_php "upgrade" "$existing_version" add_php "upgrade" "$existing_version"
status="Upgraded" status="Updated to"
else
status="Found"
fi fi
fi fi
php_config="$(command -v php-config)" php_config="$(command -v php-config)"
@ -278,7 +258,7 @@ setup_php() {
} }
# Variables # Variables
version=${1:-'8.5'} version=${1:-'8.4'}
ini=${2:-'production'} ini=${2:-'production'}
src=${0%/*}/.. src=${0%/*}/..
php_formula=shivammathur/php/php@"$version" php_formula=shivammathur/php/php@"$version"

View File

@ -1,10 +1,8 @@
# Function to log result of installing extension. # Function to log result of installing extension.
add_extension_log() { add_extension_log() {
if check_extension ${1%%-*}; then (
add_log "${tick:?}" "$1" "$2" check_extension "$(echo "$1" | cut -d '-' -f 1)" && add_log "${tick:?}" "$1" "$2"
else ) || add_log "${cross:?}" "$1" "Could not install $1 on PHP ${semver:?}"
add_log "${cross:?}" "$1" "${3:-Could not install $1 on PHP ${semver:?}}"
fi
} }
# Function to test if extension is loaded. # Function to test if extension is loaded.

View File

@ -4,10 +4,8 @@ add_gearman_helper() {
enable_extension gearman extension enable_extension gearman extension
if ! check_extension gearman; then if ! check_extension gearman; then
status="Installed and enabled" status="Installed and enabled"
if [[ "${version:?}" =~ 5.[3-6] ]]; then if [[ "${version:?}" =~ 5.[3-5] ]]; then
pecl_install gearman-1.1.2 pecl_install gearman-1.1.2
elif [[ "${version:?}" =~ 7.0 ]]; then
pecl_install gearman-2.1.3
else else
install_packages php"${version:?}"-gearman || pecl_install gearman install_packages php"${version:?}"-gearman || pecl_install gearman
fi fi

View File

@ -1,56 +0,0 @@
# Function to log license information for ibm extensions.
Function Add-LicenseLog() {
printf "$env:GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $extension "Click to read the $extension related license information"
printf "IBM Db2 ODBC and CLI Driver is required for %s extension.\n" $extension
printf "It is provided under the IBM International Program License Agreement.\n"
printf "Refer to: \033[35;1m%s \033[0m\n" "https://www.ibm.com/support/pages/db2-odbc-cli-driver-download-and-installation-information"
$licensePath = "$php_dir\clidriver\license\odbc_notices.rtf"
if (Test-Path $licensePath) {
Add-Type -AssemblyName System.Windows.Forms
$rtBox = New-Object System.Windows.Forms.RichTextBox
$rtBox.Rtf = [System.IO.File]::ReadAllText($licensePath);
Write-Host $rtBox.Text;
}
Write-Output "$env:END_GROUP"
}
# Function to install IBM Db2 CLI driver.
Function Add-IbmCli() {
$cliPath = "$php_dir\clidriver"
if (-not (Test-Path "$cliPath\bin")) {
$suffix = if ($arch -eq 'x86') { 'nt32' } else { 'ntx64' }
$archive = "$suffix`_odbc_cli.zip"
$destination = "$ENV:RUNNER_TOOL_CACHE\ibm_cli.zip"
Get-File -Url "https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/$archive" -OutFile $destination > $null 2>&1
Expand-Archive -Path $destination -DestinationPath $php_dir -Force > $null 2>&1
}
$env:IBM_DB_HOME = $cliPath
$env:LD_LIBRARY_PATH = "$cliPath\bin;$cliPath\lib;$env:LD_LIBRARY_PATH"
Add-Path "$cliPath\bin"
$env:PATH = "$cliPath\bin;$env:PATH"
}
# Function to install ibm_db2 and pdo_ibm.
Function Add-Ibm() {
Param (
[Parameter(Position = 0, Mandatory = $true)]
[ValidateNotNull()]
[ValidateSet('ibm_db2', 'pdo_ibm')]
[string]
$extension
)
try {
$status = 'Enabled'
Add-IbmCli
if (Test-Path "$ext_dir\php_$extension.dll") {
Enable-PhpExtension -Extension $extension -Path $php_dir
} else {
Add-Extension $extension
$status = 'Installed and enabled'
}
Add-ExtensionLog $extension $status
Add-LicenseLog
} catch {
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
}
}

View File

@ -1,106 +0,0 @@
# Function to log license details for ibm extensions.
add_license_log() {
printf "$GROUP\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$ext" "Click to read the $ext related license information"
printf "IBM Db2 ODBC and CLI Driver is required for %s extension.\n" "$ext"
printf "Refer to: \033[35;1m%s \033[0m\n" "https://www.ibm.com/support/pages/db2-odbc-cli-driver-download-and-installation-information"
local license_file="$ibm_cli/license/odbc_notices.txt"
if [ -f "$license_file" ]; then
cat "$license_file"
fi
echo "$END_GROUP"
}
# Function to determine the driver archive for the current platform.
get_cli_archive() {
local os=$1
local arch=$2
case $os in
Linux)
case $arch in
x86_64|amd64) echo "linuxx64_odbc_cli.tar.gz";;
i?86) echo "linuxia32_odbc_cli.tar.gz";;
*) return 1;;
esac
;;
Darwin)
case $arch in
x86_64) echo "macos64_odbc_cli.tar.gz";;
arm64|aarch64) echo "macarm64_odbc_cli.tar.gz";;
*) return 1;;
esac
;;
*)
return 1
;;
esac
}
# Function to install IBM Db2 CLI driver.
add_cli_driver() {
local os arch archive url tmp libs
if [ -d "$ibm_cli" ]; then
return 0
fi
os=$(uname -s)
arch=$(uname -m)
archive=$(get_cli_archive "$os" "$arch") || return 1
url="https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/$archive"
tmp=/tmp/$archive
get -q -n "$tmp" "$url"
sudo mkdir -p "$ibm_home"
sudo tar -xzf "$tmp" -C "$ibm_home"
sudo rm -f "$tmp"
if [ ! -d "$ibm_cli" ]; then
local extracted
extracted=$(find "$ibm_home" -maxdepth 1 -type d -name 'clidriver*' | head -n 1)
[ -n "$extracted" ] && sudo mv "$extracted" "$ibm_cli"
fi
if [ "$os" = "Linux" ]; then
echo "$ibm_cli/lib" | sudo tee /etc/ld.so.conf.d/ibm_db2.conf >/dev/null
sudo ldconfig
else
libs='/usr/local/lib'
sudo mkdir -p "$libs"
sudo ln -sf "$ibm_cli"/lib/*.dylib "$libs" || true
fi
}
# Function to install ibm_db2 and pdo_ibm.
add_ibm_helper() {
if ! shared_extension "$ext"; then
status='Installed and enabled'
export IBM_DB_HOME="$ibm_cli"
export LD_LIBRARY_PATH="$IBM_DB_HOME/lib"
add_env DYLD_LIBRARY_PATH "$IBM_DB_HOME/lib"
local configure_flag
if [ "$ext" = 'ibm_db2' ]; then
configure_flag="--with-IBM_DB2=$IBM_DB_HOME"
else
configure_flag="--with-pdo-ibm=$IBM_DB_HOME"
fi
read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config) $configure_flag"
patch_phpize
add_extension_from_source "$ext" https://github.com php "pecl-database-$ext" master extension get
restore_phpize
else
enable_extension "$ext" extension
fi
}
# Function to add ibm_db2 and pdo_ibm.
add_ibm() {
ext=$1
status='Enabled'
ibm_home='/opt/ibm'
ibm_cli=$ibm_home/clidriver
if ! add_cli_driver ; then
add_log "${cross:?}" "$ext" "IBM Db2 CLI driver is not available on $(uname -s)/$(uname -m)"
return 1
fi
add_ibm_helper
add_extension_log "$ext" "$status"
check_extension "$ext" && add_license_log
}
# shellcheck source=.
. "${scripts:?}"/extensions/patches/phpize.sh

View File

@ -1,5 +0,0 @@
patch_amqp() {
if [[ $(printf '%s\n%s\n' "${version:?}" "8.5" | sort -V | head -n1) == "8.5" ]]; then
get -q -n amqp_connection_resource.c https://raw.githubusercontent.com/remicollet/php-amqp/977449987412a3d5c59a036dbab8b6d67764bb3e/amqp_connection_resource.c
fi
}

View File

@ -1,35 +1,12 @@
patch_84() { process_file() {
sed -i.bak \ local file=$1
-e '0,/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\).*/s//#include <ext\/random\/php_random.h>/' \ sed -i'' -e '0,/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\).*/s//\#include <ext\/random\/php_random.h>/' "$file"
-e '/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\)/d' \ sed -i'' -e '/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\)/d' "$file"
"$1" && rm -rf *.bak
} }
patch_85() { export -f process_file
sed -i.bak \
-e 's#ext/standard/php_smart_string.h#Zend/zend_smart_string.h#g' \
-e 's#ext/standard/php_smart_string_public.h#Zend/zend_smart_string.h#g' \
-e 's#zend_exception_get_default(TSRMLS_C)#zend_ce_exception#g' \
-e 's#zend_exception_get_default()#zend_ce_exception#g' \
"$1" && rm -rf *.bak
}
version_ge() { # Compare with 8.3 so it runs only on 8.4 and above
ver=$1 if [[ $(printf "%s\n%s" "${version:?}" "8.3" | sort -V | head -n1) != "$version" ]]; then
min=$2 find . -type f \( -name "*.c" -o -name "*.h" \) -exec bash -c 'process_file "$0"' {} \;
[[ $(printf '%s\n%s\n' "$ver" "$min" | sort -V | head -n1) == "$min" ]]
}
if version_ge "${version:?}" "8.4"; then
while IFS= read -r file; do
patch_84 "$file"
done < <(grep -rlE 'php_lcg\.h|php_mt_rand\.h|php_rand\.h|standard/php_random\.h' \
--include='*.c' --include='*.h' . || true)
fi
if version_ge "${version:?}" "8.5"; then
while IFS= read -r file; do
patch_85 "$file"
done < <(grep -rlE 'ext/standard/php_smart_string(_public)?\.h|zend_exception_get_default' \
--include='*.c' --include='*.h' . || true)
fi fi

View File

@ -0,0 +1,5 @@
patch_gearman() {
if [[ "${version:?}" =~ ${nightly_versions:?} ]]; then
sed -i~ -e "s/zend_exception_get_default()/zend_ce_exception/" php_gearman.c
fi
}

View File

@ -1,7 +1,11 @@
patch_geos() { patch_geos() {
if [[ $(printf '%s\n%s\n' "${version:?}" "7.0" | sort -V | head -n1) == "7.0" ]]; then php_version_id="$(php -r "echo PHP_VERSION_ID;")"
if [ "$php_version_id" -ge 70000 ]; then
sed -i~ -e "s/, ce->name/, ZSTR_VAL(ce->name)/; s/ulong /zend_ulong /" geos.c sed -i~ -e "s/, ce->name/, ZSTR_VAL(ce->name)/; s/ulong /zend_ulong /" geos.c
fi fi
if [ "$php_version_id" -ge 80500 ]; then
sed -i~ -e "s/zend_exception_get_default(TSRMLS_C)/zend_ce_exception/" geos.c
fi
get -q -n /tmp/php8.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0003-add-all-arginfo-and-fix-build-with-PHP-8.patch get -q -n /tmp/php8.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0003-add-all-arginfo-and-fix-build-with-PHP-8.patch
get -q -n /tmp/toString.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0006-fix-__toString-with-8.2.patch get -q -n /tmp/toString.patch https://git.remirepo.net/cgit/rpms/php/php-geos.git/plain/0006-fix-__toString-with-8.2.patch
patch -p1 < /tmp/php8.patch 2>/dev/null || true patch -p1 < /tmp/php8.patch 2>/dev/null || true

View File

@ -1,8 +1,5 @@
patch_pdo_oci() { patch_pdo_oci() {
get -q -n config.m4 https://raw.githubusercontent.com/php/php-src/PHP-8.0/ext/pdo_oci/config.m4 get -q -n config.m4 https://raw.githubusercontent.com/php/php-src/PHP-8.0/ext/pdo_oci/config.m4
if [[ $(printf '%s\n%s\n' "${version:?}" "8.5" | sort -V | head -n1) == "8.5" ]]; then
get -q -n pdo_oci.c https://raw.githubusercontent.com/shivammathur/pecl-database-pdo_oci/a9cf2c53b6de46f9e5f523bcd11fd344e3beeb85/pdo_oci.c
fi
if [[ ${version:?} =~ 5.[3-6] ]]; then if [[ ${version:?} =~ 5.[3-6] ]]; then
sudo sed -i '' "/PHP_CHECK_PDO_INCLUDES/d" config.m4 2>/dev/null || sudo sed -i "/PHP_CHECK_PDO_INCLUDES/d" config.m4 sudo sed -i '' "/PHP_CHECK_PDO_INCLUDES/d" config.m4 2>/dev/null || sudo sed -i "/PHP_CHECK_PDO_INCLUDES/d" config.m4
fi fi

View File

@ -1,5 +0,0 @@
if [[ $(printf '%s\n%s\n' "${version:?}" "8.5" | sort -V | head -n1) == "8.5" ]]; then
sed -i.bak -e 's/zval_ptr_dtor( &dbh->query_stmt_zval );/OBJ_RELEASE(dbh->query_stmt_obj);dbh->query_stmt_obj = NULL;/' php_pdo_sqlsrv_int.h
sed -i.bak -e 's/pdo_error_mode prev_err_mode/uint8_t prev_err_mode/g' pdo_dbh.cpp
rm -rf *.bak
fi

View File

@ -3,8 +3,7 @@ get_phpize() {
if [[ "${version:?}" =~ 5.[3-5] ]]; then if [[ "${version:?}" =~ 5.[3-5] ]]; then
echo '/opt/local/bin/phpize' echo '/opt/local/bin/phpize'
else else
[ -n "$brew_prefix" ] && phpize_dir="$brew_prefix" || phpize_dir="/usr/local/bin" echo "/usr/local/bin/$(readlink /usr/local/bin/phpize)"
echo "${phpize_dir}/bin/$(readlink ${phpize_dir}/bin/phpize)"
fi fi
} }

View File

@ -2,9 +2,11 @@
get_relay_version() { get_relay_version() {
local ext=$1 local ext=$1
if [[ "$ext" =~ ^relay$ ]]; then if [[ "$ext" =~ ^relay$ ]]; then
get -s -n "" "${relay_release:?}" if [ "${version:?}" = "7.4" ]; then
elif [[ $ext =~ ^relay-nightly$ ]]; then echo 'v0.7.0'
echo "dev" else
get -s -n "" "${relay_releases:?}"/latest 2<&1 | grep -m 1 -Eo "tag/(v[0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2
fi
else else
relay_version="${ext##*-}" relay_version="${ext##*-}"
echo "v${relay_version/v//}" echo "v${relay_version/v//}"
@ -46,6 +48,19 @@ change_library_paths() {
fi fi
} }
# Add hiredis library
add_hiredis_1.1.0() {
hiredis_url=https://github.com/redis/hiredis/archive/v1.1.0.tar.gz
hiredis_sha=fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6
sed -Ei.bak -e "s#^ url.*# url \"$hiredis_url\"#" -e "s#^ sha256.*# sha256 \"$hiredis_sha\"#" ${core_repo:?}/Formula/h/hiredis.rb
brew install -s hiredis
lib_dir="${brew_prefix:?}"/opt/hiredis/lib
if [ -e "$lib_dir"/libhiredis_ssl.1.1.0.dylib ]; then
sudo ln -sf "$lib_dir"/libhiredis_ssl.1.1.0.dylib "$lib_dir"/libhiredis_ssl.dylib.1.1.0
fi
mv ${core_repo:?}/Formula/h/hiredis.rb.bak ${core_repo:?}/Formula/h/hiredis.rb
}
# Add relay dependencies # Add relay dependencies
add_relay_dependencies() { add_relay_dependencies() {
add_extension json add_extension json
@ -54,8 +69,13 @@ add_relay_dependencies() {
if [ "$os" = "Darwin" ]; then if [ "$os" = "Darwin" ]; then
. "${0%/*}"/tools/brew.sh . "${0%/*}"/tools/brew.sh
configure_brew configure_brew
if [ "$relay_version" = "v0.7.0" ]; then
brew install lz4 zstd concurrencykit
add_hiredis_1.1.0
else
brew install lz4 hiredis zstd concurrencykit brew install lz4 hiredis zstd concurrencykit
fi fi
fi
} }
# Initialize relay extension ini configuration # Initialize relay extension ini configuration
@ -108,7 +128,7 @@ configure_relay() {
# Helper function to add relay extension # Helper function to add relay extension
add_relay_helper() { add_relay_helper() {
local arch=$1 arch="$(uname -m | sed 's/_/-/')"
os_suffix="$(get_os_suffix)" os_suffix="$(get_os_suffix)"
openssl_suffix="$(get_openssl_suffix)" openssl_suffix="$(get_openssl_suffix)"
artifact_file_name="relay-$relay_version-php${version:?}-$os_suffix-$arch$openssl_suffix.tar.gz" artifact_file_name="relay-$relay_version-php${version:?}-$os_suffix-$arch$openssl_suffix.tar.gz"
@ -132,24 +152,17 @@ add_relay() {
local ext=$1 local ext=$1
local arch local arch
local url local url
local message
local error
os=$(uname -s) os=$(uname -s)
arch="$(uname -m | sed 's/_/-/')" relay_releases=https://github.com/cachewerk/relay/releases
relay_release=https://builds.r2.relay.so/meta/latest
relay_trunk=https://builds.r2.relay.so relay_trunk=https://builds.r2.relay.so
if [[ "$arch" = "x86-64" && "$os" = "Darwin" ]]; then
error="Relay extension is not available for macOS x86_64 architecture"
else
relay_version=$(get_relay_version "$ext") relay_version=$(get_relay_version "$ext")
add_relay_dependencies add_relay_dependencies
if shared_extension relay; then if shared_extension relay; then
message="Enabled" message="Enabled"
else else
add_relay_helper "$arch" add_relay_helper
message="Installed and enabled ${relay_version}" message="Installed and enabled"
fi fi
configure_relay configure_relay
fi add_extension_log relay "$message"
add_extension_log relay "$message" "$error"
} }

View File

@ -1,7 +1,3 @@
os="$(uname -s)"
os_lower=$(echo "$os" | tr '[:upper:]' '[:lower:]')
os_capital=$(echo "$os" | tr '[:lower:]' '[:upper:]')
# Function to parse extension environment variables # Function to parse extension environment variables
parse_args() { parse_args() {
local extension=${1%-*} local extension=${1%-*}
@ -40,7 +36,7 @@ add_lib_log() {
# Function to check if a library is installed # Function to check if a library is installed
check_lib() { check_lib() {
local lib=$1 local lib=$1
if [ "$os" = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
[ "x$(dpkg -s "$lib" 2>/dev/null | grep Status)" != "x" ] [ "x$(dpkg -s "$lib" 2>/dev/null | grep Status)" != "x" ]
else else
[ "x$(find "${brew_prefix:?}"/Cellar -maxdepth 1 -name "$lib")" != "x" ] [ "x$(find "${brew_prefix:?}"/Cellar -maxdepth 1 -name "$lib")" != "x" ]
@ -72,7 +68,7 @@ add_darwin_libs() {
add_libs() { add_libs() {
local all_libs=("$@") local all_libs=("$@")
for lib in "${all_libs[@]}"; do for lib in "${all_libs[@]}"; do
if [ "$os" = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
add_linux_libs "$lib" add_linux_libs "$lib"
else else
add_darwin_libs "$lib" add_darwin_libs "$lib"
@ -80,19 +76,6 @@ add_libs() {
done done
} }
# Function to get required libraries for an extension
get_libraries() {
local extension=$1
{
parse_args "$extension" LIBS
parse_args "$extension" "$os_capital"_LIBS
[ -r "${src:?}/configs/${os_lower}_libs" ] && \
grep -E "^[[:space:]]*${extension}[[:space:]]*=" "${src:?}/configs/${os_lower}_libs" | \
head -n1 | \
sed -E "s/^[[:space:]]*${extension}[[:space:]]*=[[:space:]]*//"
} | xargs -n 1 2>/dev/null | sort -u | xargs 2>/dev/null
}
# Function to run command in a group # Function to run command in a group
run_group() { run_group() {
local command=$1 local command=$1
@ -136,10 +119,9 @@ fetch_extension() {
elif [ "$fetch" = "pecl" ]; then elif [ "$fetch" = "pecl" ]; then
source="pecl" source="pecl"
pecl_name=${extension/http/pecl_http} pecl_name=${extension/http/pecl_http}
capital_pecl_name=$(echo "$pecl_name" | tr '[:lower:]' '[:upper:]') get -q -n /tmp/"$pecl_name".tgz https://pecl.php.net/get/"$pecl_name"-"$release".tgz
get -q -n /tmp/"$pecl_name".tgz https://pecl.php.net/get/"$pecl_name"-"$release".tgz https://pecl.php.net/get/"$capital_pecl_name"-"$release".tgz
tar -xzf /tmp/"$pecl_name".tgz -C /tmp tar -xzf /tmp/"$pecl_name".tgz -C /tmp
cd /tmp/"$pecl_name"-"$release" 2>/dev/null || cd /tmp/"$capital_pecl_name"-"$release" 2>/dev/null || exit cd /tmp/"$pecl_name"-"$release" || exit
fi fi
} }
@ -154,7 +136,7 @@ add_extension_from_source() {
local fetch=${7:-clone} local fetch=${7:-clone}
slug="$extension-$release" slug="$extension-$release"
source="$url/$org/$repo" source="$url/$org/$repo"
libraries="$(get_libraries "$extension")" libraries="$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)"
opts="$(parse_args "$extension" CONFIGURE_OPTS)" opts="$(parse_args "$extension" CONFIGURE_OPTS)"
prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS)" prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS)"
suffix_opts="$(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)" suffix_opts="$(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)"

View File

@ -291,7 +291,7 @@ setup_php() {
} }
# Variables # Variables
version=${1:-'8.5'} version=${1:-'8.4'}
ini=${2:-'production'} ini=${2:-'production'}
src=${0%/*}/.. src=${0%/*}/..
debconf_fix="DEBIAN_FRONTEND=noninteractive" debconf_fix="DEBIAN_FRONTEND=noninteractive"

View File

@ -50,23 +50,12 @@ update_lists_helper() {
update_lists() { update_lists() {
local ppa=${1:-} local ppa=${1:-}
local ppa_search=${2:-} local ppa_search=${2:-}
local status_token=${3:-$ppa_search}
local list= local list=
local status_file=/tmp/os_lists status_file=/tmp/os_lists
local hash_cmd
if [[ -n "$ppa" && -n "$ppa_search" ]]; then if [[ -n "$ppa" && -n "$ppa_search" ]]; then
if [ -f "$ppa_search" ]; then list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
list="$ppa_search" status_file=/tmp/"$(echo -n "$ppa_search" | shasum -a 256 | cut -d ' ' -f 1)"
else elif [ -e "$list_file" ] && grep -Eq '^deb |^Types deb' "$list_file"; then
list="$(grep -Elr "$ppa_search" "$list_dir" 2>/dev/null | head -n 1)"
fi
hash_cmd="$(command -v sha256sum || command -v shasum)"
if [ -n "$status_token" ] && [ -n "$hash_cmd" ]; then
status_file=/tmp/os_lists_"$(echo -n "$status_token" | $hash_cmd | awk '{print $1}')"
elif [ -n "$status_token" ]; then
status_file=/tmp/os_lists_$(date +%s)
fi
elif [ -e "$list_file" ] && grep -Eq '^deb |^Types: *deb' "$list_file"; then
list="$list_file" list="$list_file"
fi fi
if [ ! -e "$status_file" ]; then if [ ! -e "$status_file" ]; then
@ -75,81 +64,6 @@ update_lists() {
fi fi
} }
# Determine whether deb822 sources are the default on this system.
get_sources_format() {
if [ -n "$sources_format" ]; then
echo "$sources_format"
return
fi
sources_format=deb
if [ -e "$list_dir"/ubuntu.sources ] || [ -e "$list_dir"/debian.sources ]; then
sources_format="deb822"
elif ! [[ "$ID" =~ ubuntu|debian ]]; then
find "$list_dir" -type f -name '*.sources' | grep -q . && sources_format="deb822"
fi
echo "$sources_format"
}
# Function to get sources file extension.
get_sources_extension() {
[ "$1" = "deb822" ] && echo "sources" || echo "list"
}
# Function to escape regex special characters.
escape_regex() {
printf '%s' "$1" | sed -e 's/[][\.^$*+?{}()|\/]/\\&/g'
}
# Function to merge two components strings.
merge_components() {
local out=() t
for t in $1 $2; do [[ $t && " ${out[*]} " != *" $t "* ]] && out+=("$t"); done
printf '%s\n' "${out[*]}"
}
# Function to merge components from a file.
merge_components_from_file() {
local path=$1
local incoming=$2
local current=
if [ -n "$path" ] && [ -e "$path" ]; then
if grep -Eq '^Components:' "$path"; then
current="$(grep -E '^Components:' "$path" | head -n 1 | cut -d ':' -f 2 | xargs)"
else
current="$(sed -E -n 's/^deb[[:space:]]+(\[[^]]*\][[:space:]]+)?[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]+//p' "$path" | head -n 1 | xargs)"
fi
fi
local merged
merged="$(merge_components "$current" "$incoming")"
if [ -z "$merged" ] || [ "$merged" = "$current" ]; then
return 1
fi
printf '%s\n' "$merged"
}
# Function to get repo patterns based on format.
get_repo_patterns() {
local list_format=$1
local ppa_url=$2
local package_dist=$3
local branches=$4
local escaped_url
local escaped_dist
local escaped_branches
escaped_url="$(escape_regex "$ppa_url")"
escaped_dist="$(escape_regex "$package_dist")"
escaped_branches="$(escape_regex "$branches")"
local deb_primary="^deb[[:space:]]+(\\[[^]]*\\][[:space:]]+)?${escaped_url}[[:space:]]+${escaped_dist}[[:space:]]"
local deb_secondary="^deb[[:space:]]+(\\[[^]]*\\][[:space:]]+)?${escaped_url}[[:space:]]+${escaped_dist}[[:space:]]+.*${escaped_branches}([[:space:]]|$)"
local deb822_primary="^URIs: ${escaped_url}$"
local deb822_secondary="^Suites: ${escaped_dist}$"
if [ "$list_format" = "deb822" ]; then
printf '%s|%s\n' "$deb822_primary" "$deb822_secondary"
else
printf '%s|%s\n' "$deb_primary" "$deb_secondary"
fi
}
# Function to get fingerprint from an Ubuntu PPA. # Function to get fingerprint from an Ubuntu PPA.
ubuntu_fingerprint() { ubuntu_fingerprint() {
ppa="$1" ppa="$1"
@ -190,74 +104,19 @@ add_key() {
fi fi
} }
# Function to handle existing list files.
handle_existing_list() {
local ppa=$1
local list_format=$2
local branches=$3
local merged_components
if [ -z "$check_lists_file" ]; then
echo "Repository $ppa ($branches) already exists" && return 1
fi
if merged_components="$(merge_components_from_file "$check_lists_file" "$branches")"; then
sudo rm -f "$check_lists_file" && printf '%s\n' "$merged_components" && return 0
fi
if [[ "$list_format" = "deb822" && "$check_lists_file" = *.list ]]; then
sudo rm -f "$check_lists_file" && printf '%s\n' "$branches" && return 0
fi
echo "Repository $ppa ($branches) already exists" && return 1
}
# Function to write a list file.
write_list() {
local type=$1
local ppa=$2
local url=$3
local suite=$4
local components=$5
local key_file=$6
local list_basename="${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$suite"
local arch
arch="$(dpkg --print-architecture)"
sudo rm -f "$list_dir"/"${ppa/\//-}".list "$list_dir"/"${ppa/\//-}".sources "$list_dir"/"$list_basename".list "$list_dir"/"$list_basename".sources || true
if [ "$type" = "deb822" ]; then
cat <<EOF | sudo tee "$list_dir"/"$list_basename".sources >/dev/null
Types: deb
URIs: $url
Suites: $suite
Components: $components
Architectures: $arch
Signed-By: $key_file
EOF
else
echo "deb [arch=$arch signed-by=$key_file] $url $suite $components" | sudo tee "$list_dir"/"$list_basename".list
fi
}
# Function to check if a PPA and its lists exist # Function to check if a PPA and its lists exist
check_lists() { check_lists() {
local ppa=$1 ppa=$1
local primary=${2:-} ppa_search=$2
local secondary=${3:-} if grep -Eqr "$ppa_search" "$list_dir"; then
local status_token=${4:-$primary}
local match_file=
check_lists_file=
if [ -n "$primary" ]; then
match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1)
fi
if [ -z "$match_file" ] && [ -n "$secondary" ]; then
match_file=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1)
fi
if [ -n "$match_file" ]; then
local list_count
list_count="$(sudo find /var/lib/apt/lists -type f -name "*${ppa/\//_}*" | wc -l)" list_count="$(sudo find /var/lib/apt/lists -type f -name "*${ppa/\//_}*" | wc -l)"
if [ "$list_count" = "0" ]; then if [ "$list_count" = "0" ]; then
update_lists "$ppa" "$match_file" "$status_token" update_lists "$ppa" "$ppa_search"
fi fi
check_lists_file="$match_file" return 0;
return 0 else
return 1;
fi fi
return 1
} }
# Function to add a sources list. # Function to add a sources list.
@ -267,32 +126,19 @@ add_list() {
key_source=${3:-"$ppa_url"} key_source=${3:-"$ppa_url"}
package_dist=${4:-"$VERSION_CODENAME"} package_dist=${4:-"$VERSION_CODENAME"}
branches=${5:-main} branches=${5:-main}
local list_format ppa_search="deb .*$ppa_url $package_dist .*$branches$"
local list_extension if check_lists "$ppa" "$ppa_search"; then
local status_token echo "Repository $ppa already exists";
local resolved_branches return 1;
local list_path=
list_format="$(get_sources_format)"
list_extension="$(get_sources_extension "$list_format")"
status_token="${ppa_url}|${package_dist}|${branches}"
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
list_path="$check_lists_file"
if resolved_branches="$(handle_existing_list "$ppa" "$list_format" "$branches")"; then
branches="$resolved_branches"
else else
[ -n "$resolved_branches" ] && echo "$resolved_branches" && return 1 arch=$(dpkg --print-architecture)
fi
check_lists_file=
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
status_token="${ppa_url}|${package_dist}|${branches}"
fi
[ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg [ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg
add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file" add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file"
write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file" sudo rm -rf "$list_dir"/"${ppa/\//-}".list || true
list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension" echo "deb [arch=$arch signed-by=$key_file] $ppa_url $package_dist $branches" | sudo tee -a "$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist".list
update_lists "$ppa" "$list_path" "$status_token" update_lists "$ppa" "$ppa_search"
. /etc/os-release . /etc/os-release
fi
return 0; return 0;
} }
@ -302,12 +148,8 @@ check_ppa() {
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"} ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
package_dist=${3:-"$VERSION_CODENAME"} package_dist=${3:-"$VERSION_CODENAME"}
branches=${4:-main} branches=${4:-main}
local list_format ppa_search="deb .*$ppa_url $package_dist .*$branches$"
list_format="$(get_sources_format)" if check_lists "$ppa" "$ppa_search"; then
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
local status_token
status_token="${ppa_url}|${package_dist}|${branches}"
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
return 0; return 0;
else else
return 1; return 1;
@ -321,7 +163,7 @@ remove_list() {
for ppa_url in "${ppa_urls[@]}"; do for ppa_url in "${ppa_urls[@]}"; do
grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
done done
sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring /tmp/os_lists* || true sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring || true
} }
# Function to check if ubuntu ppa is up # Function to check if ubuntu ppa is up
@ -371,23 +213,12 @@ update_ppa() {
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"} ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
package_dist=${4:-"$VERSION_CODENAME"} package_dist=${4:-"$VERSION_CODENAME"}
branches=${5:-main} branches=${5:-main}
local list_format ppa_search="deb .*$ppa_url $package_dist .*$branches"
list_format="$(get_sources_format)" update_lists "$ppa" "$ppa_search"
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
local list_path
list_path="$(grep -Elr "$primary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
if [ -z "$list_path" ] && [ -n "$secondary_pattern" ]; then
list_path="$(grep -Elr "$secondary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
fi
local status_token
status_token="${ppa_url}|${package_dist}|${branches}"
update_lists "$ppa" "${list_path:-$primary_pattern}" "$status_token"
. /etc/os-release . /etc/os-release
} }
# Variables # Variables
sources_format=
check_lists_file=
list_dir='/etc/apt/sources.list.d' list_dir='/etc/apt/sources.list.d'
list_file="/etc/apt/sources.list.d/$ID.sources" list_file="/etc/apt/sources.list.d/$ID.sources"
[ -e "$list_file" ] || list_file='/etc/apt/sources.list' [ -e "$list_file" ] || list_file='/etc/apt/sources.list'

View File

@ -1,25 +1,12 @@
Function Add-Symfony() { Function Add-Symfony() {
param( $arch_name ='amd64'
[Parameter(Mandatory = $true, Position = 0, HelpMessage = 'Symfony version to be installed')] if(-not([Environment]::Is64BitOperatingSystem) -or $version -lt '7.0') {
[string] $protobuf_tag
)
$protobuf_tag = $protobuf_tag.replace('v', '')
if($protobuf_tag -ne 'latest' -and $protobuf_tag -notmatch '^\d+(\.\d+)*$') {
Add-Log $cross "symfony-cli" "Invalid symfony version: $protobuf_tag"
} else {
$arch_name = 'amd64'
if (-not ([Environment]::Is64BitOperatingSystem) -or $version -lt '7.0') {
$arch_name = '386' $arch_name = '386'
} }
$symfony_releases = "https://github.com/symfony-cli/symfony-cli/releases" $url = "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_windows_${arch_name}.zip"
if ($protobuf_tag -eq 'latest') { Get-File -Url $url -OutFile $bin_dir\symfony.zip
$url = "$symfony_releases/latest/download/symfony-cli_windows_${arch_name}.zip" Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force
} else { if(Test-Path $bin_dir\symfony.exe) {
$url = "$symfony_releases/download/v$protobuf_tag/symfony-cli_windows_${arch_name}.zip"
}
Get-File -Url $url -OutFile $bin_dir\symfony.zip > $null 2>&1
Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force > $null 2>&1
if (Test-Path $bin_dir\symfony.exe) {
Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe > $null 2>&1 Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe > $null 2>&1
Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe" Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe"
Add-ToProfile $current_profile 'symfony_cli' "New-Alias symfony-cli $bin_dir\symfony-cli.exe" Add-ToProfile $current_profile 'symfony_cli' "New-Alias symfony-cli $bin_dir\symfony-cli.exe"
@ -28,5 +15,4 @@ Function Add-Symfony() {
} else { } else {
Add-Log $cross "symfony-cli" "Could not setup symfony-cli" Add-Log $cross "symfony-cli" "Could not setup symfony-cli"
} }
}
} }

View File

@ -1,37 +1,35 @@
add_symfony_with_brew() {
add_brew_tap symfony-cli/homebrew-tap
brew install symfony-cli/tap/symfony-cli
}
get_symfony_artifact_url() { get_symfony_artifact_url() {
local symfony_tag=$1 arch=$(dpkg --print-architecture)
local os 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)
local arch if [ -z "$url" ]; then
os="$(uname -s | tr '[:upper:]' '[:lower:]')" 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)
arch="$(uname -m)"
case "$arch" in
arm|armv6*|armv7*) arch="armv6" ;;
aarch64*|armv8*|arm64) arch="arm64" ;;
i[36]86) arch="386" ;;
x86_64|amd64) arch="amd64" ;;
esac
[ "$os" = "darwin" ] && arch="all"
symfony_releases="https://github.com/symfony-cli/symfony-cli/releases"
if [ "$symfony_tag" = "latest" ]; then
echo "$symfony_releases/latest/download/symfony-cli_${os}_${arch}.tar.gz"
else
echo "$symfony_releases/download/v$symfony_tag/symfony-cli_${os}_${arch}.tar.gz"
fi fi
echo "$url"
} }
add_symfony_helper() { add_symfony_helper() {
local install_dir=/usr/local/bin if [ "$(uname -s)" = "Linux" ]; then
[ "$(uname -s)" = "Darwin" ] && install_dir=${brew_prefix:?}/bin url="$(get_symfony_artifact_url)"
get -s -n "" "$(get_symfony_artifact_url "$symfony_tag")" | sudo tar -xz -C "$install_dir" 2>/dev/null if [ -z "$url" ]; then
sudo chmod a+x "$install_dir"/symfony . "${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
add_symfony_with_brew
fi
} }
add_symfony() { add_symfony() {
local symfony_tag="${1/v/}" add_symfony_helper
if ! [[ "$symfony_tag" =~ ^[0-9]+(\.[0-9]+)*$ || "$symfony_tag" == 'latest' ]]; then
add_log "${cross:?}" "symfony-cli" "Version '$symfony_tag' is not valid for symfony-cli"
else
add_symfony_helper "$symfony_tag"
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
@ -40,5 +38,4 @@ add_symfony() {
else else
add_log "${cross:?}" "symfony-cli" "Could not setup symfony-cli" add_log "${cross:?}" "symfony-cli" "Could not setup symfony-cli"
fi fi
fi
} }

View File

@ -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.[6-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"

View File

@ -323,7 +323,7 @@ $php_builder = "$github/shivammathur/php-builder-windows"
$current_profile = "$env:TEMP\setup-php.ps1" $current_profile = "$env:TEMP\setup-php.ps1"
$ProgressPreference = 'SilentlyContinue' $ProgressPreference = 'SilentlyContinue'
$jit_versions = '8.[0-9]' $jit_versions = '8.[0-9]'
$nightly_versions = '8.[6-9]' $nightly_versions = '8.[2-9]'
$xdebug3_versions = "7.[2-4]|8.[0-9]" $xdebug3_versions = "7.[2-4]|8.[0-9]"
$enable_extensions = ('openssl', 'curl', 'mbstring') $enable_extensions = ('openssl', 'curl', 'mbstring')
@ -444,12 +444,9 @@ if($installed.MajorMinorVersion -ne $version) {
} }
if($version -lt "5.5") { if($version -lt "5.5") {
('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Invoke-WebRequest -Uri "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ } ('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Invoke-WebRequest -Uri "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ }
} elseif($version -lt "8.5") { } else {
$enable_extensions += ('opcache') $enable_extensions += ('opcache')
} }
if($version -ge "8.5" -and (Test-Path $ext_dir\php_opcache.dll)) {
Remove-Item $ext_dir\php_opcache.dll -Force
}
Enable-PhpExtension -Extension ($enable_extensions | Where-Object { Test-Path $ext_dir\php_$_.dll }) -Path $php_dir Enable-PhpExtension -Extension ($enable_extensions | Where-Object { Test-Path $ext_dir\php_$_.dll }) -Path $php_dir
Add-PhpCAInfo Add-PhpCAInfo
Add-OpenSSLConf Add-OpenSSLConf

View File

@ -156,7 +156,7 @@ export async function filterList(tools_list: string[]): Promise<string[]> {
* @param data * @param data
*/ */
export async function getUrl(data: RS): Promise<string> { export async function getUrl(data: RS): Promise<string> {
if ((data['version'] ?? 'latest') === 'latest') { if (data['version'] === 'latest') {
return [ return [
data['domain'], data['domain'],
data['repository'], data['repository'],
@ -290,8 +290,7 @@ export async function addComposer(data: RS): Promise<string> {
const spc_url = `${spc}/composer/${filename}`; const spc_url = `${spc}/composer/${filename}`;
const lts_url = `${getcomposer}/download/latest-2.2.x/composer.phar`; const lts_url = `${getcomposer}/download/latest-2.2.x/composer.phar`;
const is_lts = /^5\.[3-6]$|^7\.[0-1]$/.test(data['php_version']); const is_lts = /^5\.[3-6]$|^7\.[0-1]$/.test(data['php_version']);
const channel_source_url = `${getcomposer}/composer-${channel}.phar`; const version_source_url = `${getcomposer}/composer-${channel}.phar`;
const version_source_url = `${getcomposer}/download/${channel}/composer.phar`;
let cache_url = `${releases_url},${spc_url},${cds_url}`; let cache_url = `${releases_url},${spc_url},${cds_url}`;
let source_url = `${getcomposer}/composer.phar`; let source_url = `${getcomposer}/composer.phar`;
switch (true) { switch (true) {
@ -299,17 +298,17 @@ export async function addComposer(data: RS): Promise<string> {
source_url = is_lts ? lts_url : source_url; source_url = is_lts ? lts_url : source_url;
break; break;
case /^preview$|^2$/.test(channel): case /^preview$|^2$/.test(channel):
source_url = is_lts ? lts_url : channel_source_url; source_url = is_lts ? lts_url : version_source_url;
break; break;
case /^1$/.test(channel): case /^1$/.test(channel):
source_url = channel_source_url; source_url = version_source_url;
break; break;
case /^\d+\.\d+\.\d+[\w-]*$/.test(data['version']): case /^\d+\.\d+\.\d+[\w-]*$/.test(data['version']):
cache_url = `${github}/${data['repository']}/releases/download/${data['version']}/composer.phar`; cache_url = `${github}/${data['repository']}/releases/download/${data['version']}/composer.phar`;
source_url = version_source_url; source_url = version_source_url;
break; break;
default: default:
source_url = is_lts ? lts_url : channel_source_url; source_url = is_lts ? lts_url : version_source_url;
} }
const use_cache: boolean = (await utils.readEnv('NO_TOOLS_CACHE')) !== 'true'; const use_cache: boolean = (await utils.readEnv('NO_TOOLS_CACHE')) !== 'true';
data['url'] = use_cache ? `${cache_url},${source_url}` : source_url; data['url'] = use_cache ? `${cache_url},${source_url}` : source_url;

View File

@ -400,7 +400,7 @@ export async function customPackage(
version: string, version: string,
os: string os: string
): Promise<string> { ): Promise<string> {
const pkg_name: string = pkg.replace(/\d+|(pdo|pecl)[_-]|[_-]db2/, ''); const pkg_name: string = pkg.replace(/\d+|(pdo|pecl)[_-]/, '');
const script_extension: string = await scriptExtension(os); const script_extension: string = await scriptExtension(os);
const script: string = path.join( const script: string = path.join(
__dirname, __dirname,