Fix http extension setup

This commit is contained in:
Shivam Mathur 2022-01-31 19:16:13 +05:30
parent 5959fab498
commit e554590514
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -19,15 +19,6 @@ enable_http() {
fi fi
} }
# Function to install extensions.
add_extension_helper() {
if [ "$os" = "Linux" ]; then
add_extension "$1" extension
else
add_brew_extension "$1" extension
fi
}
# Function to install http dependencies. # Function to install http dependencies.
add_http_dependencies() { add_http_dependencies() {
if [[ ${version:?} =~ ${old_versions:?} ]]; then if [[ ${version:?} =~ ${old_versions:?} ]]; then
@ -78,8 +69,8 @@ add_http_helper() {
add_http_latest() { add_http_latest() {
enable_http enable_http
if ! check_extension http; then if ! check_extension http; then
add_http_dependencies
if [ "$os" = "Linux" ]; then if [ "$os" = "Linux" ]; then
add_http_dependencies
package="php$version-http" package="php$version-http"
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
(check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os" (check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os"