mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Improve pecl support
This commit is contained in:
parent
ce02569aea
commit
b3cd6b4dab
@ -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
5
dist/index.js
vendored
@ -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) {
|
||||||
|
@ -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);
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user