From b3cd6b4dab172bb7a2a4dcb800a12abdbcd786eb Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 17 Dec 2020 12:13:39 +0530 Subject: [PATCH] Improve pecl support --- README.md | 5 +---- dist/index.js | 5 +---- src/install.ts | 5 +---- src/scripts/common.sh | 5 ++++- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8806aed2..8c820c45 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ PHP extensions can be setup using the `extensions` input. It accepts a `string` - On `Ubuntu`, extensions which are available as a package or available on `PECL` can be setup. ```yaml -- name: Setup PHP with pecl extension +- name: Setup PHP with PECL extension uses: shivammathur/setup-php@v2 with: php-version: '7.4' @@ -140,7 +140,6 @@ PHP extensions can be setup using the `extensions` input. It accepts a `string` uses: shivammathur/setup-php@v2 with: php-version: '5.4' - tools: pecl extensions: swoole-1.9.3 ``` @@ -151,7 +150,6 @@ PHP extensions can be setup using the `extensions` input. It accepts a `string` uses: shivammathur/setup-php@v2 with: php-version: '7.4' - tools: pecl extensions: xdebug-beta ``` @@ -428,7 +426,6 @@ jobs: > Setup a nightly build of `PHP 8.1`. - This version is currently in development. -- `PECL` is installed by default with `PHP 8.1` on both `ubuntu` and `macOS`. - Some user space extensions might not support this version currently. ```yaml diff --git a/dist/index.js b/dist/index.js index a7a465a0..1cd2476c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2577,10 +2577,7 @@ async function getScript(filename, version, os_version) { const extension_csv = await utils.getInput('extensions', false); const ini_values_csv = await utils.getInput('ini-values', false); const coverage_driver = await utils.getInput('coverage', false); - let tools_csv = await utils.getInput('tools', false); - if (/.*-(beta|alpha|devel|snapshot|\d+\.\d+\.\d+).*/.test(extension_csv)) { - tools_csv = 'pecl, ' + tools_csv; - } + const tools_csv = await utils.getInput('tools', false); let script = await utils.readScript(filename); script += await tools.addTools(tools_csv, version, os_version); if (extension_csv) { diff --git a/src/install.ts b/src/install.ts index b68f08c1..25739d0c 100644 --- a/src/install.ts +++ b/src/install.ts @@ -25,10 +25,7 @@ export async function getScript( 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); - let tools_csv: string = await utils.getInput('tools', false); - if (/.*-(beta|alpha|devel|snapshot|\d+\.\d+\.\d+).*/.test(extension_csv)) { - tools_csv = 'pecl, ' + tools_csv; - } + const tools_csv: string = await utils.getInput('tools', false); let script: string = await utils.readScript(filename); script += await tools.addTools(tools_csv, version, os_version); diff --git a/src/scripts/common.sh b/src/scripts/common.sh index 6a8741eb..1d8702c0 100644 --- a/src/scripts/common.sh +++ b/src/scripts/common.sh @@ -112,7 +112,10 @@ enable_extension() { # Function to configure PECL. configure_pecl() { - if ! [ -e /tmp/pecl_config ] && command -v pecl >/dev/null && command -v pear >/dev/null; then + if ! [ -e /tmp/pecl_config ]; then + if ! command -v pecl >/dev/null || ! command -v pear >/dev/null; then + add_pecl >/dev/null 2>&1 + fi for script in pear pecl; do sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}" sudo "$script" channel-update "$script".php.net