Compare commits

..

12 Commits

Author SHA1 Message Date
00242b5fc2 Fix symfony-cli config [skip ci] 2025-10-15 09:17:20 +05:30
319ac00da8 Improve symfony-cli support
Fingers crossed symfony-cli keeps the artifact format in their releases
2025-10-15 08:46:18 +05:30
38e8065d61 Merge pull request #1008 from shyim/fix/flaky-symfony-cli-install
fix: directly download linux archive from symfony-cli releases
2025-10-15 07:52:14 +05:30
91a018aa46 Update SECURITY.md [skip ci] 2025-10-15 07:50:28 +05:30
bdaf698d5d Merge pull request #1009 from shivammathur/dependabot/github_actions/develop/github/codeql-action-4
Bump github/codeql-action from 3 to 4
2025-10-13 22:43:48 +00:00
ab68d9f583 Bump github/codeql-action from 3 to 4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [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/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 10:36:25 +00:00
d65cf8f3f2 Update sponsors [skip ci] 2025-10-12 12:49:03 +05:30
6beaa7dc34 Update actions in examples 2025-10-12 11:05:16 +05:30
79ab6fe269 ci: use direct link instead of api call 2025-10-07 11:02:25 +02:00
4cbbb6d82c fix: directly download linux archive from symfony-cli releases 2025-10-07 09:50:11 +02:00
4cba65b8c5 Improve workflows 2025-09-25 22:11:11 +05:30
7fea117d1c Add support for PHP 8.6.0-dev 2025-09-25 20:38:18 +05:30
32 changed files with 152 additions and 127 deletions

11
.github/SECURITY.md vendored
View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
<a href="https://github.com/shivammathur/setup-php" title="GitHub action to setup PHP"><img alt="GitHub Actions status" src="https://github.com/shivammathur/setup-php/workflows/Main%20workflow/badge.svg"></a>
<a href="https://codecov.io/gh/shivammathur/setup-php" title="Code coverage"><img alt="Codecov Code Coverage" src="https://img.shields.io/codecov/c/github/shivammathur/setup-php?logo=codecov"></a>
<a href="https://github.com/shivammathur/setup-php/blob/main/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.5-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.6-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
</p>
<p align="center">
<a href="https://reddit.com/r/setup_php" title="setup-php reddit"><img alt="setup-php reddit" src="https://img.shields.io/badge/reddit-join-FF5700?logo=reddit&logoColor=FF5700&labelColor=555555"></a>
@ -69,7 +69,7 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
### GitHub-Hosted Runners
| Virtual environment | Arch | YAML workflow label | Pre-installed PHP |
|---------------------|---------|------------------------------------|------------------------|
|---------------------|---------|------------------------------------|-------------------|
| Ubuntu 24.04 | x86_64 | `ubuntu-latest` or `ubuntu-24.04` | `PHP 8.3` |
| Ubuntu 22.04 | x86_64 | `ubuntu-22.04` | `PHP 8.1` |
| Ubuntu 24.04 | aarch64 | `ubuntu-24.04-arm` | `PHP 8.3` |
@ -80,6 +80,7 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
| macOS Tahoe 26.x | arm64 | `macos-26` | - |
| macOS Sequoia 15.x | arm64 | `macos-latest` or `macos-15` | - |
| macOS Sonoma 14.x | arm64 | `macos-14` | - |
| macOS Sequoia 15.x | x86_64 | `macos-15-intel` | `PHP 8.3` |
| macOS Ventura 13.x | x86_64 | `macos-13` | `PHP 8.3` |
### Self-Hosted Runners
@ -103,11 +104,11 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
## :tada: PHP Support
On all supported OS/Platforms the following PHP versions 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.5 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14).
- PHP 5.6 to PHP 8.5 on GitHub-hosted macOS ARM64 runners (macos-14).
- PHP 5.6 to PHP 8.5 on self-hosted runners.
- PHP 5.3 to PHP 8.6 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14).
- PHP 5.6 to PHP 8.6 on GitHub-hosted macOS ARM64 runners (macos-14).
- PHP 5.6 to PHP 8.6 on self-hosted runners.
| PHP Version | Stability | Release Support | Runner Support |
|-------------|-----------|-----------------------|--------------------------------|
@ -126,10 +127,11 @@ On all supported OS/Platforms the following PHP versions can be set up as per th
| `8.3` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
| `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
| `8.5` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
| `8.6` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
> [!Note]
> - Specifying `8.5` in `php-version` input installs a nightly build of `PHP 8.5.0-dev`. See [nightly build setup](#nightly-build-setup) for more information.
> - Specifying `8.6` in `php-version` input installs a nightly build of `PHP 8.6.0-dev` from the master branch of PHP. Specifying `8.5` in `php-version` input installs a nightly build of `PHP 8.5.0-dev` from the PHP-8.5 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.
## :heavy_plus_sign: PHP Extension Support
@ -561,10 +563,10 @@ jobs:
### Nightly Build Setup
> Set up a nightly build of `PHP 8.5`.
> Set up a nightly build of `PHP 8.5` or `PHP 8.6`.
- These PHP versions are currently in active development and might contain bugs and breaking changes.
- Some user space extensions might not support this version currently.
- Some user space extensions might not support these versions currently.
```yaml
steps:
@ -1000,18 +1002,14 @@ Examples of using `setup-php` with various PHP frameworks and packages.
## :sparkling_heart: Support This Project
- Please star the project and share it. If you blog, please share your experience of using `setup-php`.
- Please [reach out](mailto:contact@setup-php.com) if you have any questions about sponsoring setup-php.
Many users and organisations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
<a href="https://github.com/sponsors/shivammathur"><img src="https://setup-php.com/sponsors.svg?" alt="Sponsor shivammathur"></a>
These companies generously provide setup-php their products and services to aid in the development of this project.
<p>
<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 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" height="100">
</a>
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140" height="100">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only">
@ -1028,11 +1026,22 @@ These companies generously provide setup-php their products and services to aid
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200" height="80">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="#">
<img src="https://setup-php.com/sponsors/tidelift.png" alt="Tidelift" width="94" height="80">
<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>
Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
<a href="https://github.com/sponsors/shivammathur"><img src="https://setup-php.com/sponsors.svg?" alt="Sponsor shivammathur"></a>
- If you use setup-php, please consider starring the project and share it.
- If you blog, please share your experience of using `setup-php`.
- Please [reach out](mailto:contact@setup-php.com) if you have any questions about sponsoring setup-php.
## :package: Dependencies
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,7 @@
"highest": "8.4",
"latest": "8.4",
"nightly": "8.5",
"master": "8.6",
"5.x": "5.6",
"7.x": "7.4",
"8.x": "8.4"

View File

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

View File

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

View File

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