Skip to content

Commit

Permalink
Fix support for blackfire
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jun 23, 2024
1 parent 606ac25 commit a0edbac
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/scripts/extensions/blackfire.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,25 @@ add_blackfire() {
status='Enabled'
if ! shared_extension blackfire; then
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 [[ ${version:?} =~ 5.[3-6] ]]; then
extension_version='1.50.0'
else
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
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
if [ -e "${ext_dir:?}/blackfire.so" ]; then
disable_extension xdebug >/dev/null 2>&1
disable_extension pcov >/dev/null 2>&1
enable_extension blackfire extension
add_extension_log blackfire "$status"
else
add_extension_log blackfire "Could not install blackfire on PHP ${semver:?}"
fi
disable_extension xdebug >/dev/null 2>&1
disable_extension pcov >/dev/null 2>&1
enable_extension blackfire extension
add_extension_log blackfire "$status"
}

0 comments on commit a0edbac

Please sign in to comment.