mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Fetch formulae before setup
This commit is contained in:
parent
9385896f2a
commit
277239149a
@ -148,12 +148,25 @@ add_pecl() {
|
||||
add_log "$tick" "PECL" "Added"
|
||||
}
|
||||
|
||||
# Function to fetch updated formulas
|
||||
update_formulae() {
|
||||
brew_dir=$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
|
||||
for formula in httpd pkg-config apr apr-util argon2 aspell autoconf bison curl-openssl freetds freetype gettext glib gmp icu4c jpeg krb5 libffi libpng libpq libsodium libzip oniguruma openldap openssl@1.1 re2c sqlite tidyp unixodbc webp; do
|
||||
sudo curl -o "$brew_dir"/"$formula".rb -sSL https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/"$formula".rb &
|
||||
to_wait+=( $! )
|
||||
done
|
||||
wait "${to_wait[@]}"
|
||||
}
|
||||
|
||||
# Function to setup PHP and composer
|
||||
setup_php_and_composer() {
|
||||
setup_php() {
|
||||
if [ "$version" = "8.0" ]; then
|
||||
update_formulae
|
||||
fi
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
|
||||
brew tap shivammathur/homebrew-php >/dev/null 2>&1
|
||||
brew install shivammathur/php/php@"$version" >/dev/null 2>&1
|
||||
brew link --force --overwrite php@"$version" >/dev/null 2>&1
|
||||
brew tap shivammathur/homebrew-php
|
||||
brew install shivammathur/php/php@"$version"
|
||||
brew link --force --overwrite php@"$version"
|
||||
}
|
||||
|
||||
# Variables
|
||||
@ -166,10 +179,7 @@ existing_version=$(php-config --version | cut -c 1-3)
|
||||
# Setup PHP
|
||||
step_log "Setup PHP"
|
||||
if [ "$existing_version" != "$version" ]; then
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE >/dev/null 2>&1
|
||||
brew tap shivammathur/homebrew-php >/dev/null 2>&1
|
||||
brew install shivammathur/php/php@"$version" >/dev/null 2>&1
|
||||
brew link --force --overwrite php@"$version" >/dev/null 2>&1
|
||||
setup_php >/dev/null 2>&1
|
||||
status="Installed"
|
||||
else
|
||||
status="Found"
|
||||
|
Loading…
Reference in New Issue
Block a user