Improve pecl support

This commit is contained in:
Shivam Mathur 2020-12-17 12:13:39 +05:30
parent ce02569aea
commit b3cd6b4dab
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
4 changed files with 7 additions and 13 deletions

View File

@ -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. - On `Ubuntu`, extensions which are available as a package or available on `PECL` can be setup.
```yaml ```yaml
- name: Setup PHP with pecl extension - name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '7.4' 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 uses: shivammathur/setup-php@v2
with: with:
php-version: '5.4' php-version: '5.4'
tools: pecl
extensions: swoole-1.9.3 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 uses: shivammathur/setup-php@v2
with: with:
php-version: '7.4' php-version: '7.4'
tools: pecl
extensions: xdebug-beta extensions: xdebug-beta
``` ```
@ -428,7 +426,6 @@ jobs:
> Setup a nightly build of `PHP 8.1`. > Setup a nightly build of `PHP 8.1`.
- This version is currently in development. - 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. - Some user space extensions might not support this version currently.
```yaml ```yaml

5
dist/index.js vendored
View File

@ -2577,10 +2577,7 @@ async function getScript(filename, version, os_version) {
const extension_csv = await utils.getInput('extensions', false); const extension_csv = await utils.getInput('extensions', false);
const ini_values_csv = await utils.getInput('ini-values', false); const ini_values_csv = await utils.getInput('ini-values', false);
const coverage_driver = await utils.getInput('coverage', false); const coverage_driver = await utils.getInput('coverage', false);
let tools_csv = await utils.getInput('tools', false); const tools_csv = await utils.getInput('tools', false);
if (/.*-(beta|alpha|devel|snapshot|\d+\.\d+\.\d+).*/.test(extension_csv)) {
tools_csv = 'pecl, ' + tools_csv;
}
let script = await utils.readScript(filename); let script = await utils.readScript(filename);
script += await tools.addTools(tools_csv, version, os_version); script += await tools.addTools(tools_csv, version, os_version);
if (extension_csv) { if (extension_csv) {

View File

@ -25,10 +25,7 @@ export async function getScript(
const extension_csv: string = await utils.getInput('extensions', false); const extension_csv: string = await utils.getInput('extensions', false);
const ini_values_csv: string = await utils.getInput('ini-values', false); const ini_values_csv: string = await utils.getInput('ini-values', false);
const coverage_driver: string = await utils.getInput('coverage', false); const coverage_driver: string = await utils.getInput('coverage', false);
let tools_csv: string = await utils.getInput('tools', false); const tools_csv: string = await utils.getInput('tools', false);
if (/.*-(beta|alpha|devel|snapshot|\d+\.\d+\.\d+).*/.test(extension_csv)) {
tools_csv = 'pecl, ' + tools_csv;
}
let script: string = await utils.readScript(filename); let script: string = await utils.readScript(filename);
script += await tools.addTools(tools_csv, version, os_version); script += await tools.addTools(tools_csv, version, os_version);

View File

@ -112,7 +112,10 @@ enable_extension() {
# Function to configure PECL. # Function to configure PECL.
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 for script in pear pecl; do
sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}" sudo "$script" config-set php_ini "${pecl_file:-${ini_file[@]}}"
sudo "$script" channel-update "$script".php.net sudo "$script" channel-update "$script".php.net