From 256b466cc45489bc2ae938ac8b7acbcbf4994476 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 19 Sep 2021 15:33:45 +0530 Subject: [PATCH] Make all extension variables local --- src/scripts/common.sh | 12 ++++++------ src/scripts/darwin.sh | 2 +- src/scripts/linux.sh | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/scripts/common.sh b/src/scripts/common.sh index fee48610..4b5b54c2 100644 --- a/src/scripts/common.sh +++ b/src/scripts/common.sh @@ -94,7 +94,7 @@ self_hosted_setup() { # Function to test if extension is loaded. check_extension() { - extension=$1 + local extension=$1 if [ "$extension" != "mysql" ]; then php -m | grep -i -q -w "$extension" else @@ -146,7 +146,7 @@ get_extension_map() { # Function to enable extension dependencies which are also extensions. enable_extension_dependencies() { - extension=$1 + local extension=$1 prefix=$2 if ! [ -e /tmp/map.orig ]; then get_extension_map | sudo tee /tmp/map.orig >/dev/null @@ -167,7 +167,7 @@ disable_extension_dependents() { # Function to disable an extension. disable_extension() { - extension=$1 + local extension=$1 if check_extension "$extension"; then if shared_extension "$extension"; then disable_extension_helper "$extension" true @@ -212,7 +212,7 @@ configure_pecl() { # Function to get the PECL version of an extension. get_pecl_version() { - extension=$1 + local extension=$1 stability="$(echo "$2" | grep -m 1 -Eio "(stable|alpha|beta|rc|snapshot|preview)")" pecl_rest='https://pecl.php.net/rest/r/' response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml) @@ -232,7 +232,7 @@ pecl_install() { # Function to install a specific version of PECL extension. add_pecl_extension() { - extension=$1 + local extension=$1 pecl_version=$2 prefix=$3 enable_extension "$extension" "$prefix" @@ -251,7 +251,7 @@ add_pecl_extension() { # Function to setup pre-release extensions using PECL. add_unstable_extension() { - extension=$1 + local extension=$1 stability=$2 prefix=$3 pecl_version=$(get_pecl_version "$extension" "$stability") diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index c5aac20a..5021e5b2 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -66,7 +66,7 @@ add_brew_extension() { # Function to setup extensions. add_extension() { - extension=$1 + local extension=$1 prefix=$2 enable_extension "$extension" "$prefix" if check_extension "$extension"; then diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 6f8d109b..3466bfe2 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -62,7 +62,7 @@ add_pdo_extension() { # Function to add extensions. add_extension() { - extension=$1 + local extension=$1 prefix=$2 enable_extension "$extension" "$prefix" if check_extension "$extension"; then