Fix enabling cached dependent extensions on lower PHP versions

This commit is contained in:
Shivam Mathur 2022-05-25 19:44:02 +05:30
parent fe9e23a16a
commit dbc8ba0844
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -30,7 +30,8 @@ enable_cache_extension_dependencies() {
cache_dir=$(find /tmp/extcache -maxdepth 1 -type d -regex ".*$1[0-9]*") cache_dir=$(find /tmp/extcache -maxdepth 1 -type d -regex ".*$1[0-9]*")
if [[ -n "$cache_dir" ]]; then if [[ -n "$cache_dir" ]]; then
IFS=" " read -r -a deps <<<"$(find "$cache_dir" -maxdepth 1 -type f -name "*" -exec basename {} \; | tr '\n' ' ')" IFS=" " read -r -a deps <<<"$(find "$cache_dir" -maxdepth 1 -type f -name "*" -exec basename {} \; | tr '\n' ' ')"
if [[ -n "${deps[*]}" ]] && php "${deps[@]/#/-d ${2}=}" -d "${2}=$1" -m 2>/dev/null | grep -i -q "$1"; then IFS="#" read -r -a deps_enable <<<"$(printf -- "-d ${2}=%s.so#" "${deps[@]}")"
if [[ -n "${deps[*]}" ]] && php "${deps_enable[@]}" -d "${2}=$1.so" -m 2>/dev/null | grep -i -q "$1"; then
for ext in "${deps[@]}"; do for ext in "${deps[@]}"; do
sudo rm -rf /tmp/extcache/"$ext" sudo rm -rf /tmp/extcache/"$ext"
enable_extension "$ext" "$2" enable_extension "$ext" "$2"