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
|
* @param version
|
||||||
*/
|
*/
|
||||||
async function parseVersion(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) {
|
switch (true) {
|
||||||
case /latest|\d.x/.test(version):
|
case /latest|\d.x/.test(version):
|
||||||
return JSON.parse(await fetch(manifest))[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.
|
# Function to enable existing extensions.
|
||||||
enable_extension() {
|
enable_extension() {
|
||||||
if [ -e /tmp/setup_php_dismod ] && grep -q "$1" /tmp/setup_php_dismod; then
|
modules_dir="/var/lib/php/modules/$version"
|
||||||
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
|
[ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete
|
||||||
fi
|
|
||||||
if ! check_extension "$1" && [ -e "${ext_dir:?}/$1.so" ]; then
|
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
|
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
|
||||||
fi
|
fi
|
||||||
|
@ -58,9 +58,7 @@ delete_extension() {
|
|||||||
extension=$1
|
extension=$1
|
||||||
disable_extension "$extension"
|
disable_extension "$extension"
|
||||||
sudo rm -rf "$ext_dir"/"$extension".so >/dev/null 2>&1
|
sudo rm -rf "$ext_dir"/"$extension".so >/dev/null 2>&1
|
||||||
if [ "${runner:?}" = "self-hosted" ]; then
|
sudo sed -i "/Package: php$version-$extension/,/^$/d" /var/lib/dpkg/status
|
||||||
$apt_remove "php-$extension" "php$version-$extension" >/dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to disable and delete extensions.
|
# Function to disable and delete extensions.
|
||||||
@ -69,7 +67,6 @@ remove_extension() {
|
|||||||
if check_extension "$extension"; then
|
if check_extension "$extension"; then
|
||||||
if [[ ! "$version" =~ ${old_versions:?} ]] && [ -e /etc/php/"$version"/mods-available/"$extension".ini ]; then
|
if [[ ! "$version" =~ ${old_versions:?} ]] && [ -e /etc/php/"$version"/mods-available/"$extension".ini ]; then
|
||||||
sudo phpdismod -v "$version" "$extension" >/dev/null 2>&1
|
sudo phpdismod -v "$version" "$extension" >/dev/null 2>&1
|
||||||
echo "$extension" | sudo tee -a /tmp/setup_php_dismod >/dev/null 2>&1
|
|
||||||
fi
|
fi
|
||||||
delete_extension "$extension"
|
delete_extension "$extension"
|
||||||
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
|
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
|
||||||
|
@ -67,7 +67,8 @@ export async function fetch(url: string): Promise<string> {
|
|||||||
* @param version
|
* @param version
|
||||||
*/
|
*/
|
||||||
export async function parseVersion(version: string): Promise<string> {
|
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) {
|
switch (true) {
|
||||||
case /latest|\d.x/.test(version):
|
case /latest|\d.x/.test(version):
|
||||||
return JSON.parse(await fetch(manifest))[version];
|
return JSON.parse(await fetch(manifest))[version];
|
||||||
|
Loading…
Reference in New Issue
Block a user