Compare commits

..
Author SHA1 Message Date
Florian Engelhardt abf2248889 Add asan usage 2026-11-27 03:46:14 +05:30
Shivam Mathur fad0ff9c5d Set the setup-php user agent for tool downloads and Node fetches 2026-11-27 01:39:28 +05:30
Jordi Boggiano 66f29b02f3 Send a setup-php user agent and request compressed tool downloads (#1168)
Downloads used curl's default user agent and no Accept-Encoding, so
fallbacks to getcomposer.org transferred the full ~3.8MB phar instead of
~0.9MB gzipped, and could not be told apart from other curl traffic.
2026-11-27 00:40:41 +05:30
Till Krüss 940ea09f22 Add support for Relay on PHP 8.6 (#1166) 2026-11-24 13:05:34 +05:30
Mickael Gaillard e8d43d139f Add Upsun CLI tool (#1157)
* Add Upsun CLI tool

* Revert unrelated README TOC changes
2026-11-20 21:06:37 +05:30
Shivam Mathur 2001cd3148 Mark PHP 8.6 as stable [skip ci] 2026-11-20 20:44:06 +05:30
Shivam Mathur 686108c306 Document PHP 5.3 to 5.5 support on macOS ARM64 [skip ci] 2026-11-20 20:43:59 +05:30
Ivanha PazandShivam Mathur 631ca98855 Add Namespace OSS sponsor badge (#1163)
* Replace the Namespace sponsor logo with the OSS badge

* Move Namespace badge below social badges [skip ci]

As discussed, retain the Namespace sponsor logo and use the campaign link for both light and dark variants.

---------

Co-authored-by: Shivam Mathur <shivam_jpr@hotmail.com>
2026-11-20 20:41:27 +05:30
Shivam Mathur ac61989611 Restore missing legacy OCI DLLs and install PHP 8.3 OCI from PECL 2026-11-20 13:40:31 +05:30
Shivam Mathur 24b037eccd Retry incomplete downloads and reject truncated extension sources 2026-11-20 13:40:31 +05:30
Shivam Mathur 1e03f844c6 Fix Relay archive layouts and OpenSSL ABI detection on macOS 2026-11-20 13:00:10 +05:30
Shivam Mathur 6535ca572a Fix CUBRID source builds with current CMake and compilers 2026-11-20 13:00:10 +05:30
Shivam Mathur 94649c8698 Update Node.js dependencies 2026-11-20 12:06:41 +05:30
Shivam Mathur fe52705681 Add Blacksmith sponsor [skip ci] 2026-11-18 07:07:53 +05:30
Shivam Mathur 856a08ae41 Add Namespace sponsor [skip ci] 2026-11-17 17:56:37 +05:30
Shivam Mathur 79c01dca53 Remove DigitalOcean sponsor [skip ci] 2026-11-17 16:00:04 +05:30
Shivam Mathur c88b92f82d Allow opt-in builds cache on Namespace runners 2026-11-17 15:39:12 +05:30
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 50d992bd5b Bump the github-actions group with 4 updates (#1158)
Bumps the github-actions group with 4 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions).


Updates `github/codeql-action/init` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9b3254085494b55a0f7c4c2b3d2d52cc712ce370...33d7b85da1a04171e211befe2c739303b9a4c066)

Updates `github/codeql-action/autobuild` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9b3254085494b55a0f7c4c2b3d2d52cc712ce370...33d7b85da1a04171e211befe2c739303b9a4c066)

Updates `github/codeql-action/analyze` from 4.39.1 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9b3254085494b55a0f7c4c2b3d2d52cc712ce370...33d7b85da1a04171e211befe2c739303b9a4c066)

Updates `shivammathur/cache-extensions` from 1.15.8 to 1.15.11
- [Release notes](https://github.com/shivammathur/cache-extensions/releases)
- [Commits](https://github.com/shivammathur/cache-extensions/compare/c33688ce81fd884ddd70d51cadeb62b6fb974750...695b1b465eba861efe67cbbc31252c27f5ed253d)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: shivammathur/cache-extensions
  dependency-version: 1.15.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-14 16:32:02 +05:30
Shivam Mathur 79d58381ae Pin VcRedist to stable release 4.1.527 2026-11-14 14:37:10 +05:30
Shivam Mathur a5c0723242 Select apt-get directly when apt-fast is unavailable 2026-11-10 19:40:56 +05:30
Shivam Mathur 25b6ac8dcd Fix apt cleanup trap replacement 2026-11-10 19:28:27 +05:30
Andreas Möller a95d9d8a2e Remove tool when its download fails and no previous version exists (#1155) 2026-11-08 16:47:45 +05:30
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> af64993021 Bump shivammathur/cache-extensions (#1152)
Bumps the github-actions group with 1 update: [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions).


Updates `shivammathur/cache-extensions` from 1.15.6 to 1.15.8
- [Release notes](https://github.com/shivammathur/cache-extensions/releases)
- [Commits](https://github.com/shivammathur/cache-extensions/compare/d894929efeece5f8d386bd667369b321947064ad...c33688ce81fd884ddd70d51cadeb62b6fb974750)

---
updated-dependencies:
- dependency-name: shivammathur/cache-extensions
  dependency-version: 1.15.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-07 16:28:47 +05:30
31 changed files with 325 additions and 337 deletions
+1
View File
@@ -14,6 +14,7 @@ This security policy only applies to the latest patch releases of the following
| 8.3 | :white_check_mark: | | 8.3 | :white_check_mark: |
| 8.4 | :white_check_mark: | | 8.4 | :white_check_mark: |
| 8.5 | :white_check_mark: | | 8.5 | :white_check_mark: |
| 8.6 | :white_check_mark: |
## Reporting a Vulnerability ## Reporting a Vulnerability
+3 -3
View File
@@ -26,13 +26,13 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4 uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
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@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4 uses: github/codeql-action/autobuild@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4 uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
+2 -2
View File
@@ -23,7 +23,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
env: env:
default-php-version: '8.5' default-php-version: '8.6'
jobs: jobs:
run: run:
name: Run name: Run
@@ -48,7 +48,7 @@ jobs:
- name: Setup cache environment - name: Setup cache environment
id: cache-env id: cache-env
uses: shivammathur/cache-extensions@d894929efeece5f8d386bd667369b321947064ad # v1 uses: shivammathur/cache-extensions@695b1b465eba861efe67cbbc31252c27f5ed253d # v1
with: with:
php-version: ${{ matrix.php-versions || env.default-php-version }} php-version: ${{ matrix.php-versions || env.default-php-version }}
extensions: ${{ env.extensions }} extensions: ${{ env.extensions }}
+77 -38
View File
@@ -17,6 +17,9 @@
<a href="https://twitter.com/setup_php" title="setup-php twitter"><img alt="setup-php twitter" src="https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555"></a> <a href="https://twitter.com/setup_php" title="setup-php twitter"><img alt="setup-php twitter" src="https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555"></a>
<a href="https://status.setup-php.com" title="setup-php status"><img alt="setup-php status" src="https://img.shields.io/badge/status-subscribe-28A745?logo=statuspage&logoColor=28A745&labelColor=555555"></a> <a href="https://status.setup-php.com" title="setup-php status"><img alt="setup-php status" src="https://img.shields.io/badge/status-subscribe-28A745?logo=statuspage&logoColor=28A745&labelColor=555555"></a>
</p> </p>
<p align="center">
<a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php"><img src="https://namespace.so/oss/badge.svg" alt="CI powered by Namespace" height="32" align="middle"></a>
</p>
Setup PHP with required extensions, php.ini configuration, code-coverage support, and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross-platform interface to set up the PHP environment you need to test your application. Refer to the [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this. Setup PHP with required extensions, php.ini configuration, code-coverage support, and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross-platform interface to set up the PHP environment you need to test your application. Refer to the [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
@@ -41,6 +44,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
- [Nightly Build Setup](#nightly-build-setup) - [Nightly Build Setup](#nightly-build-setup)
- [Debug Build Setup](#debug-build-setup) - [Debug Build Setup](#debug-build-setup)
- [Thread Safe Setup](#thread-safe-setup) - [Thread Safe Setup](#thread-safe-setup)
- [ASAN Build Setup](#asan-build-setup)
- [Force Update Setup](#force-update-setup) - [Force Update Setup](#force-update-setup)
- [Verbose Setup](#verbose-setup) - [Verbose Setup](#verbose-setup)
- [Multi-Arch Setup](#multi-arch-setup) - [Multi-Arch Setup](#multi-arch-setup)
@@ -111,8 +115,7 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
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.7 on GitHub-hosted runners, except for macOS ARM64 runners. - PHP 5.3 to PHP 8.7 on supported GitHub-hosted runners, including macOS ARM64 runners.
- PHP 5.6 to PHP 8.7 on GitHub-hosted macOS ARM64 runners.
- PHP 5.6 to PHP 8.7 on self-hosted runners. - PHP 5.6 to PHP 8.7 on self-hosted runners.
| PHP Version | Stability | Release Support | Runner Support | | PHP Version | Stability | Release Support | Runner Support |
@@ -132,12 +135,12 @@ On all supported OS/Platforms, the following PHP versions can be set up as per t
| `8.3` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` | | `8.3` | `Stable` | `Security fixes only` | `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` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
| `8.6` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` | | `8.6` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
| `8.7` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` | | `8.7` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
> [!Note] > [!Note]
> - Specifying `8.7` or `master` in `php-version` input installs a nightly build of `PHP 8.7.0-dev` from the master branch of PHP. Specifying `8.6` or `nightly` installs a nightly build of `PHP 8.6.0-dev` from the PHP-8.6 branch. See [nightly build setup](#nightly-build-setup) for more information. > - Specifying `8.6` in the `php-version` input selects the PHP 8.6 stable series. Specifying `8.7`, `nightly`, or `master` installs a nightly build of PHP 8.7 from the master branch of PHP. 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
@@ -241,7 +244,7 @@ This disables all core and third-party shared extensions and thus, can break som
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.
[`backward-compatibility-check`], [`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cpx`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`laravel-cloud`] or [`cloud-cli`], [`mago`], [`name-collision-detector`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pie`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`] [`backward-compatibility-check`], [`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cpx`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`laravel-cloud`] or [`cloud-cli`], [`mago`], [`name-collision-detector`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pie`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`upsun`] or [`upsun-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
```yaml ```yaml
- name: Setup PHP with tools - name: Setup PHP with tools
@@ -433,7 +436,7 @@ Disable coverage for these reasons:
- Accepts a `string`. For example `'8.5'`. - Accepts a `string`. For example `'8.5'`.
- Accepts `lowest` to set up the lowest supported PHP version. - Accepts `lowest` to set up the lowest supported PHP version.
- Accepts `highest` or `latest` to set up the latest stable PHP version. - Accepts `highest` or `latest` to set up the latest stable PHP version.
- Accepts `nightly` to set up a nightly build of the next PHP release (`8.6`). - Accepts `nightly` to set up a nightly build of the next PHP release (`8.7`).
- Accepts `master` to set up a nightly build from the master branch of PHP (`8.7`). - Accepts `master` to set up a nightly build from the master branch of PHP (`8.7`).
- Accepts `pre-installed` to set up the highest pre-installed PHP version. You can combine this with `update: true` to update the pre-installed PHP version. - Accepts `pre-installed` to set up the highest pre-installed PHP version. You can combine this with `update: true` to update the pre-installed PHP version.
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`. - Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
@@ -529,6 +532,13 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
- 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.
#### `asan` (optional)
- Specify to set up PHP with AddressSanitizer (ASAN) for memory error detection.
- Accepts `true` or `false`.
- Only available for PHP 8.0 and above on Linux runners.
- See [ASAN build setup](#asan-build-setup) for more info.
#### `update` (optional) #### `update` (optional)
- Specify to update PHP on the runner to the latest patch version. - Specify to update PHP on the runner to the latest patch version.
@@ -591,10 +601,10 @@ jobs:
### Nightly Build Setup ### Nightly Build Setup
> Set up a nightly build of `PHP 8.6` or `PHP 8.7`. > Set up a nightly build of `PHP 8.7`.
- These PHP versions are currently in active development and might contain bugs and breaking changes. - PHP 8.7 is in active development and might contain bugs and breaking changes.
- Some user space extensions might not support these versions currently. - Some extensions might not support PHP 8.7 yet.
```yaml ```yaml
steps: steps:
@@ -650,6 +660,44 @@ jobs:
phpts: ts # specify ts or nts phpts: ts # specify ts or nts
``` ```
### ASAN Build Setup
> Set up PHP with AddressSanitizer (ASAN) for memory error detection.
- ASAN builds include both `AddressSanitizer` and `UndefinedBehaviorSanitizer (UBSan)`.
- Only available for PHP 8.0 and above on Linux based runners.
- Useful for detecting memory errors such as buffer overflows, use-after-free, and memory leaks.
```yaml
jobs:
run:
runs-on: ubuntu-latest
name: Setup PHP with ASAN
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
env:
asan: true
```
You can combine ASAN with other options:
```yaml
- name: Setup PHP with ASAN and thread safety
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
env:
asan: true
phpts: ts
```
> [!NOTE]
> - ASAN builds have a performance overhead due to the instrumentation, so they are recommended for testing and debugging only.
> - You can configure ASAN behavior using the `ASAN_OPTIONS` environment variable in your test steps.
### Force Update Setup ### Force Update Setup
> Update to the latest patch of PHP versions. > Update to the latest patch of PHP versions.
@@ -690,7 +738,7 @@ jobs:
> Set up PHP on multiple architectures on Ubuntu GitHub Runners. > Set up PHP on multiple architectures on Ubuntu GitHub Runners.
- `PHP 5.6` to `PHP 8.5` are supported by `setup-php` on multiple architecture on `Ubuntu` and `Debian`. - `PHP 5.6` to `PHP 8.6` are supported by `setup-php` on multiple architectures on `Ubuntu` and `Debian`.
- For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `PHP` installed for `setup-php`. - For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `PHP` installed for `setup-php`.
```yaml ```yaml
@@ -1046,34 +1094,23 @@ Examples of using `setup-php` with various PHP frameworks and packages.
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 align="center">
<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#gh-light-mode-only"><img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140"></a>
<img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140" height="100"> <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"></a>
</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only"> <a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/cloudflare.svg" alt="Cloudflare" width="240"></a>
<img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140" height="100"> <a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/cloudflare-white.svg" alt="Cloudflare" width="240"></a>
</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a target="_blank" href="https://www.macstadium.com/company/opensource#gh-light-mode-only"><img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200"></a>
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only"> <a target="_blank" href="https://www.macstadium.com/company/opensource#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200"></a>
<img src="https://setup-php.com/sponsors/cloudflare.svg" alt="Cloudflare" width="240" height="80"> </p>
</a>
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-dark-mode-only"> <p align="center">
<img src="https://setup-php.com/sponsors/cloudflare-white.svg" alt="Cloudflare" width="240" height="80"> <a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php#gh-light-mode-only"><img src="https://setup-php.com/sponsors/namespace.svg?v=2" alt="Namespace" width="180" align="middle"></a>
</a> <a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/namespace-white.svg?v=2" alt="Namespace" width="180" align="middle"></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-light-mode-only"> <a target="_blank" href="https://www.blacksmith.sh/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/blacksmith.svg?v=2" alt="Blacksmith" width="180" align="middle"></a>
<img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200" height="80"> <a target="_blank" href="https://www.blacksmith.sh/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/blacksmith-white.svg?v=2" alt="Blacksmith" width="180" align="middle"></a>
</a>
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200" height="80">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-light-mode-only">
<img src="https://setup-php.com/sponsors/digitalocean.svg" alt="Digitalocean" width="100" height="100">
</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>
</p> </p>
Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur). Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
@@ -1164,6 +1201,8 @@ Many users and organizations support setup-php via [GitHub Sponsors](https://git
[`rector`]: https://getrector.org/ [`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
[`upsun`]: https://docs.upsun.com/administration/cli.html
[`upsun-cli`]: https://docs.upsun.com/administration/cli.html
[`vapor`]: https://docs.vapor.build/ [`vapor`]: https://docs.vapor.build/
[`vapor-cli`]: https://docs.vapor.build/ [`vapor-cli`]: https://docs.vapor.build/
[`wp`]: https://wp-cli.org/ [`wp`]: https://wp-cli.org/
+2
View File
@@ -72,6 +72,7 @@ describe('Extension tests', () => {
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'} ${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
${'relay'} | ${'7.4'} | ${'add_relay relay'} ${'relay'} | ${'7.4'} | ${'add_relay relay'}
${'relay-v1.2.3'} | ${'7.4'} | ${'add_relay relay-v1.2.3'} ${'relay-v1.2.3'} | ${'7.4'} | ${'add_relay relay-v1.2.3'}
${'relay-nightly'} | ${'8.6'} | ${'add_relay relay-nightly'}
${'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'}
@@ -107,6 +108,7 @@ describe('Extension tests', () => {
${'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'} ${'relay-1.2.3'} | ${'7.4'} | ${'add_relay relay-1.2.3'}
${'relay-nightly'} | ${'8.6'} | ${'add_relay relay-nightly'}
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'} ${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
${'xdebug2'} | ${'7.4'} | ${'add_brew_extension xdebug2 zend_extension 2.9.8'} ${'xdebug2'} | ${'7.4'} | ${'add_brew_extension xdebug2 zend_extension 2.9.8'}
${'zephir_parser-v1.2.3'} | ${'7.2'} | ${'add_zephir_parser zephir_parser-v1.2.3'} ${'zephir_parser-v1.2.3'} | ${'7.2'} | ${'add_zephir_parser zephir_parser-v1.2.3'}
+4
View File
@@ -21,6 +21,10 @@ it('checking fetch', async () => {
nock(host_url) nock(host_url)
.get('/manifest') .get('/manifest')
.matchHeader(
'user-agent',
`setup-php (${process.platform}; ${process.arch}; +https://setup-php.com)`
)
.reply(200, {latest: 'latest'}) .reply(200, {latest: 'latest'})
.get('/manifest') .get('/manifest')
.matchHeader('authorization', 'Bearer invalid_token') .matchHeader('authorization', 'Bearer invalid_token')
+6 -3
View File
@@ -669,7 +669,7 @@ describe('Tools tests', () => {
it.each([ it.each([
[ [
'blackfire, blackfire-player, box, churn, cloud-cli, cpx, cs2pr, flex, grpc_php_plugin, mago, name-collision-detector, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, vapor, wp, pie', 'blackfire, blackfire-player, box, churn, cloud-cli, cpx, cs2pr, flex, grpc_php_plugin, mago, name-collision-detector, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, upsun, vapor, wp, pie',
[ [
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/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://artifacts.setup-php.com/composer/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',
@@ -702,6 +702,7 @@ describe('Tools tests', () => {
'add_devtools phpize', 'add_devtools phpize',
'add_protoc latest', 'add_protoc latest',
'add_symfony latest', 'add_symfony latest',
'add_upsun latest',
'add_composer_tool 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"',
'add_tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"' 'add_tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"'
@@ -716,7 +717,7 @@ describe('Tools tests', () => {
it.each([ it.each([
[ [
'backward-compatibility-check, behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cpx:2.0.0, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, laravel-cloud, mago:0.26.1, name-collision-detector, 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, pie', 'backward-compatibility-check, behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cpx:2.0.0, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, laravel-cloud, mago:0.26.1, name-collision-detector, 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, upsun-cli:5.16.0, vapor-cli, wp-cli, pie',
[ [
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/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://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'add_composer_tool behat behat behat/ scoped', 'add_composer_tool behat behat behat/ scoped',
@@ -755,6 +756,7 @@ describe('Tools tests', () => {
'add_composer_tool rector rector rector/ scoped', 'add_composer_tool rector rector rector/ scoped',
'add_composer_tool backward-compatibility-check backward-compatibility-check roave/ scoped', 'add_composer_tool backward-compatibility-check backward-compatibility-check roave/ scoped',
'add_symfony latest', 'add_symfony latest',
'add_upsun 5.16.0',
'add_composer_tool 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"',
'add_composer_tool easy-coding-standard easy-coding-standard symplify/ scoped', 'add_composer_tool easy-coding-standard easy-coding-standard symplify/ scoped',
@@ -770,7 +772,7 @@ describe('Tools tests', () => {
it.each([ it.each([
[ [
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, mago, name-collision-detector, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, wp, pie', 'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, mago, name-collision-detector, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, upsun-cli, wp, pie',
[ [
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/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://artifacts.setup-php.com/composer/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',
@@ -789,6 +791,7 @@ describe('Tools tests', () => {
'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-Upsun latest',
'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"',
'Add-Tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"' 'Add-Tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"'
] ]
+4 -2
View File
@@ -51,8 +51,10 @@ describe('Utils tests', () => {
'utf8' 'utf8'
) )
}); });
expect(await utils.parseVersion('latest')).toBe('8.5'); expect(await utils.parseVersion('latest')).toBe('8.6');
expect(await utils.parseVersion('nightly')).toBe('8.6'); expect(await utils.parseVersion('highest')).toBe('8.6');
expect(await utils.parseVersion('8.x')).toBe('8.6');
expect(await utils.parseVersion('nightly')).toBe('8.7');
expect(await utils.parseVersion('master')).toBe('8.7'); expect(await utils.parseVersion('master')).toBe('8.7');
expect(await utils.parseVersion('8.7')).toBe('8.7'); expect(await utils.parseVersion('8.7')).toBe('8.7');
expect(await utils.parseVersion('8.7.0')).toBe('8.7'); expect(await utils.parseVersion('8.7.0')).toBe('8.7');
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -4
View File
@@ -3468,10 +3468,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/deepmerge": { "node_modules/deepmerge": {
"name": "@shivammathur/deepmerge", "version": "4.3.1",
"version": "4.3.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
"resolved": "https://registry.npmjs.org/@shivammathur/deepmerge/-/deepmerge-4.3.2.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
"integrity": "sha512-OBZnBsXwbBITC90wXf9Ph8W7OAUkhFdM+BGRYeIQwt5nILxy5wkk2plUoabi9Yp6xm0c/Yv9PuLiGBXnfizAMA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
+7 -8
View File
@@ -44,27 +44,26 @@
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",
"@types/node": "^26.6.6", "@types/node": "^26.6.6",
"@typescript-eslint/eslint-plugin": "^8.72.1", "@typescript-eslint/eslint-plugin": "^8.73.0",
"@typescript-eslint/parser": "^8.72.1", "@typescript-eslint/parser": "^8.73.0",
"@typescript/native": "npm:typescript@^7.0.2", "@typescript/native": "npm:typescript@^7.0.2",
"@vercel/ncc": "^0.45.0", "@vercel/ncc": "^0.45.0",
"eslint": "^10.14.0", "eslint": "^10.15.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.5", "eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-import-x": "^4.17.1", "eslint-plugin-import-x": "^4.18.1",
"eslint-plugin-jest": "^29.17.0", "eslint-plugin-jest": "^29.17.1",
"eslint-plugin-prettier": "^5.5.7", "eslint-plugin-prettier": "^5.5.7",
"globals": "^17.14.0", "globals": "^17.14.0",
"jest": "^30.5.2", "jest": "^30.5.2",
"jest-circus": "^30.5.2", "jest-circus": "^30.5.2",
"nock": "^15.0.5", "nock": "^15.0.6",
"prettier": "^3.9.10", "prettier": "^3.10.1",
"simple-git-hooks": "^2.14.0", "simple-git-hooks": "^2.14.0",
"ts-jest": "^29.4.15", "ts-jest": "^29.4.15",
"typescript": "npm:@typescript/typescript6@^6.0.2" "typescript": "npm:@typescript/typescript6@^6.0.2"
}, },
"overrides": { "overrides": {
"deepmerge": "npm:@shivammathur/deepmerge@4.3.2",
"glob": "^14.0.3", "glob": "^14.0.3",
"minimatch": "^11.0.3" "minimatch": "^11.0.3"
}, },
+4 -4
View File
@@ -1,10 +1,10 @@
{ {
"lowest": "8.1", "lowest": "8.1",
"highest": "8.5", "highest": "8.6",
"latest": "8.5", "latest": "8.6",
"nightly": "8.6", "nightly": "8.7",
"master": "8.7", "master": "8.7",
"5.x": "5.6", "5.x": "5.6",
"7.x": "7.4", "7.x": "7.4",
"8.x": "8.5" "8.x": "8.6"
} }
-111
View File
@@ -1,111 +0,0 @@
{
"amqp": "php-amqp/php-amqp",
"apcu": "apcu/apcu",
"apfd": "m6w6/ext-apfd",
"arrow": "flow-php/arrow-ext",
"ast": "nikic/php-ast",
"biscuit_php": "ptondereau/biscuit-php",
"bitset": "pecl/bitset",
"brotli": "kjdev/brotli",
"bsdiff": "bsdiff/bsdiff",
"csv": "girgias/csv",
"dbus": "pecl/dbus",
"decimal": "php-decimal/ext-decimal",
"deepclone": "symfony/deepclone",
"dio": "pecl/dio",
"ds": "php-ds/ext-ds",
"ev": "osmanov/pecl-ev",
"event": "osmanov/pecl-event",
"excel": "iliaal/php-excel",
"excimer": "wikimedia/excimer",
"fast_uuid": "iliaal/fast_uuid",
"fastchart": "iliaal/fastchart",
"fastjson": "iliaal/fastjson",
"geospatial": "php-geospatial/geospatial",
"glfw": "mario-deluna/php-glfw",
"grpc": "grpc/grpc-php-ext",
"hdr_histogram": "beberlei/hdrhistogram",
"hdrhistogram": "beberlei/hdrhistogram",
"highlighter": "yiipress/highlighter",
"http": "m6w6/ext-http",
"igbinary": "igbinary/igbinary",
"imagick": "imagick/imagick",
"inotify": "arnaud-lb/inotify",
"ip2location": "ip2location/ip2location-pie",
"ip2proxy": "ip2location/ip2proxy-pie",
"json_post": "m6w6/ext-json_post",
"jsonpath": "supermetrics/jsonpath",
"judy": "orieg/judy",
"krb5": "pecl/krb5",
"lchash": "iliaal/lchash",
"luasandbox": "wikimedia/luasandbox",
"lz4": "kjdev/lz4",
"lzf": "pecl/lzf",
"mailparse": "pecl/mailparse",
"maxminddb": "maxmind-db/reader-ext",
"mcrypt": "pecl/mcrypt",
"mdparser": "iliaal/mdparser",
"memcached": "php-memcached/php-memcached",
"memprof": "arnaud-lb/memprof",
"mjml": "kcs/mjml",
"mongodb": "mongodb/mongodb-extension",
"msgpack": "msgpack/msgpack-php",
"mustache": "jbboehr/php-mustache",
"oci8": "oci8/oci8",
"openswoole": "openswoole/ext-openswoole",
"opentelemetry": "open-telemetry/ext-opentelemetry",
"operator": "jblo/operator",
"parallel": "pecl/parallel",
"pcov": "pecl/pcov",
"pdo_duckdb": "thomas-0816/pdo-duckdb-php",
"pdo_oci": "pecl/pdo_oci",
"pdo_sqlsrv": "microsoft/pdo_sqlsrv",
"pecl_http": "m6w6/ext-http",
"phalcon": "phalcon/cphalcon",
"phonetic": "iliaal/phonetic",
"phpser": "iliaal/phpser",
"phpstan_turbo": "phpstan/turbo",
"pkcs11": "gamringer/pkcs11",
"pq": "m6w6/ext-pq",
"quickhash": "derickr/quickhash",
"raphf": "m6w6/ext-raphf",
"rar": "cataphract/rar",
"rdkafka": "rdkafka/rdkafka",
"redis": "phpredis/phpredis",
"relay": "cachewerk/ext-relay",
"rpminfo": "remi/rpminfo",
"scrypt": "woohoolabs/php-scrypt",
"selinux": "pecl/selinux",
"snappy": "kjdev/snappy",
"solr": "pecl/solr",
"spx": "noisebynorthwest/php-spx",
"sqlsrv": "microsoft/sqlsrv",
"statgrab": "iliaal/statgrab",
"swoole": "swoole/swoole",
"swow": "swow/swow-extension",
"taint": "laruence/taint",
"tensor": "rubix/tensor_ext",
"timezonedb": "pecl/timezonedb",
"translit": "derickr/translit",
"uopz": "krakjoe/uopz",
"uuid": "pecl/uuid",
"uv": "amphp/uv",
"valkey_glide": "valkey-io/valkey-glide-php",
"vld": "derickr/vld",
"wikidiff2": "wikimedia/wikidiff2",
"win32service": "win32service/win32service",
"xattr": "pecl/xattr",
"xdebug": "xdebug/xdebug",
"xdiff": "pecl/xdiff",
"xlswriter": "viest/xlswriter",
"xmldiff": "pecl/xml-xmldiff",
"xpass": "remi/xpass",
"yac": "laruence/yac",
"yaconf": "laruence/yaconf",
"yaf": "laruence/yaf",
"yaml": "pecl/yaml",
"yar": "laruence/yar",
"yaz": "indexdata/yaz",
"zip": "pecl/zip",
"zstd": "kjdev/zstd"
}
+8
View File
@@ -288,6 +288,14 @@
"version_prefix": "v", "version_prefix": "v",
"version_parameter": "-V" "version_parameter": "-V"
}, },
"upsun-cli": {
"alias": "upsun",
"type": "custom-package",
"repository": "upsun/cli",
"domain": "https://github.com",
"version_prefix": "v",
"version_parameter": "--version"
},
"blackfire-player": { "blackfire-player": {
"type": "custom-function", "type": "custom-function",
"domain": "https://get.blackfire.io", "domain": "https://get.blackfire.io",
+4 -4
View File
@@ -31,14 +31,14 @@ 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 7.4relay...8.5relay // match 7.4relay...8.6relay
// match 5.3blackfire...8.5blackfire // match 5.3blackfire...8.5blackfire
// match 5.3blackfire-(semver)...8.5blackfire-(semver) // match 5.3blackfire-(semver)...8.5blackfire-(semver)
// match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http // match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http
// match 5.3ioncube...8.5ioncube // match 5.3ioncube...8.5ioncube
// 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.5zephir_parser // match 7.0zephir_parser...8.5zephir_parser
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test( case /^(7\.4|8\.[0-6])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
version_extension version_extension
): ):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test( case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
@@ -277,7 +277,7 @@ 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 7.4relay...8.5relay // match 7.4relay...8.6relay
// match 5.3blackfire...8.5blackfire // match 5.3blackfire...8.5blackfire
// match 5.3blackfire-(semver)...8.5blackfire-(semver) // match 5.3blackfire-(semver)...8.5blackfire-(semver)
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid // match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
@@ -285,7 +285,7 @@ export async function addExtensionLinux(
// match 5.3ioncube...8.5ioncube // match 5.3ioncube...8.5ioncube
// 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.5zephir_parser // match 7.0zephir_parser...8.5zephir_parser
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test( case /^(7\.4|8\.[0-6])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
version_extension version_extension
): ):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test( case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
+1 -1
View File
@@ -16,7 +16,7 @@ export async function fetch(
redirect_count = 5 redirect_count = 5
): Promise<Record<string, string>> { ): Promise<Record<string, string>> {
const headers: Record<string, string> = { const headers: Record<string, string> = {
'User-Agent': `Mozilla/5.0 (${process.platform} ${process.arch}) setup-php` 'User-Agent': `setup-php (${process.platform}; ${process.arch}; +https://setup-php.com)`
}; };
if (auth_token) { if (auth_token) {
headers['Authorization'] = 'Bearer ' + auth_token; headers['Authorization'] = 'Bearer ' + auth_token;
+1 -1
View File
@@ -333,7 +333,7 @@ setup_php() {
} }
# Variables # Variables
version=${1:-'8.5'} version=${1:-'8.6'}
ini=${2:-'production'} ini=${2:-'production'}
src=${0%/*}/.. src=${0%/*}/..
php_formula=shivammathur/php/php@"$version" php_formula=shivammathur/php/php@"$version"
-61
View File
@@ -85,67 +85,6 @@ Function Add-ExtensionFromGithub {
} }
} }
# Function to install a PIE package or mapped version. Windows uses prebuilt DLLs.
Function Add-PieExtension {
Param (
[Parameter(Position = 0, Mandatory = $true)]
[ValidateNotNull()]
[string]
$extension,
[Parameter(Position = 1, Mandatory = $false)]
[string]
$package = '',
[Parameter(Position = 2, Mandatory = $false)]
[Alias('AllowSourceBuild')]
[bool]
$allow_source = $false
)
$requested = ($package -split ':', 2)[-1]
if ($package -notmatch '/') {
$mapping = Get-Content "$src\configs\pie-extensions.json" -Raw | ConvertFrom-Json
$package = $mapping.$extension
if (-not $package) { throw "No PIE package mapping for $extension" }
if ($requested -in @('', 'latest', 'stable')) { $requested = '' } else { $package += ":$requested" }
} elseif ($package -notmatch ':') {
$requested = ''
}
& "$php_dir\php.exe" -r 'exit(extension_loaded($argv[1]) && ($argv[2] === "" || phpversion($argv[1]) === $argv[2]) ? 0 : 1);' -- $extension "$requested" >$null 2>&1
if ($LASTEXITCODE -eq 0) {
Add-Log $tick $extension 'Enabled'
return
}
$pie_args = @('install', $package, '--no-interaction', '--skip-enable-extension', '--no-build-tools-check', '--no-system-dependencies-check', "--with-php-path=$php_dir\php.exe")
if (-not $allow_source) {
# Skip CPU detection when compilation is disabled.
$pie_args += @('--suppress-download-url-method=composer-default', '--suppress-download-url-method=pre-packaged-source', '--make-parallel-jobs=1')
}
New-Item -ItemType Directory -Path $composer_home -Force >$null
Set-ComposerAuth
$pie_log = Join-Path ([System.IO.Path]::GetTempPath()) "pie-$extension.log"
$pie_path = Join-Path $bin_dir 'pie'
if ([version]$installed.MajorMinorVersion -lt [version]'8.1') {
$pie_path = Join-Path $bin_dir 'pie-cli.exe'
if (-not (Test-Path $pie_path -PathType Leaf)) {
Get-File -Url https://github.com/php/pie/releases/latest/download/pie-Windows-X64.exe -OutFile $pie_path
}
& $pie_path @pie_args >$pie_log 2>&1
} else {
if (-not (Test-Path $pie_path -PathType Leaf)) {
Add-Tool https://github.com/php/pie/releases/latest/download/pie.phar pie '-V' >$null 2>&1
}
& "$php_dir\php.exe" $pie_path @pie_args >$pie_log 2>&1
}
if ($LASTEXITCODE -ne 0) {
Get-Content $pie_log | ForEach-Object { Write-Host $_ }
throw "Could not install $package using PIE (exit code $LASTEXITCODE)"
}
Enable-ExtensionDependencies $extension
Enable-PhpExtension -Extension $extension -Path $php_dir
& "$php_dir\php.exe" -r 'exit(extension_loaded($argv[1]) ? 0 : 1);' -- $extension >$null 2>&1
if ($LASTEXITCODE -ne 0) { throw "Could not load $extension after installing $package using PIE" }
Add-Log $tick $extension 'Installed and enabled'
}
# Function to add PHP extensions. # Function to add PHP extensions.
Function Add-Extension { Function Add-Extension {
Param ( Param (
-48
View File
@@ -188,54 +188,6 @@ get_pecl_version() {
echo "$response" | grep -Eio "$pattern" | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1 echo "$response" | grep -Eio "$pattern" | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1
} }
# Install a PIE package or mapped version: extension, package, allow_source=false, prefix.
pie_install() {
local extension=$1 package=${2:-} allow_source=${3:-false}
local prefix=${4:-$(get_extension_prefix "$extension")} requested pie_path php_config asset arch
requested=${package##*:}
if [[ "$package" != */* ]]; then
package=$(jq -er --arg extension "$extension" '.[$extension]' "${src:?}/configs/pie-extensions.json") || return 1
case "$requested" in ''|latest|stable) requested= ;; *) package="$package:$requested" ;; esac
elif [[ "$package" != *:* ]]; then
requested=
fi
if php -d display_errors=0 -r 'exit(extension_loaded($argv[1]) && ($argv[2] === "" || phpversion($argv[1]) === $argv[2]) ? 0 : 1);' -- "$extension" "$requested"; then
return 0
fi
local pie_args=(install "$package" --no-interaction --skip-enable-extension --no-build-tools-check --no-system-dependencies-check)
php_config=$(command -v php-config) || return 1
pie_args+=("--with-php-config=$php_config")
if [ "$allow_source" != true ]; then
# Skip CPU detection when compilation is disabled.
pie_args+=(--suppress-download-url-method=composer-default --suppress-download-url-method=pre-packaged-source --make-parallel-jobs=1)
fi
if php -r 'exit(PHP_VERSION_ID >= 80100 ? 0 : 1);'; then
if ! command -v pie >/dev/null 2>&1; then
add_tool https://github.com/php/pie/releases/latest/download/pie.phar pie '-V' >/dev/null 2>&1 || return 1
fi
pie_path=$(command -v pie) || return 1
else
arch=$(uname -m)
case "$arch" in x86_64|amd64) arch=X64 ;; arm64|aarch64) arch=ARM64 ;; *) return 1 ;; esac
asset="pie-$(uname -s)-$arch"
[ "$(uname -s)" != Darwin ] || asset="pie-macOS-$arch"
pie_path="${tool_path_dir:?}/pie-cli"
if [ ! -x "$pie_path" ]; then
[ "$(get -v -e "$pie_path" "https://github.com/php/pie/releases/latest/download/$asset")" = 200 ] || return 1
fi
fi
mkdir -p "${composer_home:?}"
set_composer_auth
sudo -E "$pie_path" "${pie_args[@]}" >"/tmp/pie-$extension.log" 2>&1 || {
local status=$?
cat "/tmp/pie-$extension.log" >&2
return "$status"
}
sudo rm -f /tmp/php"${version:?}"_extensions
enable_extension "$extension" "$prefix" || return 1
check_extension "$extension"
}
# Function to install PECL extensions and accept default options # Function to install PECL extensions and accept default options
pecl_install() { pecl_install() {
local extension=$1 local extension=$1
+1 -1
View File
@@ -31,7 +31,7 @@ add_cubrid_helper() {
set_cubrid_repo set_cubrid_repo
set_cubrid_branch set_cubrid_branch
patch_phpize patch_phpize
read -r "${ext}_PREFIX_CONFIGURE_OPTS" <<< "CFLAGS=-Wno-implicit-function-declaration" read -r "${ext}_CONFIGURE_PREFIX_OPTS" <<< "SED=sed CMAKE_POLICY_VERSION_MINIMUM=3.5 CFLAGS=-std=gnu17"
read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)" read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)"
add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension
restore_phpize restore_phpize
+30 -1
View File
@@ -51,6 +51,32 @@ Function Get-Oci8DLL() {
return $null return $null
} }
# Function to restore OCI DLLs missing from a cached PHP build.
Function Add-BundledOci() {
$bundleVersion = $installed.FullVersion
# PHP 8.2.34 is the last Windows PHP 8.2 release containing the OCI DLLs.
if($version -eq '8.2' -and [version]$installed.Version -gt [version]'8.2.34') {
$bundleVersion = '8.2.34'
}
$threadSafety = if($ts) { '' } else { '-nts' }
$compiler = if($installed.VCVersion -ge 16) { 'vs' } elseif($version -eq '7.4') { 'vc' } else { 'VC' }
$asset = "php-$bundleVersion$threadSafety-Win32-$compiler$($installed.VCVersion)-$arch.zip"
$bundleDir = Join-Path ([IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())
New-Item -ItemType Directory -Path $bundleDir > $null
try {
Get-File -Url "$php_windows/releases/$asset" -FallbackUrl "$php_windows/releases/archives/$asset" -OutFile "$bundleDir\php.zip"
Expand-Archive -Path "$bundleDir\php.zip" -DestinationPath $bundleDir -Force
Get-ChildItem "$bundleDir\ext\php_*oci*.dll" | ForEach-Object {
$dll = Get-PhpExtension -Path $_.FullName
if($dll.PhpVersion -eq $version -and $dll.Architecture -eq $arch -and $dll.ThreadSafe -eq $ts) {
Copy-Item $_.FullName $ext_dir -Force
}
}
} finally {
Remove-Item $bundleDir -Recurse -Force
}
}
# Function to install oci8 and pdo_oci. # Function to install oci8 and pdo_oci.
Function Add-Oci() { Function Add-Oci() {
Param ( Param (
@@ -63,7 +89,10 @@ Function Add-Oci() {
try { try {
$status = 'Enabled' $status = 'Enabled'
Add-InstantClient Add-InstantClient
if($version -lt '8.4') { if($version -lt '8.3') {
if(-not(Get-ChildItem "$ext_dir\php_$extension*.dll")) {
Add-BundledOci
}
if($version -lt '5.6' -and $extension -eq 'oci8') { if($version -lt '5.6' -and $extension -eq 'oci8') {
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
} else { } else {
@@ -0,0 +1,11 @@
patch_pdo_cubrid() {
if [[ ${version:?} =~ ^7\.[0-2]$ ]] && [ -f cubrid_driver7.c ]; then
# Match the PHP 7 PDO callbacks and store zvals with the PHP 7 hash API.
sed -i.bak \
-e 's/const char \*sql, long sql_len/const char *sql, size_t sql_len/g' \
-e 's/static long cubrid_handle_doer/static zend_long cubrid_handle_doer/' \
-e 's/zend_hash_index_update_ptr(HASH_OF(arg), index, (void \*)\&tmp_zval)/zend_hash_index_update(HASH_OF(arg), index, \&tmp_zval)/' \
-e 's/(cubrid_retval = zend_hash_update(HASH_OF(arg), key, (void \*) \&tmp_zval)) == FAILURE/zend_hash_str_update(HASH_OF(arg), key, strlen(key), \&tmp_zval) == NULL/' \
cubrid_driver7.c
fi
}
+8 -2
View File
@@ -35,12 +35,16 @@ get_openssl_suffix() {
# Change library paths in relay binary. # Change library paths in relay binary.
change_library_paths() { change_library_paths() {
if [ "$os" = "Darwin" ]; then if [ "$os" = "Darwin" ]; then
otool -L "${ext_dir:?}"/relay.so | grep -q 'ssl.3.' && openssl_version='3' || openssl_version='1.1' dylibs="$(otool -L "${ext_dir:?}"/relay.so | grep -Eo '.*\.dylib' | cut -f1 -d ' ')"
openssl_version="$(echo "$dylibs" | sed -nE 's|.*libssl\.([0-9.]+)\.dylib$|\1|p' | head -n 1)"
if [ -z "$openssl_version" ]; then
openssl_version="$(echo "$dylibs" | sed -nE 's|.*/openssl@([0-9.]+)/lib/libssl\.dylib$|\1|p' | head -n 1)"
fi
openssl_version="${openssl_version:-1.1}"
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || { [ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || {
safe_brew install --skip-link openssl@"$openssl_version" && safe_brew install --skip-link openssl@"$openssl_version" &&
brew link --overwrite --force openssl@"$openssl_version" brew link --overwrite --force 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 "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 "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 "libssl.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libssl.dylib "$ext_dir"/relay.so
@@ -130,8 +134,10 @@ add_relay_helper() {
fi fi
if [ -e /tmp/relay.tar.gz ] && file /tmp/relay.tar.gz | grep -q 'gzip'; then 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 tar --strip-components=1 -xzf /tmp/relay.tar.gz -C "${ext_dir:?}"
if [ -e "${ext_dir:?}"/relay-pkg.so ]; then
sudo mv "${ext_dir:?}"/relay-pkg.so "${ext_dir:?}"/relay.so sudo mv "${ext_dir:?}"/relay-pkg.so "${ext_dir:?}"/relay.so
fi fi
fi
} }
# Add relay extension # Add relay extension
+11 -5
View File
@@ -122,6 +122,10 @@ patch_extension() {
fetch_extension() { fetch_extension() {
local extension=$1 local extension=$1
local fetch=$2 local fetch=$2
local curl_opts=("${curl_opts[@]}" --retry 2)
if curl --help all 2>/dev/null | grep -- '--retry-all-errors' >/dev/null; then
curl_opts+=(--retry-all-errors)
fi
if [ "$fetch" = "clone" ]; then if [ "$fetch" = "clone" ]; then
run_group "git clone -nv $url/$org/$repo /tmp/$repo-$release" "git clone" run_group "git clone -nv $url/$org/$repo /tmp/$repo-$release" "git clone"
cd /tmp/"$repo-$release" || exit 1 cd /tmp/"$repo-$release" || exit 1
@@ -132,15 +136,17 @@ fetch_extension() {
run_group "git submodule update --jobs $jobs --init --recursive" "git submodule" run_group "git submodule update --jobs $jobs --init --recursive" "git submodule"
fi fi
elif [ "$fetch" = "get" ]; then elif [ "$fetch" = "get" ]; then
get -q -n /tmp/"$extension".tar.gz "$url/$org/$repo/archive/$release.tar.gz" get -q -n /tmp/"$extension".tar.gz "$url/$org/$repo/archive/$release.tar.gz" || return 1
tar -xzf /tmp/"$extension".tar.gz -C /tmp tar -tzf /tmp/"$extension".tar.gz >/dev/null 2>&1 || return 1
tar -xzf /tmp/"$extension".tar.gz -C /tmp || return 1
cd /tmp/"$repo"-"$release"/"$sub_dir" || exit cd /tmp/"$repo"-"$release"/"$sub_dir" || exit
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:]') 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 https://pecl.php.net/get/"$capital_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 || return 1
tar -xzf /tmp/"$pecl_name".tgz -C /tmp tar -tzf /tmp/"$pecl_name".tgz >/dev/null 2>&1 || return 1
tar -xzf /tmp/"$pecl_name".tgz -C /tmp || return 1
cd /tmp/"$pecl_name"-"$release" 2>/dev/null || cd /tmp/"$capital_pecl_name"-"$release" 2>/dev/null || exit cd /tmp/"$pecl_name"-"$release" 2>/dev/null || cd /tmp/"$capital_pecl_name"-"$release" 2>/dev/null || exit
fi fi
} }
@@ -165,7 +171,7 @@ add_extension_from_source() {
( (
add_devtools phpize >/dev/null 2>&1 add_devtools phpize >/dev/null 2>&1
disable_extension_helper "$extension" disable_extension_helper "$extension"
fetch_extension "$extension" "$fetch" fetch_extension "$extension" "$fetch" || exit 1
if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then
add_log "${cross:?}" "$source" "$source does not have a PHP extension" add_log "${cross:?}" "$source" "$source does not have a PHP extension"
else else
+14 -20
View File
@@ -6,20 +6,15 @@ add_sudo() {
fi fi
} }
# Function to link apt-fast to apt-get # Function to select the package installer.
link_apt_fast() { set_apt_install() {
if ! command -v apt-fast >/dev/null; then local apt=apt-get
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast command -v apt-fast >/dev/null && apt=apt-fast
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit apt_install="sudo $debconf_fix $apt install -y --no-install-recommends -o Dpkg::Options::=--force-confnew"
fi
} }
# Function to setup environment for self-hosted runners. # Function to setup environment for self-hosted runners.
self_hosted_helper() { self_hosted_helper() {
if ! command -v apt-fast >/dev/null; then
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
fi
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
local packages=() local packages=()
mapfile -t packages < <(filter_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg) mapfile -t packages < <(filter_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg)
@@ -30,16 +25,12 @@ self_hosted_helper() {
# Function to fix broken packages. # Function to fix broken packages.
fix_broken_packages() { fix_broken_packages() {
sudo apt --fix-broken install >/dev/null 2>&1 sudo apt --fix-broken install -o Dpkg::Options::=--force-confnew >/dev/null 2>&1
} }
# Function to install a package # Function to install a package
install_packages() { install_packages() {
packages=("$@") packages=("$@")
if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then
echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1
trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit
fi
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1) $apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
} }
@@ -133,7 +124,11 @@ add_devtools() {
# Function to setup PHP from the shivammathur/php-builder builds. # Function to setup PHP from the shivammathur/php-builder builds.
setup_php_builder() { setup_php_builder() {
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}" if [[ -n "${asan:-}" && "$version" =~ ${no_asan_builds:?} ]]; then
add_log "${cross:?}" "PHP" "ASAN is only supported for PHP 8.0+"
exit 1
fi
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}" "${asan:-}"
} }
# 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.
@@ -246,7 +241,7 @@ update_php() {
# Function to install PHP. # Function to install PHP.
add_php() { add_php() {
if [ "${runner:?}" = "self-hosted" ] || [ "${use_builds_cache:-true}" = "false" ]; then if [ "${runner:?}" = "self-hosted" ] || [ "${use_builds_cache:-true}" = "false" ]; then
if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" ]]; then if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" || -n "${asan:-}" ]]; then
setup_php_builder setup_php_builder
else else
add_packaged_php add_packaged_php
@@ -353,15 +348,14 @@ setup_php() {
} }
# Variables # Variables
version=${1:-'8.5'} version=${1:-'8.6'}
ini=${2:-'production'} ini=${2:-'production'}
src=${0%/*}/.. src=${0%/*}/..
debconf_fix="DEBIAN_FRONTEND=noninteractive" debconf_fix="DEBIAN_FRONTEND=noninteractive"
apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends"
scripts="$src"/scripts scripts="$src"/scripts
add_sudo >/dev/null 2>&1 add_sudo >/dev/null 2>&1
link_apt_fast >/dev/null 2>&1 set_apt_install >/dev/null 2>&1
. /etc/os-release . /etc/os-release
# shellcheck source=. # shellcheck source=.
+3 -2
View File
@@ -304,9 +304,10 @@ Function Add-Tool() {
} else { } else {
$backup_path = "$tool_path.bak" $backup_path = "$tool_path.bak"
if (Test-Path $tool_path) { Copy-Item $tool_path -Destination $backup_path -Force } if (Test-Path $tool_path) { Copy-Item $tool_path -Destination $backup_path -Force }
$user_agent = "setup-php ($env:RUNNER_OS; $env:RUNNER_ARCH; +https://setup-php.com)"
foreach ($url in $urls){ foreach ($url in $urls){
try { try {
$status_code = (Invoke-WebRequest -Passthru -Uri $url -OutFile $tool_path).StatusCode $status_code = (Invoke-WebRequest -Passthru -Uri $url -UserAgent $user_agent -OutFile $tool_path).StatusCode
} catch { } catch {
$status_code = 0 $status_code = 0
if($url -match '^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$') { if($url -match '^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$') {
@@ -314,7 +315,7 @@ Function Add-Tool() {
$release_url = Get-LastRelease $url $release_url = Get-LastRelease $url
if ($release_url) { if ($release_url) {
$url = $release_url $url = $release_url
$status_code = (Invoke-WebRequest -Passthru -Uri $url -OutFile $tool_path).StatusCode $status_code = (Invoke-WebRequest -Passthru -Uri $url -UserAgent $user_agent -OutFile $tool_path).StatusCode
} }
} catch { } catch {
$status_code = 0 $status_code = 0
+16 -3
View File
@@ -224,6 +224,12 @@ get_last_release() {
done done
} }
# Download a tool with the setup-php user agent.
download_tool() {
local curl_opts=("${curl_opts[@]}" -A "setup-php ($RUNNER_OS; $RUNNER_ARCH; +https://setup-php.com)")
get -v -e "$@"
}
# Function to setup a remote tool. # Function to setup a remote tool.
add_tool() { add_tool() {
url=$1 url=$1
@@ -263,12 +269,15 @@ add_tool() {
fi fi
else else
[ -f "$tool_path" ] && sudo cp -a "$tool_path" "$tool_path.bak" [ -f "$tool_path" ] && sudo cp -a "$tool_path" "$tool_path.bak"
status_code=$(get -v -e "$tool_path" "${url[@]}") # Tools are single files, so let servers gzip them in transit when curl can decode it.
local curl_opts=("${curl_opts[@]}")
curl -V | grep -qw libz && curl_opts+=(--compressed)
status_code=$(download_tool "$tool_path" "${url[@]}")
if [ "$status_code" != "200" ] && [[ "${url[0]}" =~ ^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$ ]]; then if [ "$status_code" != "200" ] && [[ "${url[0]}" =~ ^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$ ]]; then
local release_url local release_url
if release_url=$(get_last_release "${url[0]}"); then if release_url=$(get_last_release "${url[0]}"); then
url[0]="$release_url" url[0]="$release_url"
status_code=$(get -v -e "$tool_path" "${url[0]}") status_code=$(download_tool "$tool_path" "${url[0]}")
fi fi
fi fi
if [ "$status_code" = "200" ]; then if [ "$status_code" = "200" ]; then
@@ -279,8 +288,12 @@ add_tool() {
sudo cp -a "$tool_path" "$cache_path" sudo cp -a "$tool_path" "$cache_path"
fi fi
fi fi
if [ "$status_code" != "200" ] && [ -f "$tool_path.bak" ]; then if [ "$status_code" != "200" ]; then
if [ -f "$tool_path.bak" ]; then
sudo mv "$tool_path.bak" "$tool_path" sudo mv "$tool_path.bak" "$tool_path"
else
sudo rm -f "$tool_path"
fi
fi fi
sudo rm -f "$tool_path.bak" sudo rm -f "$tool_path.bak"
fi fi
+30
View File
@@ -0,0 +1,30 @@
Function Add-Upsun() {
param(
[Parameter(Mandatory = $true, Position = 0, HelpMessage = 'Upsun CLI version to be installed')]
[string] $upsun_tag
)
$upsun_tag = $upsun_tag.replace('v', '')
if($upsun_tag -ne 'latest' -and $upsun_tag -notmatch '^\d+(\.\d+)*$') {
Add-Log $cross "upsun-cli" "Invalid upsun-cli version: $upsun_tag"
} elseif(-not([Environment]::Is64BitOperatingSystem)) {
Add-Log $cross "upsun-cli" "upsun-cli is only available for 64-bit Windows"
} else {
$upsun_releases = "https://github.com/upsun/cli/releases"
if ($upsun_tag -eq 'latest') {
$upsun_tag = (Get-File -Url $upsun_releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1].replace('v', '')
}
$url = "$upsun_releases/download/v$upsun_tag/upsun_${upsun_tag}_windows_amd64.zip"
Get-File -Url $url -OutFile $bin_dir\upsun.zip > $null 2>&1
Expand-Archive -Path $bin_dir\upsun.zip -DestinationPath $bin_dir\upsun -Force > $null 2>&1
if (Test-Path $bin_dir\upsun\upsun.exe) {
Move-Item -Path $bin_dir\upsun\upsun.exe -Destination $bin_dir\upsun.exe -Force
Copy-Item -Path $bin_dir\upsun.exe -Destination $bin_dir\upsun-cli.exe > $null 2>&1
Add-ToProfile $current_profile 'upsun' "New-Alias upsun $bin_dir\upsun.exe"
Add-ToProfile $current_profile 'upsun_cli' "New-Alias upsun-cli $bin_dir\upsun-cli.exe"
$tool_version = Get-ToolVersion upsun "--version"
Add-Log $tick "upsun-cli" "Added upsun-cli $tool_version"
} else {
Add-Log $cross "upsun-cli" "Could not setup upsun-cli"
}
}
}
+49
View File
@@ -0,0 +1,49 @@
get_upsun_tag() {
local upsun_tag=$1
if [ "$upsun_tag" = "latest" ]; then
get -s -n "" https://github.com/upsun/cli/releases/latest 2<&1 | grep -m 1 -Eo "tag/v[0-9]+(\.[0-9]+)*" | head -n 1 | cut -d '/' -f 2
else
echo "v$upsun_tag"
fi
}
add_upsun_helper() {
local upsun_tag=$1
local install_dir=/usr/local/bin
local os
local arch
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
arch="$(uname -m)"
case "$arch" in
aarch64*|armv8*|arm64) arch="arm64" ;;
x86_64|amd64) arch="amd64" ;;
esac
if [ "$os" = "darwin" ]; then
arch="all"
install_dir=${brew_prefix:?}/bin
fi
get -q -n /tmp/upsun.tar.gz "https://github.com/upsun/cli/releases/download/$upsun_tag/upsun_${upsun_tag#v}_${os}_${arch}.tar.gz"
mkdir -p /tmp/upsun
tar -xzf /tmp/upsun.tar.gz -C /tmp/upsun
sudo mv /tmp/upsun/upsun "$install_dir"/upsun
sudo chmod a+x "$install_dir"/upsun
rm -rf /tmp/upsun /tmp/upsun.tar.gz
}
add_upsun() {
local upsun_tag="${1/v/}"
if ! [[ "$upsun_tag" =~ ^[0-9]+(\.[0-9]+)*$ || "$upsun_tag" == 'latest' ]]; then
add_log "${cross:?}" "upsun-cli" "Version '$upsun_tag' is not valid for upsun-cli"
else
upsun_tag="$(get_upsun_tag "$upsun_tag")"
add_upsun_helper "$upsun_tag" >/dev/null 2>&1
upsun_path="$(command -v upsun)"
if [[ -n "$upsun_path" ]]; then
sudo ln -s "$upsun_path" "${tool_path_dir:?}"/upsun-cli
tool_version=$(get_tool_version "upsun" "--version")
add_log "${tick:?}" "upsun-cli" "Added upsun-cli $tool_version"
else
add_log "${cross:?}" "upsun-cli" "Could not setup upsun-cli"
fi
fi
}
+19 -7
View File
@@ -5,8 +5,9 @@ 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 php_builder_versions="8.[3-9]" export php_builder_versions="8.[3-9]"
export nightly_versions="8.[6-9]" export nightly_versions="8.[7-9]"
export xdebug3_versions="7.[2-4]|8.[0-9]" export xdebug3_versions="7.[2-4]|8.[0-9]"
export no_asan_builds="5.[3-6]|7.[0-4]"
export latest="releases/latest/download" export latest="releases/latest/download"
export github="https://github.com/shivammathur" export github="https://github.com/shivammathur"
export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur" export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur"
@@ -65,10 +66,10 @@ check_builds_cache_runner() {
local pid=$PPID executable local pid=$PPID executable
while [[ "$pid" =~ ^[0-9]+$ && "$pid" -gt 1 ]]; do while [[ "$pid" =~ ^[0-9]+$ && "$pid" -gt 1 ]]; do
executable="$(readlink -f "/proc/$pid/exe")" || return 1 executable="$(readlink -f "/proc/$pid/exe")" || return 1
if [[ "$executable" = */bin/Runner.Worker ]]; then if [[ "$executable" = */bin/Runner.Worker || "$executable" = */bin/Runner.Worker.exe ]]; then
jq -e --arg name "${RUNNER_NAME:-}" \ jq -e --arg name "${RUNNER_NAME:-}" \
'.AgentName == $name and (.AgentName | test("^(blacksmith|depot)-"))' \ '(.AgentName // .agentName) | . == $name and test("^(blacksmith|depot|nsc-runner)-")' \
"${executable%/bin/Runner.Worker}/.runner" >/dev/null 2>&1 "${executable%/bin/*}/.runner" >/dev/null 2>&1
return $? return $?
fi fi
pid="$(awk '$1 == "PPid:" {print $2}' "/proc/$pid/status")" || return 1 pid="$(awk '$1 == "PPid:" {print $2}' "/proc/$pid/status")" || return 1
@@ -84,6 +85,7 @@ read_env() {
update="${update:-${UPDATE:-false}}" update="${update:-${UPDATE:-false}}"
[ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release [ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release
[[ "${phpts:-${PHPTS:-nts}}" = "ts" || "${phpts:-${PHPTS:-nts}}" = "zts" ]] && ts=zts && update=true || ts=nts [[ "${phpts:-${PHPTS:-nts}}" = "ts" || "${phpts:-${PHPTS:-nts}}" = "zts" ]] && ts=zts && update=true || ts=nts
[[ "${asan:-${ASAN:-false}}" = "true" ]] && asan=asan && update=true || asan=
fail_fast="${fail_fast:-${FAIL_FAST:-false}}" fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
use_builds_cache="${use_builds_cache:-${use_package_cache:-}}" use_builds_cache="${use_builds_cache:-${use_package_cache:-}}"
[[ ( -z "$ImageOS" && -z "$ImageVersion" ) || [[ ( -z "$ImageOS" && -z "$ImageVersion" ) ||
@@ -93,7 +95,7 @@ read_env() {
if [[ $_runner = "self-hosted" && "${use_builds_cache:-false}" = "true" ]]; then if [[ $_runner = "self-hosted" && "${use_builds_cache:-false}" = "true" ]]; then
runner=github runner=github
if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" && if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" &&
( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot)- ) ]] && check_builds_cache_runner; then ( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot|nsc-runner)- ) ]] && check_builds_cache_runner; then
_runner=github _runner=github
builds_cache_warning=true builds_cache_warning=true
fi fi
@@ -120,6 +122,7 @@ read_env() {
export runner export runner
export update export update
export ts export ts
export asan
export tool_path_dir export tool_path_dir
export tool_cache_path_dir export tool_cache_path_dir
} }
@@ -185,6 +188,7 @@ verify_checksum() {
# mode: -s pipe to stdout, -v save file and return status code # mode: -s pipe to stdout, -v save file and return status code
# execute: -e save file as executable # execute: -e save file as executable
get() { get() {
local download_status=1 status_code=000
mode=$1 mode=$1
execute=$2 execute=$2
file_path=$3 file_path=$3
@@ -204,12 +208,20 @@ get() {
trap 'release_lock "$lock_path"' EXIT SIGINT SIGTERM trap 'release_lock "$lock_path"' EXIT SIGINT SIGTERM
fi fi
for link in "${links[@]}"; do for link in "${links[@]}"; do
status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link") if status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link"); then
[ "$status_code" = "200" ] && break if [ "$status_code" = "200" ]; then
download_status=0
break
fi
else
status_code=000
fi
done done
[ "$download_status" -ne 0 ] && sudo rm -f "$file_path"
[[ "$execute" = "-e" && -e "$file_path" ]] && sudo chmod a+x "$file_path" [[ "$execute" = "-e" && -e "$file_path" ]] && sudo chmod a+x "$file_path"
[ "$mode" = "-v" ] && echo "$status_code" [ "$mode" = "-v" ] && echo "$status_code"
[ "$runner" = "self-hosted" ] && release_lock "$lock_path" [ "$runner" = "self-hosted" ] && release_lock "$lock_path"
return "$download_status"
fi fi
} }
+3 -3
View File
@@ -3,7 +3,7 @@ param (
[ValidateNotNull()] [ValidateNotNull()]
[ValidateLength(1, [int]::MaxValue)] [ValidateLength(1, [int]::MaxValue)]
[string] [string]
$version = '8.4', $version = '8.6',
[Parameter(Position = 1, Mandatory = $true)] [Parameter(Position = 1, Mandatory = $true)]
[ValidateNotNull()] [ValidateNotNull()]
[ValidateLength(1, [int]::MaxValue)] [ValidateLength(1, [int]::MaxValue)]
@@ -343,7 +343,7 @@ $php_manifest = $null
$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.[7-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')
@@ -439,7 +439,7 @@ if($version -eq 'pre') {
} }
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) { if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) { if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1 Install-PSPackage VcRedist VcRedist-4.1.527\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/v4.1.527.zip" Get-VcList >$null 2>&1
} }
try { try {
if ($version -match $nightly_versions) { if ($version -match $nightly_versions) {