Fix blackfire extension version to 1.50.0 for PHP 5.3 to 5.6

This commit is contained in:
Shivam Mathur 2021-04-21 07:25:57 +05:30
parent 7e5351f399
commit 0461bf14b2
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 10 additions and 2 deletions

View File

@ -10,8 +10,12 @@ Function Add-Blackfire() {
$no_dot_version = $version.replace('.', '')
$extension_version = $extension.split('-')[1]
if ($extension_version -notmatch "\S") {
if($version -lt '7.0') {
$extension_version = '1.50.0'
} else {
$extension_version = (Invoke-RestMethod https://blackfire.io/api/v1/releases).probe.php
}
}
if (Test-Path $ext_dir\blackfire.dll) {
Enable-PhpExtension -Extension blackfire -Path $php_dir
$status="Enabled"

View File

@ -8,8 +8,12 @@ add_blackfire() {
blackfire_ini_file="${pecl_file:-${ini_file[@]}}"
if [ ! -e "${ext_dir:?}/blackfire.so" ]; then
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
fi
echo "extension=blackfire.so" | sudo tee -a "$blackfire_ini_file" >/dev/null 2>&1