mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix PECL config
This commit is contained in:
parent
d384d9fe7e
commit
e934fe28b8
@ -35,7 +35,6 @@ describe('Extension tests', () => {
|
|||||||
expect(linux).toContain(
|
expect(linux).toContain(
|
||||||
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-pcov'
|
'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php7.4-pcov'
|
||||||
);
|
);
|
||||||
expect(linux).toContain('pecl install -f pcov');
|
|
||||||
expect(linux).toContain('install_extension ast-beta');
|
expect(linux).toContain('install_extension ast-beta');
|
||||||
|
|
||||||
linux = await extensions.addExtension('gearman', '7.0', 'linux');
|
linux = await extensions.addExtension('gearman', '7.0', 'linux');
|
||||||
|
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -2787,9 +2787,6 @@ function addExtensionLinux(extension_csv, version, pipe) {
|
|||||||
version +
|
version +
|
||||||
'-' +
|
'-' +
|
||||||
extension.replace('pdo_', '').replace('pdo-', '') +
|
extension.replace('pdo_', '').replace('pdo-', '') +
|
||||||
pipe +
|
|
||||||
' || sudo pecl install -f ' +
|
|
||||||
extension +
|
|
||||||
pipe;
|
pipe;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -163,9 +163,6 @@ export async function addExtensionLinux(
|
|||||||
version +
|
version +
|
||||||
'-' +
|
'-' +
|
||||||
extension.replace('pdo_', '').replace('pdo-', '') +
|
extension.replace('pdo_', '').replace('pdo-', '') +
|
||||||
pipe +
|
|
||||||
' || sudo pecl install -f ' +
|
|
||||||
extension +
|
|
||||||
pipe;
|
pipe;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,17 @@ update_ppa() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configure_pecl() {
|
||||||
|
if [ "$pecl_config" = "false" ] && [ -e /usr/bin/pecl ]; then
|
||||||
|
for tool in pear pecl; do
|
||||||
|
sudo $tool config-set php_ini "$ini_file" >/dev/null 2>&1
|
||||||
|
sudo $tool config-set auto_discover 1 >/dev/null 2>&1
|
||||||
|
sudo $tool channel-update $tool.php.net >/dev/null 2>&1
|
||||||
|
done
|
||||||
|
pecl_config="true"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Function to setup extensions
|
# Function to setup extensions
|
||||||
add_extension() {
|
add_extension() {
|
||||||
extension=$1
|
extension=$1
|
||||||
@ -36,6 +47,7 @@ add_extension() {
|
|||||||
elif ! php -m | grep -i -q -w "$extension"; then
|
elif ! php -m | grep -i -q -w "$extension"; then
|
||||||
(eval "$install_command" && add_log "$tick" "$extension" "Installed and enabled") ||
|
(eval "$install_command" && add_log "$tick" "$extension" "Installed and enabled") ||
|
||||||
(update_ppa && eval "$install_command" && add_log "$tick" "$extension" "Installed and enabled") ||
|
(update_ppa && eval "$install_command" && add_log "$tick" "$extension" "Installed and enabled") ||
|
||||||
|
(sudo pecl install -f "$extension" && add_log "$tick" "$extension" "Installed and enabled") ||
|
||||||
add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
|
add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
|
||||||
fi
|
fi
|
||||||
sudo chmod 777 "$ini_file"
|
sudo chmod 777 "$ini_file"
|
||||||
@ -119,6 +131,7 @@ add_devtools() {
|
|||||||
fi
|
fi
|
||||||
sudo update-alternatives --set php-config /usr/bin/php-config"$version" >/dev/null 2>&1
|
sudo update-alternatives --set php-config /usr/bin/php-config"$version" >/dev/null 2>&1
|
||||||
sudo update-alternatives --set phpize /usr/bin/phpize"$version" >/dev/null 2>&1
|
sudo update-alternatives --set phpize /usr/bin/phpize"$version" >/dev/null 2>&1
|
||||||
|
configure_pecl
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup the nightly build from master branch
|
# Function to setup the nightly build from master branch
|
||||||
@ -138,10 +151,7 @@ setup_master() {
|
|||||||
add_pecl() {
|
add_pecl() {
|
||||||
add_devtools
|
add_devtools
|
||||||
$apt_install php-pear >/dev/null 2>&1
|
$apt_install php-pear >/dev/null 2>&1
|
||||||
sudo pear config-set php_ini "$ini_file" >/dev/null 2>&1
|
configure_pecl
|
||||||
sudo pear config-set auto_discover 1 >/dev/null 2>&1
|
|
||||||
sudo pear channel-update pear.php.net >/dev/null 2>&1
|
|
||||||
sudo pecl channel-update pecl.php.net >/dev/null 2>&1
|
|
||||||
add_log "$tick" "PECL" "Added"
|
add_log "$tick" "PECL" "Added"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,6 +168,7 @@ switch_version() {
|
|||||||
tick="✓"
|
tick="✓"
|
||||||
cross="✗"
|
cross="✗"
|
||||||
ppa_updated="false"
|
ppa_updated="false"
|
||||||
|
pecl_config="false"
|
||||||
version=$1
|
version=$1
|
||||||
apt_install="sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y"
|
apt_install="sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y"
|
||||||
existing_version=$(php-config --version | cut -c 1-3)
|
existing_version=$(php-config --version | cut -c 1-3)
|
||||||
@ -171,7 +182,6 @@ sudo mkdir -p /run/php
|
|||||||
if [ "$existing_version" != "$version" ]; then
|
if [ "$existing_version" != "$version" ]; then
|
||||||
if [ ! -e "/usr/bin/php$version" ]; then
|
if [ ! -e "/usr/bin/php$version" ]; then
|
||||||
update_ppa
|
update_ppa
|
||||||
ppa_updated=1
|
|
||||||
if [ "$version" = "7.4" ]; then
|
if [ "$version" = "7.4" ]; then
|
||||||
$apt_install php"$version" php"$version"-curl php"$version"-mbstring php"$version"-xml php"$version"-phpdbg >/dev/null 2>&1
|
$apt_install php"$version" php"$version"-curl php"$version"-mbstring php"$version"-xml php"$version"-phpdbg >/dev/null 2>&1
|
||||||
elif [ "$version" = "8.0" ]; then
|
elif [ "$version" = "8.0" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user