add blackfire PHP probe

pull/415/head
Laurent Laville 2021-08-08 18:52:40 +02:00
parent 788276d833
commit e7837c062f
3 changed files with 40 additions and 0 deletions

View File

@ -3,6 +3,7 @@ apcu 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
apcu_bc 7.0 7.1 7.2 7.3 7.4 apcu_bc 7.0 7.1 7.2 7.3 7.4
ast 7.0 7.1 7.2 7.3 7.4 8.0 8.1 ast 7.0 7.1 7.2 7.3 7.4 8.0 8.1
bcmath 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 bcmath 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
blackfire 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0
bz2 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 bz2 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
calendar 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 calendar 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
cmark 7.0 7.1 7.2 7.3 7.4 cmark 7.0 7.1 7.2 7.3 7.4

View File

@ -1654,6 +1654,29 @@ installRemoteModule() {
fi fi
fi fi
;; ;;
blackfire)
case $(uname -m) in
i386 | i686 | x86)
architecture="i386"
;;
x86_64 | amd64)
architecture="amd64"
;;
aarch64 | arm64 | armv8)
architecture="arm64"
;;
*)
architecture="amd64"
;;
esac
version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;")
curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version
mkdir -p /tmp/blackfire
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire
mv /tmp/blackfire/blackfire-*.so $(getPHPExtensionsDir)/blackfire.so
rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
installRemoteModule_manuallyInstalled=1
;;
cmark) cmark)
if test -z "$installRemoteModule_version"; then if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -le 701; then if test $PHP_MAJMIN_VERSION -le 701; then
@ -2497,6 +2520,9 @@ installRemoteModule() {
# apcu_bc must be loaded after apcu # apcu_bc must be loaded after apcu
docker-php-ext-enable --ini-name "xx-php-ext-$installRemoteModule_module.ini" apc docker-php-ext-enable --ini-name "xx-php-ext-$installRemoteModule_module.ini" apc
;; ;;
blackfire)
printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > "$PHP_INI_DIR/conf.d/docker-php-ext-$installRemoteModule_module.ini"
;;
event) event)
# event must be loaded after sockets # event must be loaded after sockets
docker-php-ext-enable --ini-name "xx-php-ext-$installRemoteModule_module.ini" "$installRemoteModule_module" docker-php-ext-enable --ini-name "xx-php-ext-$installRemoteModule_module.ini" "$installRemoteModule_module"

13
scripts/tests/blackfire Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
set -o errexit
set -o nounset
if test -z "$(php --ri blackfire | grep 'Blackfire => enabled')"; then
echo 'Blackfire PHP Probe is disabled' >&2
rc=1
else
echo 'Blackfire PHP Probe is enabled'
rc=0
fi
exit $rc