mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-10-15 20:06:58 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20529878ed | ||
|
|
68634e7bca | ||
|
|
0ac4874a14 | ||
|
|
c9735bcc02 | ||
|
|
89b2566bb0 | ||
|
|
dcec1cf0b4 | ||
|
|
ccf2c627fe | ||
|
|
2a597f617d | ||
|
|
2282b6a082 | ||
|
|
11373c6dce | ||
|
|
50ad25710d | ||
|
|
c1c6c51867 | ||
|
|
34a5396826 | ||
|
|
a0d5abedf1 | ||
|
|
102ffdc294 | ||
|
|
97cf0581e3 | ||
|
|
bac87fed32 | ||
|
|
b9341130b4 | ||
|
|
e1dc734412 | ||
|
|
20169f80b7 | ||
|
|
ec1e2c6601 | ||
|
|
5581e61575 | ||
|
|
de4f59c442 | ||
|
|
26dc9b4fed | ||
|
|
8d11cf02d2 | ||
|
|
8aee7c58b7 | ||
|
|
725b40730f | ||
|
|
b8f4bf011c | ||
|
|
f9fbb516a6 | ||
|
|
987ba5bfe9 | ||
|
|
9dffd40113 | ||
|
|
2dfe351907 | ||
|
|
1897d72bb4 | ||
|
|
879090af77 | ||
|
|
a3845d84ae | ||
|
|
24d382d1f8 | ||
|
|
7a5da9d8dc | ||
|
|
011ab6e363 | ||
|
|
545bc26d45 | ||
|
|
55463ffe4f | ||
|
|
2a3befd7ab | ||
|
|
7cc4441283 | ||
|
|
4a4c5a48bb | ||
|
|
3514a658eb | ||
|
|
7aefaa0b54 | ||
|
|
048eb79ef3 | ||
|
|
29247235f0 | ||
|
|
e84efebd6e |
No files matched your search
@@ -8,6 +8,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
codeql:
|
||||
if: github.event.repository.fork == false
|
||||
permissions:
|
||||
actions: read # for github/codeql-action/init to get workflow details
|
||||
contents: read # for actions/checkout to fetch code
|
||||
|
||||
@@ -8,6 +8,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
create:
|
||||
if: github.event.repository.fork == false
|
||||
permissions:
|
||||
contents: none
|
||||
name: Create
|
||||
@@ -92,6 +93,7 @@ jobs:
|
||||
name: lists-php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
path: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||
update:
|
||||
if: github.event.repository.fork == false
|
||||
permissions:
|
||||
contents: write # for Git to git push
|
||||
name: Update
|
||||
|
||||
@@ -2,7 +2,7 @@ name: Node workflow
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- develop
|
||||
- verbose
|
||||
paths-ignore:
|
||||
@@ -10,7 +10,7 @@ on:
|
||||
- 'examples/**'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- develop
|
||||
- verbose
|
||||
paths-ignore:
|
||||
|
||||
@@ -3,7 +3,7 @@ on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- develop
|
||||
- verbose
|
||||
paths-ignore:
|
||||
@@ -11,7 +11,7 @@ on:
|
||||
- 'examples/**'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- develop
|
||||
- verbose
|
||||
paths-ignore:
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ node_modules/
|
||||
__tests__/runner/*
|
||||
lib/
|
||||
|
||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/main/Node.gitignore
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
@@ -229,7 +229,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.
|
||||
|
||||
[`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`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`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`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`]
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with tools
|
||||
@@ -258,19 +258,6 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
|
||||
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
|
||||
|
||||
With the exception of major versions of `composer`, if you specify only the `major` version or the version in `major.minor` format for a tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#composer-github-oauth "Composer GitHub OAuth").
|
||||
You can do that by setting `GITHUB_TOKEN` environment variable. The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with tools
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
tools: php-cs-fixer:3.64, phpunit:11.4
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
- The latest stable version of `composer` is set up by default. You can set up the required `composer` version by specifying the major version `v1` or `v2`, or the version in `major.minor` or `semver` format. Additionally, for composer `snapshot` and `preview` can also be specified to set up the respective releases.
|
||||
|
||||
```yaml
|
||||
@@ -278,7 +265,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
tools: composer:v2
|
||||
tools: composer:v1
|
||||
```
|
||||
|
||||
- If you do not use composer in your workflow, you can specify `tools: none` to skip it.
|
||||
@@ -430,7 +417,7 @@ Disable coverage for these reasons:
|
||||
- The `php-version-file` input if it exists
|
||||
- A `composer.lock` file and the `platform-overrides.php` value
|
||||
- A `composer.json` file and the `config.platform.php` value
|
||||
- If the `composer.lock` or `composer.json` file is in a sub-directory in your repository, please specify the subdirectory path in `COMPOSER_PROJECT_DIR` env.
|
||||
- If the `composer.lock` or `composer.json` file is in a subdirectory in your repository, please specify the subdirectory path in `COMPOSER_PROJECT_DIR` env.
|
||||
|
||||
#### `php-version-file` (optional)
|
||||
|
||||
@@ -438,7 +425,7 @@ Disable coverage for these reasons:
|
||||
- Accepts a `string`. For example `'.phpenv-version'`.
|
||||
- See [PHP support](#tada-php-support) for the supported PHP versions.
|
||||
- By default, `.php-version` file is used.
|
||||
- The file either have the PHP version as its content, or follow the asdf `.tool-versions` format.
|
||||
- The file needs to either have the PHP version as its content or follows the asdf `.tool-versions` format.
|
||||
- If not specified and the default `.php-version` file is not found, the latest stable PHP version is set up.
|
||||
|
||||
#### `extensions` (optional)
|
||||
@@ -473,6 +460,13 @@ Disable coverage for these reasons:
|
||||
- Accepts a `string` in csv-format. For example: `phpunit, phpcs`
|
||||
- See [tools support](#wrench-tools-support) for tools supported.
|
||||
|
||||
#### `github-token` (optional)
|
||||
|
||||
- Specify the GitHub token to use for authentication.
|
||||
- Accepts a `string`.
|
||||
- By default, `GITHUB_TOKEN` secret provided by GitHub Actions is used.
|
||||
- For GitHub Enterprise users, it is recommended to use a Personal Access Token (PAT).
|
||||
|
||||
### Outputs
|
||||
|
||||
#### `php-version`
|
||||
@@ -561,8 +555,6 @@ jobs:
|
||||
ini-values: post_max_size=256M, max_execution_time=180
|
||||
coverage: xdebug
|
||||
tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
### Nightly Build Setup
|
||||
@@ -804,19 +796,20 @@ restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
|
||||
|
||||
### GitHub Composer Authentication
|
||||
|
||||
If you have a number of workflows which set up multiple tools or have many composer dependencies, you might hit the GitHub's rate limit for composer. Also, if you specify only the major version or the version in `major.minor` format, you can hit the rate limit. To avoid this you can specify an `OAuth` token by setting `GITHUB_TOKEN` environment variable. You can use [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token "GITHUB_TOKEN documentation") secret for this purpose.
|
||||
|
||||
The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
|
||||
By default, setup-php uses the `GITHUB_TOKEN` secret that is generated for each workflow run. In case you want to use a Personal Access Token (PAT) instead, you can set the `github-token` input.
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
github-token: ${{ secrets.YOUR_PAT_TOKEN }}
|
||||
```
|
||||
|
||||
The `COMPOSER_TOKEN` and `GITHUB_TOKEN` environment variables have been deprecated in favor of the `github-token` input and will be removed in the next major version.
|
||||
|
||||
For GitHub Enterprise users, the `github-token` input does not default to the `GITHUB_TOKEN` secret. Therefore, it's recommended to set the `github-token` input to a Personal Access Token (PAT).
|
||||
|
||||
### Private Packagist Authentication
|
||||
|
||||
If you use Private Packagist for your private composer dependencies, you can set the `PACKAGIST_TOKEN` environment variable to authenticate.
|
||||
@@ -1015,19 +1008,26 @@ Many users and organisations support setup-php via [GitHub Sponsors](https://git
|
||||
These companies generously provide setup-php their products and services to aid in the development of this project.
|
||||
|
||||
<p>
|
||||
<a href="https://www.jetbrains.com/?from=setup-php">
|
||||
<img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="212" height="120">
|
||||
<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="80">
|
||||
</a>
|
||||
|
||||
<a href="https://www.macstadium.com/opensource/members#gh-light-mode-only">
|
||||
<img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="296" height="120">
|
||||
<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" height="80">
|
||||
</a>
|
||||
<a href="https://www.macstadium.com/opensource/members#gh-dark-mode-only">
|
||||
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="296" height="120">
|
||||
<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" height="80">
|
||||
</a>
|
||||
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-setup-php">
|
||||
<img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="140" height="120">
|
||||
<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" height="80">
|
||||
</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>
|
||||
|
||||
<a target="_blank" href="#">
|
||||
<img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="94" height="80">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -1056,6 +1056,7 @@ These companies generously provide setup-php their products and services to aid
|
||||
|
||||
|
||||
<!-- Links to tools -->
|
||||
[`backward-compatibility-check`]: https://github.com/Roave/BackwardCompatibilityCheck
|
||||
[`behat`]: https://docs.behat.org/en/latest/
|
||||
[`blackfire`]: https://blackfire.io/docs/php/index
|
||||
[`blackfire-player`]: https://blackfire.io/docs/builds-cookbooks/player
|
||||
@@ -1075,6 +1076,8 @@ These companies generously provide setup-php their products and services to aid
|
||||
[`flex`]: https://flex.symfony.com/
|
||||
[`grpc_php_plugin`]: https://grpc.io/
|
||||
[`infection`]: https://infection.github.io/
|
||||
[`mago`]: https://github.com/carthage-software/mago
|
||||
[`name-collision-detector`]: https://github.com/shipmonk/name-collision-detector
|
||||
[`parallel-lint`]: https://github.com/php-parallel-lint/PHP-Parallel-Lint
|
||||
[`pecl`]: https://pecl.php.net/
|
||||
[`phan`]: https://github.com/phan/phan/wiki
|
||||
|
||||
+10
-3
@@ -393,7 +393,7 @@ describe('Tools tests', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
'blackfire, blackfire-player, box, churn, cs2pr, flex, grpc_php_plugin, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, vapor, wp, pie',
|
||||
'blackfire, blackfire-player, box, churn, 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',
|
||||
[
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_blackfire',
|
||||
@@ -403,6 +403,8 @@ describe('Tools tests', () => {
|
||||
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr "-V"',
|
||||
'add_composer_tool flex flex symfony/ global',
|
||||
'add_grpc_php_plugin latest',
|
||||
'add_mago',
|
||||
'add_composer_tool name-collision-detector name-collision-detector shipmonk/ scoped',
|
||||
'add_tool https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/latest/download/parallel-lint.phar parallel-lint "--version"',
|
||||
'add_tool https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.2.1/php-cs-fixer.phar php-cs-fixer "-V"',
|
||||
'add_tool https://github.com/humbug/php-scoper/releases/latest/download/php-scoper.phar php-scoper "--version"',
|
||||
@@ -436,7 +438,7 @@ describe('Tools tests', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
'behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, vapor-cli, wp-cli, pie',
|
||||
'backward-compatibility-check, behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, 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',
|
||||
[
|
||||
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'add_composer_tool behat behat behat/ scoped',
|
||||
@@ -451,6 +453,8 @@ describe('Tools tests', () => {
|
||||
'add_composer_tool flex flex symfony/ global',
|
||||
'add_grpc_php_plugin 1.2.3',
|
||||
'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection "-V"',
|
||||
'add_mago 0.26.1',
|
||||
'add_composer_tool name-collision-detector name-collision-detector shipmonk/ scoped',
|
||||
'add_tool https://github.com/phan/phan/releases/latest/download/phan.phar phan "-v"',
|
||||
'add_tool https://github.com/phan/phan/releases/download/1.2.3/phan.phar phan "-v"',
|
||||
'add_tool https://www.phing.info/get/phing-1.2.3.phar,https://github.com/phingofficial/phing/releases/download/1.2.3/phing-1.2.3.phar phing "-v"',
|
||||
@@ -469,6 +473,7 @@ describe('Tools tests', () => {
|
||||
'add_protoc 1.2.3',
|
||||
'add_tool https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm "-v"',
|
||||
'add_composer_tool rector rector rector/ scoped',
|
||||
'add_composer_tool backward-compatibility-check backward-compatibility-check roave/ scoped',
|
||||
'add_symfony latest',
|
||||
'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"',
|
||||
@@ -485,7 +490,7 @@ describe('Tools tests', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, wp, 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, wp, pie',
|
||||
[
|
||||
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
|
||||
'Add-Blackfire',
|
||||
@@ -495,6 +500,8 @@ describe('Tools tests', () => {
|
||||
'Add-Tool https://deployer.org/deployer.phar deployer "-V"',
|
||||
'Tool does_not_exist is not supported',
|
||||
'Add-ComposerTool flex flex symfony/ global',
|
||||
'Add-Mago',
|
||||
'Add-ComposerTool name-collision-detector name-collision-detector shipmonk/ scoped',
|
||||
'Add-ComposerTool phinx phinx robmorgan/ scoped',
|
||||
'Add-Tool https://github.com/phar-io/phive/releases/download/0.15.3/phive-0.15.3.phar phive "status"',
|
||||
'php-config is not a windows tool',
|
||||
|
||||
@@ -27,6 +27,9 @@ inputs:
|
||||
tools:
|
||||
description: 'Setup popular tools globally.'
|
||||
required: false
|
||||
github-token:
|
||||
description: 'GitHub token to use for authentication.'
|
||||
default: ${{ github.token }}
|
||||
outputs:
|
||||
php-version:
|
||||
description: 'PHP version in semver format'
|
||||
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
(()=>{var A={6472:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(A){ownKeys=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t))e[e.length]=t;return e};return ownKeys(A)};return function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t=ownKeys(A),n=0;n<t.length;n++)if(t[n]!=="default")r(e,A,t[n]);s(e,A);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.addINIValuesUnix=addINIValuesUnix;e.addINIValuesWindows=addINIValuesWindows;e.addINIValues=addINIValues;const o=n(t(9277));async function addINIValuesUnix(A){const e=await o.CSVArray(A);let t="";await o.asyncForEach(e,(async function(A){t+="\n"+await o.addLog("$tick",A,"Added to php.ini","linux")}));return'echo "'+e.join("\n")+'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1'+t}async function addINIValuesWindows(A){const e=await o.CSVArray(A);let t="\n";await o.asyncForEach(e,(async function(A){t+=await o.addLog("$tick",A,"Added to php.ini","win32")+"\n"}));return'Add-Content "$php_dir\\php.ini" "'+e.join("\n")+'"'+t}async function addINIValues(A,e,t=false){let r="\n";switch(t){case true:r+=await o.stepLog("Add php.ini values",e)+await o.suppressOutput(e)+"\n";break;case false:default:r+=await o.stepLog("Add php.ini values",e)+"\n";break}switch(e){case"win32":return r+await addINIValuesWindows(A);case"darwin":case"linux":return r+await addINIValuesUnix(A);default:return await o.log("Platform "+e+" is not supported",e,"error")}}},9524:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(A){ownKeys=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t))e[e.length]=t;return e};return ownKeys(A)};return function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t=ownKeys(A),n=0;n<t.length;n++)if(t[n]!=="default")r(e,A,t[n]);s(e,A);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.checkXdebugError=checkXdebugError;e.addCoverageXdebug=addCoverageXdebug;e.addCoveragePCOV=addCoveragePCOV;e.disableCoverage=disableCoverage;e.addCoverage=addCoverage;const o=n(t(9277));const i=n(t(3252));const a=n(t(6472));async function checkXdebugError(A,e){if(/^5\.[3-6]$|^7\.[0-1]$/.test(e)&&A=="xdebug3"||/^8\.[0-9]$/.test(e)&&A=="xdebug2"){return A+" is not supported on PHP "+e}return""}async function addCoverageXdebug(A,e,t,r){let s="\n";const n=await checkXdebugError(A,e);if(!n){s+=await i.addExtension(":pcov:false",e,t,true)+r;A=A=="xdebug3"?"xdebug":A;s+=await i.addExtension(A,e,t,true)+r;s+=await o.setVariable("xdebug_version","php -r \"echo phpversion('xdebug');\"",t);s+=await o.getCommand(t,"extension_log")+'xdebug "Xdebug $xdebug_version enabled as coverage driver"'}else{s+=await o.addLog("$cross",A,n,t)}return s}async function addCoveragePCOV(A,e,t){let r="\n";switch(true){default:r+=await i.addExtension(":xdebug:false",A,e,true)+t;r+=await i.addExtension("pcov",A,e,true)+t;r+=await a.addINIValues("pcov.enabled=1",e,true)+"\n";r+=await o.setVariable("pcov_version","php -r \"echo phpversion('pcov');\"",e);r+=await o.getCommand(e,"extension_log")+'pcov "PCOV $pcov_version enabled as coverage driver"';break;case/5\.[3-6]|7\.0/.test(A):r+=await o.addLog("$cross","pcov","PHP 7.1 or newer is required",e);break}return r}async function disableCoverage(A,e,t){let r="\n";r+=await i.addExtension(":pcov:false",A,e,true)+t;r+=await i.addExtension(":xdebug:false",A,e,true)+t;r+=await o.addLog("$tick","none","Disabled Xdebug and PCOV",e);return r}async function addCoverage(A,e,t){A=A.toLowerCase();const r="\n"+await o.stepLog("Setup Coverage",t);const s=await o.suppressOutput(t)+"\n";switch(A){case"pcov":return r+await addCoveragePCOV(e,t,s);case"xdebug":case"xdebug2":case"xdebug3":return r+await addCoverageXdebug(A,e,t,s);case"none":return r+await disableCoverage(e,t,s);default:return""}}},3252:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r)Line truncated
|
||||
(()=>{var A={6472:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(A){ownKeys=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t))e[e.length]=t;return e};return ownKeys(A)};return function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t=ownKeys(A),n=0;n<t.length;n++)if(t[n]!=="default")r(e,A,t[n]);s(e,A);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.addINIValuesUnix=addINIValuesUnix;e.addINIValuesWindows=addINIValuesWindows;e.addINIValues=addINIValues;const o=n(t(9277));async function addINIValuesUnix(A){const e=await o.CSVArray(A);let t="";await o.asyncForEach(e,(async function(A){t+="\n"+await o.addLog("$tick",A,"Added to php.ini","linux")}));return'echo "'+e.join("\n")+'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1'+t}async function addINIValuesWindows(A){const e=await o.CSVArray(A);let t="\n";await o.asyncForEach(e,(async function(A){t+=await o.addLog("$tick",A,"Added to php.ini","win32")+"\n"}));return'Add-Content "$php_dir\\php.ini" "'+e.join("\n")+'"'+t}async function addINIValues(A,e,t=false){let r="\n";switch(t){case true:r+=await o.stepLog("Add php.ini values",e)+await o.suppressOutput(e)+"\n";break;case false:default:r+=await o.stepLog("Add php.ini values",e)+"\n";break}switch(e){case"win32":return r+await addINIValuesWindows(A);case"darwin":case"linux":return r+await addINIValuesUnix(A);default:return await o.log("Platform "+e+" is not supported",e,"error")}}},9524:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r){if(r===undefined)r=t;var s=Object.getOwnPropertyDescriptor(e,t);if(!s||("get"in s?!e.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return e[t]}}}Object.defineProperty(A,r,s)}:function(A,e,t,r){if(r===undefined)r=t;A[r]=e[t]});var s=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:true,value:e})}:function(A,e){A["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(A){ownKeys=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)if(Object.prototype.hasOwnProperty.call(A,t))e[e.length]=t;return e};return ownKeys(A)};return function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t=ownKeys(A),n=0;n<t.length;n++)if(t[n]!=="default")r(e,A,t[n]);s(e,A);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.checkXdebugError=checkXdebugError;e.addCoverageXdebug=addCoverageXdebug;e.addCoveragePCOV=addCoveragePCOV;e.disableCoverage=disableCoverage;e.addCoverage=addCoverage;const o=n(t(9277));const i=n(t(3252));const a=n(t(6472));async function checkXdebugError(A,e){if(/^5\.[3-6]$|^7\.[0-1]$/.test(e)&&A=="xdebug3"||/^8\.[0-9]$/.test(e)&&A=="xdebug2"){return A+" is not supported on PHP "+e}return""}async function addCoverageXdebug(A,e,t,r){let s="\n";const n=await checkXdebugError(A,e);if(!n){s+=await i.addExtension(":pcov:false",e,t,true)+r;A=A=="xdebug3"?"xdebug":A;s+=await i.addExtension(A,e,t,true)+r;s+=await o.setVariable("xdebug_version","php -r \"echo phpversion('xdebug');\"",t);s+=await o.getCommand(t,"extension_log")+'xdebug "Xdebug $xdebug_version enabled as coverage driver"'}else{s+=await o.addLog("$cross",A,n,t)}return s}async function addCoveragePCOV(A,e,t){let r="\n";switch(true){default:r+=await i.addExtension(":xdebug:false",A,e,true)+t;r+=await i.addExtension("pcov",A,e,true)+t;r+=await a.addINIValues("pcov.enabled=1",e,true)+"\n";r+=await o.setVariable("pcov_version","php -r \"echo phpversion('pcov');\"",e);r+=await o.getCommand(e,"extension_log")+'pcov "PCOV $pcov_version enabled as coverage driver"';break;case/5\.[3-6]|7\.0/.test(A):r+=await o.addLog("$cross","pcov","PHP 7.1 or newer is required",e);break}return r}async function disableCoverage(A,e,t){let r="\n";r+=await i.addExtension(":pcov:false",A,e,true)+t;r+=await i.addExtension(":xdebug:false",A,e,true)+t;r+=await o.addLog("$tick","none","Disabled Xdebug and PCOV",e);return r}async function addCoverage(A,e,t){A=A.toLowerCase();const r="\n"+await o.stepLog("Setup Coverage",t);const s=await o.suppressOutput(t)+"\n";switch(A){case"pcov":return r+await addCoveragePCOV(e,t,s);case"xdebug":case"xdebug2":case"xdebug3":return r+await addCoverageXdebug(A,e,t,s);case"none":return r+await disableCoverage(e,t,s);default:return""}}},3252:function(A,e,t){"use strict";var r=this&&this.__createBinding||(Object.create?function(A,e,t,r)Line truncated
|
||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=A=>A.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=A=>A.replace(/\r?\n|\r/g,"\r\n");const r=[];const s=new Uint8Array([13,10]);E=0;let n=false;for(const[e,o]of A){if(typeof o==="string"){const A=F.encode(t+`; name="${escape(normalizeLinefeeds(e))}"`+`\r\n\r\n${normalizeLinefeeds(o)}\r\n`);r.push(A);E+=A.byteLength}else{const A=F.encode(`${t}; name="${escape(normalizeLinefeeds(e))}"`+(o.name?`; filename="${escape(o.name)}"`:"")+"\r\n"+`Content-Type: ${o.type||"application/octet-stream"}\r\n\r\n`);r.push(A,o,s);if(typeof o.size==="number"){E+=A.byteLength+o.size+s.byteLength}else{n=true}}}const o=F.encode(`--${e}--`);r.push(o);E+=o.byteLength;if(n){E=null}g=A;c=async function*(){for(const A of r){if(A.stream){yield*A.stream()}else{yield A}}};Q="multipart/form-data; boundary="+e}else if(o(A)){g=A;E=A.size;if(A.type){Q=A.type}}else if(typeof A[Symbol.asyncIterator]==="function"){if(e){throw new TypeError("keepalive")}if(s.isDisturbed(A)||A.locked){throw new TypeError("Response body object should not be disturbed or locked")}r=A instanceof k?A:n(A)}if(typeof g==="string"||s.isBuffer(g)){E=Buffer.byteLength(g)}if(c!=null){let e;r=new k({async start(){e=c(A)[Symbol.asyncIterator]()},async pull(A){const{value:t,done:s}=await e.next();if(s){queueMicrotask((()=>{A.close()}))}else{if(!f(r)){A.enqueue(new Uint8Array(t))}}return A.desiredSize>0},async cancel(A){await e.return()},type:undefined})}const C={stream:r,source:g,length:E};return[C,Q]}function safelyExtractBody(A,e=false){if(!k){k=t(3774).ReadableStream}if(A instanceof k){d(!s.isDisturbed(A),"The body has already been consumed.");d(!A.locked,"The stream is locked.")}return extractBody(A,e)}function cloneBody(A){const[e,t]=A.stream.tee();const r=l(t,{transfer:[t]});const[,s]=r.tee();A.stream=e;return{stream:s,length:A.length,source:A.source}}async function*consumeBody(A){if(A){if(p(A)){yield A}else{const e=A.stream;if(s.isDisturbed(e)){throw new TypeError("The body has already been consumed.")}if(e.locked){throw new TypeError("The stream is locked.")}e[u]=true;yield*e}}}function throwIfAborted(A){if(A.aborted){throw new B("The operation was aborted.","AbortError")}}function bodyMixinMethods(A){const e={blob(){return specConsumeBody(this,(A=>{let e=bodyMimeType(this);if(e==="failure"){e=""}else if(e){e=D(e)}return new I([A],{type:e})}),A)},arrayBuffer(){return specConsumeBody(this,(A=>new Uint8Array(A).buffer),A)},text(){return specConsumeBody(this,utf8DecodeBytes,A)},json(){return specConsumeBody(this,parseJSONFromBytes,A)},async formData(){C.brandCheck(this,A);throwIfAborted(this[Q]);const e=this.headers.get("Content-Type");if(/multipart\/form-data/.test(e)){const A={};for(const[e,t]of this.headers)A[e.toLowerCase()]=t;const e=new E;let t;try{t=new r({headers:A,preservePath:true})}catch(A){throw new B(`${A}`,"AbortError")}t.on("field",((A,t)=>{e.append(A,t)}));t.on("file",((A,t,r,s,n)=>{const o=[];if(s==="base64"||s.toLowerCase()==="base64"){let s="";t.on("data",(A=>{s+=A.toString().replace(/[\r\n]/gm,"");const e=s.length-s.length%4;o.push(Buffer.from(s.slice(0,e),"base64"));s=s.slice(e)}));t.on("end",(()=>{o.push(Buffer.from(s,"base64"));e.append(A,new b(o,r,{type:n}))}))}else{t.on("data",(A=>{o.push(A)}));t.on("end",(()=>{e.append(A,new b(o,r,{type:n}))}))}}));const s=new Promise(((A,e)=>{t.on("finish",A);t.on("error",(A=>e(new TypeError(A))))}));if(this.body!==null)for await(const A of consumeBody(this[Q].body))t.write(A);t.end();await s;return e}else if(/application\/x-www-form-urlencoded/.test(e)){let A;try{let e="";const t=new TextDecoder("utf-8",{ignoreBOM:true});for await(const A of consumeBody(this[Q].body)){if(!p(A)){throw new TypeError("Expected Uint8Array chunk")}e+=t.decode(A,{stream:true})}e+=t.decode();A=new URLSearchParams(e)}catch(A){throw Object.assign(new TypeError,{cause:A})}const e=new E;for(const[t,r]of A){e.append(t,r)}return e}else{await Promise.resolve();throwIfAborted(this[Q]);throw C.errors.exception({header:`${A.name}.formData`,message:"Could not parse content as FormData."})}}};return e}function mixinBody(A){Object.assign(A.prototype,bodyMixinMethods(A))}async function specConsumeBody(A,e,t){C.brandCheck(A,t);throwIfAborted(A[Q]);if(bodyUnusable(A[Q].body)){throw new TypeError("Body is unusable")}const r=c();const errorSteps=A=>r.reject(A);const successSteps=A=>{try{r.resolve(e(A))}catch(A){errorSteps(A)}};if(A[Q].body==null){successSteps(new Uint8Array);return r.promise}await g(A[Q].body,successSteps,errorSteps);return r.promise}function bodyUnusable(A){return A!=null&&(A.stream.locked||s.isDisturbed(A.stream))}function utf8DecodeBytes(A){if(A.length===0){return""}if(A[0]===239&&A[1]===187&&A[2]===191){A=A.subarray(3)}const e=S.decode(A);return e}function parseJSONFromBytes(A){return JSON.parse(utf8DecodeBytes(A))}function bodyMimeType(A){const{headersList:e}=A[Q];const t=e.get("content-Line truncated
|
||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */n[s-4]=this.maskKey[0];n[s-3]=this.maskKey[1];n[s-2]=this.maskKey[2];n[s-1]=this.maskKey[3];n[1]=t;if(t===126){n.writeUInt16BE(e,2)}else if(t===127){n[2]=n[3]=0;n.writeUIntBE(e,4,6)}n[1]|=128;for(let A=0;A<e;A++){n[s+A]=this.frameData[A]^this.maskKey[A%4]}return n}}A.exports={WebsocketFrameSend:WebsocketFrameSend}},3171:(A,e,t)=>{"use strict";const{Writable:r}=t(2203);const s=t(1637);const{parserStates:n,opcodes:o,states:i,emptyBuffer:a}=t(5913);const{kReadyState:c,kSentClose:g,kResponse:E,kReceivedClose:Q}=t(2933);const{isValidStatusCode:C,failWebsocketConnection:B,websocketMessageReceived:l}=t(3574);const{WebsocketFrameSend:I}=t(1237);const h={};h.ping=s.channel("undici:websocket:ping");h.pong=s.channel("undici:websocket:pong");class ByteParser extends r{#o=[];#i=0;#a=n.INFO;#c={};#g=[];constructor(A){super();this.ws=A}_write(A,e,t){this.#o.push(A);this.#i+=A.length;this.run(t)}run(A){while(true){if(this.#a===n.INFO){if(this.#i<2){return A()}const e=this.consume(2);this.#c.fin=(e[0]&128)!==0;this.#c.opcode=e[0]&15;this.#c.originalOpcode??=this.#c.opcode;this.#c.fragmented=!this.#c.fin&&this.#c.opcode!==o.CONTINUATION;if(this.#c.fragmented&&this.#c.opcode!==o.BINARY&&this.#c.opcode!==o.TEXT){B(this.ws,"Invalid frame type was fragmented.");return}const t=e[1]&127;if(t<=125){this.#c.payloadLength=t;this.#a=n.READ_DATA}else if(t===126){this.#a=n.PAYLOADLENGTH_16}else if(t===127){this.#a=n.PAYLOADLENGTH_64}if(this.#c.fragmented&&t>125){B(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#c.opcode===o.PING||this.#c.opcode===o.PONG||this.#c.opcode===o.CLOSE)&&t>125){B(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#c.opcode===o.CLOSE){if(t===1){B(this.ws,"Received close frame with a 1-byte body.");return}const A=this.consume(t);this.#c.closeInfo=this.parseCloseBody(false,A);if(!this.ws[g]){const A=Buffer.allocUnsafe(2);A.writeUInt16BE(this.#c.closeInfo.code,0);const e=new I(A);this.ws[E].socket.write(e.createFrame(o.CLOSE),(A=>{if(!A){this.ws[g]=true}}))}this.ws[c]=i.CLOSING;this.ws[Q]=true;this.end();return}else if(this.#c.opcode===o.PING){const e=this.consume(t);if(!this.ws[Q]){const A=new I(e);this.ws[E].socket.write(A.createFrame(o.PONG));if(h.ping.hasSubscribers){h.ping.publish({payload:e})}}this.#a=n.INFO;if(this.#i>0){continue}else{A();return}}else if(this.#c.opcode===o.PONG){const e=this.consume(t);if(h.pong.hasSubscribers){h.pong.publish({payload:e})}if(this.#i>0){continue}else{A();return}}}else if(this.#a===n.PAYLOADLENGTH_16){if(this.#i<2){return A()}const e=this.consume(2);this.#c.payloadLength=e.readUInt16BE(0);this.#a=n.READ_DATA}else if(this.#a===n.PAYLOADLENGTH_64){if(this.#i<8){return A()}const e=this.consume(8);const t=e.readUInt32BE(0);if(t>2**31-1){B(this.ws,"Received payload length > 2^31 bytes.");return}const r=e.readUInt32BE(4);this.#c.payloadLength=(t<<8)+r;this.#a=n.READ_DATA}else if(this.#a===n.READ_DATA){if(this.#i<this.#c.payloadLength){return A()}else if(this.#i>=this.#c.payloadLength){const A=this.consume(this.#c.payloadLength);this.#g.push(A);if(!this.#c.fragmented||this.#c.fin&&this.#c.opcode===o.CONTINUATION){const A=Buffer.concat(this.#g);l(this.ws,this.#c.originalOpcode,A);this.#c={};this.#g.length=0}this.#a=n.INFO}}if(this.#i>0){continue}else{A();break}}}consume(A){if(A>this.#i){return null}else if(A===0){return a}if(this.#o[0].length===A){this.#i-=this.#o[0].length;return this.#o.shift()}const e=Buffer.allocUnsafe(A);let t=0;while(t!==A){const r=this.#o[0];const{length:s}=r;if(s+t===A){e.set(this.#o.shift(),t);break}else if(s+t>A){e.set(r.subarray(0,A-t),t);this.#o[0]=r.subarray(A-t);break}else{e.set(this.#o.shift(),t);t+=r.length}}this.#i-=A;return e}parseCloseBody(A,e){let t;if(e.length>=2){t=e.readUInt16BE(0)}if(A){if(!C(t)){return null}return{code:t}}let r=e.subarray(2);if(r[0]===239&&r[1]===187&&r[2]===191){r=r.subarray(3)}if(t!==undefined&&!C(t)){return null}try{r=new TextDecoder("utf-8",{fatal:true}).decode(r)}catch{return null}return{code:t,reason:r}}get closingInfo(){return this.#c.closeInfo}}A.exports={ByteParser:ByteParser}},2933:A=>{"use strict";A.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}},3574:(A,e,t)=>{"use strict";const{kReadyState:r,kController:s,kResponse:n,kBinaryType:o,kWebSocketURL:i}=t(2933);const{states:a,opcodes:c}=t(5913);const{MessageEvent:g,ErrorEvent:E}=t(6255);function isEstablished(A){return A[r]===a.OPEN}function isClosing(A){return A[r]===a.CLOSING}function isClosed(A){return A[r]===a.CLOSED}function fireEvent(A,e,t=Event,r){const s=new t(A,r);e.dispatchEvent(s)}function websocketMessageReceived(A,e,t){if(A[r]!==a.OPEN){return}let s;if(e===c.TEXT){try{s=new TextDecoder("utf-8",{fatal:true}).decode(t)Line truncated
|
||||
Generated
+1408
-3914
File diff suppressed because it is too large.
Load diff
+23
-20
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-php",
|
||||
"version": "2.34.1",
|
||||
"version": "2.35.3",
|
||||
"private": false,
|
||||
"description": "Setup PHP for use with GitHub Actions",
|
||||
"main": "lib/install.js",
|
||||
@@ -40,26 +40,29 @@
|
||||
"compare-versions": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.3.0",
|
||||
"@eslint/js": "9.28.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^24.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.34.0",
|
||||
"@typescript-eslint/parser": "^8.34.0",
|
||||
"@eslint/compat": "^1.3.2",
|
||||
"@eslint/js": "9.33.0",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^24.2.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
||||
"@typescript-eslint/parser": "^8.39.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"eslint": "9.28.0",
|
||||
"eslint-config-prettier": "^10.1.5",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-jest": "^28.13.3",
|
||||
"eslint-plugin-prettier": "^5.4.1",
|
||||
"globals": "^16.2.0",
|
||||
"jest": "^30.0.0",
|
||||
"jest-circus": "^30.0.0",
|
||||
"nock": "^14.0.5",
|
||||
"prettier": "^3.5.3",
|
||||
"simple-git-hooks": "^2.13.0",
|
||||
"ts-jest": "^29.4.0",
|
||||
"typescript": "^5.8.3"
|
||||
"eslint": "9.33.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jest": "^29.0.1",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"globals": "^16.3.0",
|
||||
"jest": "^30.0.5",
|
||||
"jest-circus": "^30.0.5",
|
||||
"nock": "^14.0.9",
|
||||
"prettier": "^3.6.2",
|
||||
"simple-git-hooks": "^2.13.1",
|
||||
"ts-jest": "^29.4.1",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"overrides": {
|
||||
"test-exclude": "^7.0.1"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||
|
||||
+22
-6
@@ -1,4 +1,9 @@
|
||||
{
|
||||
"backward-compatibility-check": {
|
||||
"type": "composer",
|
||||
"repository": "roave/backward-compatibility-check",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"box": {
|
||||
"type": "phar",
|
||||
"repository": "box-project/box",
|
||||
@@ -45,6 +50,12 @@
|
||||
"version_prefix": "",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"easy-coding-standard": {
|
||||
"type": "composer",
|
||||
"alias": "ecs",
|
||||
"repository": "symplify/easy-coding-standard",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"infection": {
|
||||
"type": "phar",
|
||||
"repository": "infection/infection",
|
||||
@@ -53,6 +64,11 @@
|
||||
"version_prefix": "",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"name-collision-detector": {
|
||||
"type": "composer",
|
||||
"repository": "shipmonk/name-collision-detector",
|
||||
"scope": "scoped"
|
||||
},
|
||||
"phan": {
|
||||
"type": "phar",
|
||||
"repository": "phan/phan",
|
||||
@@ -233,6 +249,12 @@
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": "v"
|
||||
},
|
||||
"mago": {
|
||||
"type": "custom-package",
|
||||
"repository": "carthage-software/mago",
|
||||
"domain": "https://github.com",
|
||||
"version_prefix": ""
|
||||
},
|
||||
"protoc": {
|
||||
"type": "custom-package",
|
||||
"repository": "protocolbuffers/protobuf",
|
||||
@@ -331,11 +353,5 @@
|
||||
"extension": ".phar",
|
||||
"version_parameter": "--version",
|
||||
"version_prefix": "v"
|
||||
},
|
||||
"easy-coding-standard": {
|
||||
"type": "composer",
|
||||
"alias": "ecs",
|
||||
"repository": "symplify/easy-coding-standard",
|
||||
"scope": "scoped"
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -18,7 +18,6 @@ export async function getScript(os: string): Promise<string> {
|
||||
const filename = os + (await utils.scriptExtension(os));
|
||||
const script_path = path.join(__dirname, '../src/scripts', filename);
|
||||
const run_path = script_path.replace(os, 'run');
|
||||
process.env['fail_fast'] = await utils.getInput('fail-fast', false);
|
||||
const extension_csv: string = await utils.getInput('extensions', false);
|
||||
const ini_values_csv: string = await utils.getInput('ini-values', false);
|
||||
const coverage_driver: string = await utils.getInput('coverage', false);
|
||||
@@ -48,6 +47,14 @@ export async function getScript(os: string): Promise<string> {
|
||||
return run_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to set environment variables based on inputs.
|
||||
*/
|
||||
export async function setEnv(): Promise<void> {
|
||||
process.env['fail_fast'] = await utils.getInput('fail-fast', false);
|
||||
process.env['GITHUB_TOKEN'] ??= await utils.getInput('github-token', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the script
|
||||
*/
|
||||
@@ -55,6 +62,7 @@ export async function run(): Promise<void> {
|
||||
const os: string = process.platform;
|
||||
const tool = await utils.scriptTool(os);
|
||||
const run_path = await getScript(os);
|
||||
await setEnv();
|
||||
await exec(tool + run_path);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ add_pecl_extension() {
|
||||
add_log "${tick:?}" "$extension" "Enabled"
|
||||
else
|
||||
[ -n "$pecl_version" ] && pecl_version="-$pecl_version"
|
||||
pecl_install "$extension$pecl_version" || add_extension "$extension" "$(get_extension_prefix "$extension")" >/dev/null 2>&1
|
||||
pecl_install "$extension$pecl_version" || ( [ "${fail_fast:?}" = "false" ] && add_extension "$extension" "$(get_extension_prefix "$extension")" >/dev/null 2>&1)
|
||||
extension_version="$(php -r "echo phpversion('$extension');")"
|
||||
[ -n "$extension_version" ] && extension_version="-$extension_version"
|
||||
add_extension_log "$extension$extension_version" "Installed and enabled"
|
||||
|
||||
@@ -7,15 +7,6 @@ add_license_log() {
|
||||
echo "$END_GROUP"
|
||||
}
|
||||
|
||||
# Function to setup gcc-7 and g++-7
|
||||
setup_compiler() {
|
||||
if ! command -v gcc-7 >/dev/null || ! command -v g++-7 >/dev/null; then
|
||||
add_ppa ubuntu-toolchain-r/test
|
||||
add_packages gcc-7 g++-7 -y
|
||||
fi
|
||||
printf "gcc g++" | xargs -d ' ' -I {} sudo update-alternatives --install /usr/bin/{} {} /usr/bin/{}-7 7
|
||||
}
|
||||
|
||||
# Function to set cubrid repo for the extension.
|
||||
set_cubrid_repo() {
|
||||
case "${ext:?}" in
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Helper function to add gearman extension.
|
||||
add_gearman_helper() {
|
||||
add_ppa ondrej/pkg-gearman
|
||||
install_packages libgearman-dev
|
||||
enable_extension gearman extension
|
||||
if ! check_extension gearman; then
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
patch_geos() {
|
||||
if [ "$(php -r "echo PHP_VERSION_ID;")" -ge 70000 ]; 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
|
||||
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/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
|
||||
|
||||
@@ -49,7 +49,7 @@ change_library_paths() {
|
||||
}
|
||||
|
||||
# Add hiredis library
|
||||
add_hiredis() {
|
||||
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
|
||||
@@ -69,8 +69,12 @@ add_relay_dependencies() {
|
||||
if [ "$os" = "Darwin" ]; then
|
||||
. "${0%/*}"/tools/brew.sh
|
||||
configure_brew
|
||||
brew install lz4 zstd concurrencykit
|
||||
add_hiredis
|
||||
if [ "$relay_version" = "v0.7.0" ]; then
|
||||
brew install lz4 zstd concurrencykit
|
||||
add_hiredis_1.1.0 >/dev/null 2>&1
|
||||
else
|
||||
brew install lz4 hiredis zstd concurrencykit
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,52 @@ Function Edit-ComposerConfig() {
|
||||
Set-ComposerAuth
|
||||
}
|
||||
|
||||
# Function to update auth.json.
|
||||
Function Update-AuthJson {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)][string[]] $ComposerAuth
|
||||
)
|
||||
if (Test-Path $composer_home\auth.json) {
|
||||
try {
|
||||
$existing = Get-Content $composer_home\auth.json -Raw | ConvertFrom-Json
|
||||
} catch {
|
||||
$existing = [PSCustomObject]@{}
|
||||
}
|
||||
} else {
|
||||
$existing = [PSCustomObject]@{}
|
||||
}
|
||||
foreach ($fragment in $ComposerAuth) {
|
||||
$piece = ('{' + $fragment + '}') | ConvertFrom-Json
|
||||
foreach ($prop in $piece.PSObject.Properties) {
|
||||
if ($prop.Name -eq 'http-basic') {
|
||||
if (-not $existing.'http-basic') {
|
||||
$existing | Add-Member -MemberType NoteProperty -Name 'http-basic' -Value ([PSCustomObject]@{}) -Force
|
||||
}
|
||||
foreach ($domainProp in $prop.Value.PSObject.Properties) {
|
||||
$existing.'http-basic' | Add-Member -MemberType NoteProperty -Name $domainProp.Name -Value $domainProp.Value -Force
|
||||
}
|
||||
} else {
|
||||
$existing | Add-Member -MemberType NoteProperty -Name $prop.Name -Value $prop.Value -Force
|
||||
}
|
||||
}
|
||||
}
|
||||
Set-Content -Path $composer_home\auth.json -Value ($existing | ConvertTo-Json -Depth 5)
|
||||
}
|
||||
|
||||
function Test-GitHubPublicAccess {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Token
|
||||
)
|
||||
try {
|
||||
Invoke-RestMethod -Uri 'https://api.github.com/' -Headers @{ Authorization = "token $Token" } -ErrorAction Stop | Out-Null
|
||||
return $true
|
||||
} catch {
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
# Function to setup authentication in composer.
|
||||
Function Set-ComposerAuth() {
|
||||
if(Test-Path env:COMPOSER_AUTH_JSON) {
|
||||
@@ -41,14 +87,18 @@ Function Set-ComposerAuth() {
|
||||
if(Test-Path env:PACKAGIST_TOKEN) {
|
||||
$composer_auth += '"http-basic": {"repo.packagist.com": { "username": "token", "password": "' + $env:PACKAGIST_TOKEN + '"}}'
|
||||
}
|
||||
if(-not(Test-Path env:GITHUB_TOKEN) -and (Test-Path env:COMPOSER_TOKEN)) {
|
||||
$env:GITHUB_TOKEN = $env:COMPOSER_TOKEN
|
||||
}
|
||||
if (Test-Path env:GITHUB_TOKEN) {
|
||||
$composer_auth += '"github-oauth": {"github.com": "' + $env:GITHUB_TOKEN + '"}'
|
||||
$write_token = $true
|
||||
$token = if ($env:COMPOSER_TOKEN) { $env:COMPOSER_TOKEN } else { $env:GITHUB_TOKEN }
|
||||
if ($token) {
|
||||
if ($env:GITHUB_SERVER_URL -ne "https://github.com" -and -not(Test-GitHubPublicAccess $token)) {
|
||||
$write_token = $false
|
||||
}
|
||||
if($write_token) {
|
||||
$composer_auth += '"github-oauth": {"github.com": "' + $token + '"}'
|
||||
}
|
||||
}
|
||||
if($composer_auth.length) {
|
||||
Add-Env COMPOSER_AUTH ('{' + ($composer_auth -join ',') + '}')
|
||||
Update-AuthJson $composer_auth
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ get_tool_version() {
|
||||
alp="[a-zA-Z0-9\.]"
|
||||
version_regex="[0-9]+((\.{1}$alp+)+)(\.{0})(-$alp+){0,1}"
|
||||
if [ "$tool" = "composer" ]; then
|
||||
composer_alias_version="$(grep -Ea "const\sBRANCH_ALIAS_VERSION" "$tool_path_dir/composer" | grep -Eo "$version_regex")"
|
||||
composer_alias_version="$(grep -Ea "const\sBRANCH_ALIAS_VERSION" "${tool_path_dir:?}/composer" | grep -Eo "$version_regex")"
|
||||
if [[ -n "$composer_alias_version" ]]; then
|
||||
composer_version="$composer_alias_version+$(grep -Ea "const\sVERSION" "$tool_path_dir/composer" | grep -Eo "$alp+" | tail -n 1)"
|
||||
else
|
||||
@@ -46,6 +46,30 @@ configure_composer() {
|
||||
set_composer_auth
|
||||
}
|
||||
|
||||
# Function to merge auth.json fragments.
|
||||
update_auth_json() {
|
||||
local auth_file="$composer_home/auth.json"
|
||||
local merged
|
||||
[[ -f "$auth_file" ]] && merged=$(<"$auth_file") || merged='{}'
|
||||
for frag in "$@"; do
|
||||
local obj="{$frag}"
|
||||
merged=$(jq -n --argjson b "$merged" --argjson n "$obj" '
|
||||
if $n|has("http-basic") then
|
||||
(($b["http-basic"]//{}) + $n["http-basic"]) as $hb
|
||||
| ($b + $n) | .["http-basic"] = $hb
|
||||
else
|
||||
$b + $n
|
||||
end
|
||||
')
|
||||
done
|
||||
printf '%s' "$merged" > "$composer_home/auth.json"
|
||||
}
|
||||
|
||||
# Function to check if public GitHub token authentication is possible.
|
||||
can_access_public_github() {
|
||||
curl --fail -s -H "Authorization: token $1" 'https://api.github.com/' >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Function to setup authentication in composer.
|
||||
set_composer_auth() {
|
||||
if [ -n "$COMPOSER_AUTH_JSON" ]; then
|
||||
@@ -59,11 +83,18 @@ set_composer_auth() {
|
||||
if [ -n "$PACKAGIST_TOKEN" ]; then
|
||||
composer_auth+=( '"http-basic": {"repo.packagist.com": { "username": "token", "password": "'"$PACKAGIST_TOKEN"'"}}' )
|
||||
fi
|
||||
if [ -n "${GITHUB_TOKEN:-$COMPOSER_TOKEN}" ]; then
|
||||
composer_auth+=( '"github-oauth": {"github.com": "'"${GITHUB_TOKEN:-$COMPOSER_TOKEN}"'"}' )
|
||||
token="${COMPOSER_TOKEN:-$GITHUB_TOKEN}"
|
||||
if [ -n "$token" ]; then
|
||||
write_token=true
|
||||
if [ "$GITHUB_SERVER_URL" != "https://github.com" ]; then
|
||||
can_access_public_github "$token" || write_token=false
|
||||
fi
|
||||
if [ "$write_token" = 'true' ]; then
|
||||
composer_auth+=( '"github-oauth": {"github.com": "'"$token"'"}' )
|
||||
fi
|
||||
fi
|
||||
if ((${#composer_auth[@]})); then
|
||||
add_env COMPOSER_AUTH "{$(IFS=$','; echo "${composer_auth[*]}")}"
|
||||
update_auth_json "${composer_auth[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
Function Get-MagoTag() {
|
||||
$releases = 'https://github.com/carthage-software/mago/releases'
|
||||
if("$mago_tag" -eq "latest") {
|
||||
$mago_tag = (Get-File -Url $releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1]
|
||||
} else {
|
||||
try {
|
||||
[net.httpWebRequest] $request = [net.webRequest]::create("$releases/tag/$mago_tag")
|
||||
$request.Method = "HEAD"
|
||||
[net.httpWebResponse] $response = $request.getResponse()
|
||||
$response.Close()
|
||||
$mago_tag = "$mago_tag"
|
||||
} catch {
|
||||
$mago_tag = (Get-File -Url $releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1]
|
||||
}
|
||||
}
|
||||
return $mago_tag
|
||||
}
|
||||
|
||||
Function Add-Mago() {
|
||||
param(
|
||||
[Parameter(Mandatory = $true, Position = 0, HelpMessage = 'The mago version to be installed')]
|
||||
[ValidatePattern('^latest$|^\d+\.\d+\.\d+$')]
|
||||
[string] $mago_tag
|
||||
)
|
||||
$mago_tag = Get-MagoTag
|
||||
$arch_name = 'x86_64'
|
||||
if(-not([Environment]::Is64BitOperatingSystem)) {
|
||||
$arch_name = 'i686'
|
||||
}
|
||||
$url = "https://github.com/carthage-software/mago/releases/download/$mago_tag/mago-$mago_tag-$arch_name-pc-windows-msvc.zip"
|
||||
Get-File -Url $url -OutFile $bin_dir\mago.zip >$null 2>&1
|
||||
Expand-Archive -Path $bin_dir\mago.zip -DestinationPath $bin_dir\mago -Force >$null 2>&1
|
||||
Move-Item -Path $bin_dir\mago\mago-$mago_tag-$arch_name-pc-windows-msvc\mago.exe -Destination $bin_dir\mago.exe -Force
|
||||
Add-ToProfile $current_profile 'mago' "New-Alias mago $bin_dir\mago.exe"
|
||||
Add-Log $tick "mago" "Added mago $mago_tag"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
get_mago_tag() {
|
||||
if [ "$mago_tag" = "latest" ]; then
|
||||
mago_tag=$(get -s -n "" https://github.com/carthage-software/mago/releases/latest 2<&1 | grep -m 1 -Eo "tag/([0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2)
|
||||
else
|
||||
status_code=$(get -v -n /tmp/mago.tmp "https://github.com/carthage-software/mago/releases/tag/$mago_tag")
|
||||
if [ "$status_code" = "200" ]; then
|
||||
mago_tag="$mago_tag"
|
||||
else
|
||||
mago_tag=$(get -s -n "" https://github.com/carthage-software/mago/releases/latest 2<&1 | grep -m 1 -Eo "tag/([0-9]+(\.[0-9]+)?(\.[0-9]+)?)" | head -n 1 | cut -d '/' -f 2)
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
add_mago() {
|
||||
mago_tag=$1
|
||||
get_mago_tag
|
||||
(
|
||||
platform='unknown-linux-gnu'
|
||||
[ "$(uname -s)" = "Darwin" ] && platform='apple-darwin'
|
||||
arch="$(uname -m)"
|
||||
[[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch='aarch64'
|
||||
[[ "$arch" = 'x86_64' || "$arch" = 'amd64' ]] && arch='x86_64'
|
||||
get -q -n /tmp/mago.tar.gz "https://github.com/carthage-software/mago/releases/download/$mago_tag/mago-$mago_tag-$arch-$platform.tar.gz"
|
||||
sudo tar -xzf /tmp/mago.tar.gz -C /tmp/
|
||||
sudo mv /tmp/mago-$mago_tag-$arch-$platform/mago /usr/local/bin/mago
|
||||
sudo chmod +x /usr/local/bin/mago
|
||||
) >/dev/null 2>&1
|
||||
add_log "${tick:?}" "mago" "Added mago $mago_tag"
|
||||
}
|
||||
@@ -164,7 +164,7 @@ remove_list() {
|
||||
# Function to check if ubuntu ppa is up
|
||||
is_ubuntu_ppa_up() {
|
||||
ppa=${1:-ondrej/php}
|
||||
curl -s --connect-timeout 5 --max-time 5 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
|
||||
curl -s --connect-timeout 10 --max-time 10 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
|
||||
}
|
||||
|
||||
# Function to add the PPA mirror.
|
||||
@@ -172,8 +172,8 @@ add_ppa_sp_mirror() {
|
||||
ppa=$1
|
||||
ppa_name="$(basename "$ppa")"
|
||||
remove_list "$ppa" || true
|
||||
[ "${debug:?}" = "debug" ] && add_list sp/"$ppa_name" "$sp/$ppa/ubuntu" "$sp/$ppa/ubuntu/key.gpg" "$VERSION_CODENAME" "main/debug"
|
||||
add_list sp/"$ppa_name" "$sp/$ppa/ubuntu" "$sp/$ppa/ubuntu/key.gpg"
|
||||
[ "${debug:?}" = "debug" ] && add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg" "$VERSION_CODENAME" "main/debug"
|
||||
add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg"
|
||||
}
|
||||
|
||||
# Function to add a PPA.
|
||||
@@ -182,11 +182,13 @@ add_ppa() {
|
||||
ppa=${1:-ondrej/php}
|
||||
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||
if is_ubuntu_ppa_up "$ppa" ; then
|
||||
[ "${runner:?}" = "self-hosted" ] && find "$list_dir" -type f -name 'sp*' -exec grep -qF "$sp" {} \; -delete
|
||||
[ "${runner:?}" = "self-hosted" ] && find "$list_dir" -type f -name 'sp*' -exec grep -qF "${sp/https:\/\/}" {} \; -delete
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lpc_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||
add_list "$ppa"
|
||||
else
|
||||
elif [ "$ppa" = "ondrej/php" ]; then
|
||||
add_ppa_sp_mirror "$ppa"
|
||||
else
|
||||
add_log "${cross:?}" "$ppa" "PPA $ppa is not available"
|
||||
fi
|
||||
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug"
|
||||
@@ -225,6 +227,7 @@ lpc_ppa='https://ppa.launchpadcontent.net'
|
||||
key_dir='/usr/share/keyrings'
|
||||
dist_info_dir='/usr/share/distro-info'
|
||||
sury='https://packages.sury.org'
|
||||
ppa_sp='https://ppa.setup-php.com'
|
||||
sp='https://setup-php.com'
|
||||
sks=(
|
||||
'https://keyserver.ubuntu.com'
|
||||
|
||||
@@ -447,7 +447,7 @@ if($version -lt "5.5") {
|
||||
} else {
|
||||
$enable_extensions += ('opcache')
|
||||
}
|
||||
Enable-PhpExtension -Extension $enable_extensions -Path $php_dir
|
||||
Enable-PhpExtension -Extension ($enable_extensions | Where-Object { Test-Path $ext_dir\php_$_.dll }) -Path $php_dir
|
||||
Add-PhpCAInfo
|
||||
Add-OpenSSLConf
|
||||
Copy-Item -Path $src\configs\pm\*.json -Destination $env:RUNNER_TOOL_CACHE
|
||||
|
||||
Reference in new issue
Block a user