diff --git a/support/ext/blackfire b/support/ext/blackfire index 132c8f8d..f90e7ff5 100755 --- a/support/ext/blackfire +++ b/support/ext/blackfire @@ -49,11 +49,16 @@ echo -e "[blackfire]\nserver-id=f1abf3a8-3f85-4743-99b2-97f066c099b9\nserver-tok find ${PREFIX} -type f \( -executable -o -name '*.a' \) -exec sh -c "file -i '{}' | grep -Eq 'application/x-(archive|executable|sharedlib); charset=binary'" \; -print | xargs strip --strip-unneeded # gets sourced on container boot +blackfire_bin="/app/vendor/php/bin/blackfire" +blackfire_socket="/app/vendor/php/var/blackfire/run/agent.sock" cat > "${PREFIX}/bin/profile.blackfire.sh" <<'EOF' if [[ -n "$BLACKFIRE_SERVER_TOKEN" && -n "$BLACKFIRE_SERVER_ID" ]]; then - if [[ -f "/app/vendor/php/bin/blackfire-agent" ]]; then - touch /app/vendor/php/var/blackfire/run/agent.sock - /app/vendor/php/bin/blackfire-agent -config=/app/vendor/php/etc/blackfire/agent.ini -socket="unix:///app/vendor/php/var/blackfire/run/agent.sock" & + if [[ -f "${blackfire_bin}" ]]; then + touch "${blackfire_socket}" + export BLACKFIRE_CONFIG="/dev/null" + export BLACKFIRE_SOCKET="unix://${blackfire_socket}" + + "${blackfire_bin}" agent:start & else echo >&2 "WARNING: Add-on 'blackfire' detected, but PHP extension not yet installed. Push an update to the application to finish installation of the add-on; an empty change ('git commit --allow-empty') is sufficient." fi @@ -63,8 +68,4 @@ EOF mkdir --parents "${PREFIX}/etc/php/conf.d" cat > "${PREFIX}/etc/conf.d/blackfire.ini" <<'EOF' extension = blackfire.so - -blackfire.server_token = ${BLACKFIRE_SERVER_TOKEN} -blackfire.server_id = ${BLACKFIRE_SERVER_ID} -blackfire.agent_socket = "unix:///app/vendor/php/var/blackfire/run/agent.sock" -EOF +EOF \ No newline at end of file