Skip to content

Commit

Permalink
Fix getting scan dir on macOS for old PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Feb 5, 2022
1 parent e554590 commit 8eb9866
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/scripts/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ add_php_config() {
fi
}

# Function to get scan directory.
get_scan_dir() {
if [[ "$version" =~ ${old_versions:?} ]]; then
php --ini | grep additional | sed -e "s|.*: s*||"
else
echo "$ini_dir"/conf.d
fi
}

# Function to Setup PHP.
setup_php() {
step_log "Setup PHP"
Expand All @@ -228,7 +237,7 @@ setup_php() {
php_config="$(command -v php-config)"
ext_dir="$(grep 'extension_dir=' "$php_config" | cut -d "'" -f 2)"
ini_dir="$(php_ini_path)"
scan_dir="$ini_dir"/conf.d
scan_dir="$(get_scan_dir)"
ini_file="$ini_dir"/php.ini
sudo mkdir -m 777 -p "$ext_dir" "$HOME/.composer"
sudo chmod 777 "$ini_file" "${tool_path_dir:?}"
Expand Down

0 comments on commit 8eb9866

Please sign in to comment.