mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-29 23:03:04 +07:00
Fix extension setup
This commit is contained in:
parent
86e1ccdd8d
commit
b2f833f7d1
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1119,7 +1119,7 @@ exports.fetch = fetch;
|
||||
* @param version
|
||||
*/
|
||||
async function parseVersion(version) {
|
||||
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
|
||||
const manifest = 'https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/php-versions.json';
|
||||
switch (true) {
|
||||
case /latest|\d.x/.test(version):
|
||||
return JSON.parse(await fetch(manifest))[version];
|
||||
|
7705
package-lock.json
generated
7705
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -105,9 +105,8 @@ check_extension() {
|
||||
|
||||
# Function to enable existing extensions.
|
||||
enable_extension() {
|
||||
if [ -e /tmp/setup_php_dismod ] && grep -q "$1" /tmp/setup_php_dismod; then
|
||||
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
|
||||
fi
|
||||
modules_dir="/var/lib/php/modules/$version"
|
||||
[ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete
|
||||
if ! check_extension "$1" && [ -e "${ext_dir:?}/$1.so" ]; then
|
||||
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
|
||||
fi
|
||||
|
@ -58,9 +58,7 @@ delete_extension() {
|
||||
extension=$1
|
||||
disable_extension "$extension"
|
||||
sudo rm -rf "$ext_dir"/"$extension".so >/dev/null 2>&1
|
||||
if [ "${runner:?}" = "self-hosted" ]; then
|
||||
$apt_remove "php-$extension" "php$version-$extension" >/dev/null 2>&1 || true
|
||||
fi
|
||||
sudo sed -i "/Package: php$version-$extension/,/^$/d" /var/lib/dpkg/status
|
||||
}
|
||||
|
||||
# Function to disable and delete extensions.
|
||||
@ -69,7 +67,6 @@ remove_extension() {
|
||||
if check_extension "$extension"; then
|
||||
if [[ ! "$version" =~ ${old_versions:?} ]] && [ -e /etc/php/"$version"/mods-available/"$extension".ini ]; then
|
||||
sudo phpdismod -v "$version" "$extension" >/dev/null 2>&1
|
||||
echo "$extension" | sudo tee -a /tmp/setup_php_dismod >/dev/null 2>&1
|
||||
fi
|
||||
delete_extension "$extension"
|
||||
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
|
||||
|
@ -67,7 +67,8 @@ export async function fetch(url: string): Promise<string> {
|
||||
* @param version
|
||||
*/
|
||||
export async function parseVersion(version: string): Promise<string> {
|
||||
const manifest = 'https://dl.bintray.com/shivammathur/php/php-versions.json';
|
||||
const manifest =
|
||||
'https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/configs/php-versions.json';
|
||||
switch (true) {
|
||||
case /latest|\d.x/.test(version):
|
||||
return JSON.parse(await fetch(manifest))[version];
|
||||
|
Loading…
Reference in New Issue
Block a user