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,7 +10,11 @@ Function Add-Blackfire() {
$no_dot_version = $version.replace('.', '') $no_dot_version = $version.replace('.', '')
$extension_version = $extension.split('-')[1] $extension_version = $extension.split('-')[1]
if ($extension_version -notmatch "\S") { if ($extension_version -notmatch "\S") {
$extension_version = (Invoke-RestMethod https://blackfire.io/api/v1/releases).probe.php 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) { if (Test-Path $ext_dir\blackfire.dll) {
Enable-PhpExtension -Extension blackfire -Path $php_dir Enable-PhpExtension -Extension blackfire -Path $php_dir

View File

@ -8,7 +8,11 @@ add_blackfire() {
blackfire_ini_file="${pecl_file:-${ini_file[@]}}" blackfire_ini_file="${pecl_file:-${ini_file[@]}}"
if [ ! -e "${ext_dir:?}/blackfire.so" ]; then if [ ! -e "${ext_dir:?}/blackfire.so" ]; then
if [ "$extension_version" = "blackfire" ]; then if [ "$extension_version" = "blackfire" ]; then
extension_version=$(get -s -n "" https://blackfire.io/api/v1/releases | grep -Eo 'php":"([0-9]+.[0-9]+.[0-9]+)' | cut -d '"' -f 3) 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 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"_amd64-php-"$no_dot_version".so >/dev/null 2>&1
fi fi