Fix support for blackfire

This commit is contained in:
Shivam Mathur 2024-06-23 08:15:22 +05:30
parent 606ac25b84
commit a0edbac27b
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -8,6 +8,10 @@ add_blackfire() {
status='Enabled' status='Enabled'
if ! shared_extension blackfire; then if ! shared_extension blackfire; then
status='Installed and enabled' status='Installed and enabled'
arch="$(uname -m)"
arch_name="amd64"
[[ "$arch" = "aarch64" || "$arch" = "arm64" ]] && arch_name="arm64"
[ "${ts:?}" = 'zts' ] && no_dot_version="${no_dot_version}-zts"
if [ "$extension_version" = "blackfire" ]; then if [ "$extension_version" = "blackfire" ]; then
if [[ ${version:?} =~ 5.[3-6] ]]; then if [[ ${version:?} =~ 5.[3-6] ]]; then
extension_version='1.50.0' extension_version='1.50.0'
@ -15,10 +19,14 @@ add_blackfire() {
extension_version=$(get -s -n "" https://blackfire.io/api/v1/releases | grep -Eo 'php":"([0-9]+.[0-9]+.[0-9]+)' | cut -d '"' -f 3) extension_version=$(get -s -n "" https://blackfire.io/api/v1/releases | grep -Eo 'php":"([0-9]+.[0-9]+.[0-9]+)' | cut -d '"' -f 3)
fi fi
fi fi
get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_amd64-php-"$no_dot_version".so >/dev/null 2>&1 get -q -n "${ext_dir:?}/blackfire.so" https://packages.blackfire.io/binaries/blackfire-php/"$extension_version"/blackfire-php-"$platform"_"$arch_name"-php-"$no_dot_version".so >/dev/null 2>&1
fi fi
if [ -e "${ext_dir:?}/blackfire.so" ]; then
disable_extension xdebug >/dev/null 2>&1 disable_extension xdebug >/dev/null 2>&1
disable_extension pcov >/dev/null 2>&1 disable_extension pcov >/dev/null 2>&1
enable_extension blackfire extension enable_extension blackfire extension
add_extension_log blackfire "$status" add_extension_log blackfire "$status"
else
add_extension_log blackfire "Could not install blackfire on PHP ${semver:?}"
fi
} }