Skip to content

Commit dfda103

Browse files
authored
Merge branch 'dev' into feat/sqs_instrumentation
2 parents 024ed47 + 996dcc9 commit dfda103

File tree

177 files changed

+8755
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+8755
-284
lines changed

.github/workflows/code-coverage-baseline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
matrix:
7070
platform: [gnu, musl]
7171
arch: [amd64]
72-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
72+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
7373
include:
7474
- codecov: 0
7575
- platform: gnu
@@ -147,7 +147,7 @@ jobs:
147147
matrix:
148148
platform: [gnu, musl]
149149
arch: [amd64]
150-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
150+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
151151
include:
152152
- codecov: 0
153153
- platform: gnu

.github/workflows/make-agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
matrix:
3434
platform: [gnu, musl]
35-
php: ['8.0', '8.1', '8.2', '8.3']
35+
php: ['8.0', '8.1', '8.2', '8.3', '8.4']
3636
steps:
3737
- name: Checkout Repo
3838
uses: actions/checkout@v4

.github/workflows/make-integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
fail-fast: true
3535
matrix:
3636
platform: [gnu, musl]
37-
php: ['8.0', '8.1', '8.2', '8.3']
37+
php: ['8.0', '8.1', '8.2', '8.3', '8.4']
3838
steps:
3939
- name: Checkout integration tests
4040
uses: actions/checkout@v4

.github/workflows/security-scan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ jobs:
4545
if: ${{ github.event_name == 'schedule' }}
4646
uses: github/codeql-action/upload-sarif@v3
4747
with:
48+
checkout_path: ./php-agent
4849
sarif_file: trivy-results.sarif

.github/workflows/test-agent.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,39 @@ jobs:
4444
echo "$GOFMT_REPORTED_FILES" >> $GITHUB_STEP_SUMMARY
4545
exit 1
4646
fi
47+
govet:
48+
runs-on: ubuntu-latest
49+
continue-on-error: true
50+
steps:
51+
- name: Checkout newrelic-php-agent code
52+
uses: actions/checkout@v4
53+
with:
54+
path: php-agent
55+
- name: Get go version
56+
id: get-go-version
57+
run: |
58+
echo "go toolchain version required to build the daemon:"
59+
toolchain="$(awk '/^toolchain */ {gsub(/^go/, "", $2); print $2}' ./php-agent/daemon/go.mod)"
60+
echo "[${toolchain}]"
61+
echo "go-toolchain-version=${toolchain}" >> $GITHUB_OUTPUT
62+
- name: Setup go
63+
uses: actions/setup-go@v5
64+
with:
65+
go-version: ${{ steps.get-go-version.outputs.go-toolchain-version }}
66+
cache-dependency-path: "**/*.sum"
67+
- name: Verify go version
68+
run: |
69+
echo "Verify correct go toolchain version is used"
70+
actual="$(go version)"
71+
echo "Actual: [$actual]"
72+
expected="go version go${{ steps.get-go-version.outputs.go-toolchain-version }} linux/amd64"
73+
echo "Expected: [$expected]"
74+
if [ "$actual" != "$expected" ]; then
75+
exit 1
76+
fi
77+
- name: Run go vet
78+
run: go vet -C ./php-agent/daemon ./...
79+
shell: bash
4780
daemon-unit-tests:
4881
runs-on: ubuntu-latest
4982
env:
@@ -97,7 +130,7 @@ jobs:
97130
matrix:
98131
platform: [gnu, musl]
99132
arch: [amd64, arm64]
100-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
133+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
101134
exclude:
102135
- arch: arm64
103136
php: '7.2'
@@ -203,7 +236,7 @@ jobs:
203236
matrix:
204237
platform: [gnu, musl]
205238
arch: [amd64, arm64]
206-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
239+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
207240
exclude:
208241
- arch: arm64
209242
php: '7.2'

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11.5.0
1+
11.6.0

agent/config.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,16 @@ if test "$PHP_NEWRELIC" = "yes"; then
232232
lib_guzzle4.c lib_guzzle6.c lib_guzzle_common.c \
233233
lib_mongodb.c lib_phpunit.c lib_predis.c lib_zend_http.c \
234234
lib_composer.c"
235-
PHP_NEW_EXTENSION(newrelic, $FRAMEWORKS $LIBRARIES $NEWRELIC_AGENT, $ext_shared,, \\$(NEWRELIC_CFLAGS))
235+
PHP_NEW_EXTENSION(newrelic, $FRAMEWORKS $LIBRARIES $NEWRELIC_AGENT, $ext_shared,, $(NEWRELIC_CFLAGS))
236236

237237
PHP_SUBST(NEWRELIC_CFLAGS)
238238

239239
dnl Define $(PHP_CONFIG) so we can call it when building tests.
240240
PHP_SUBST(PHP_CONFIG)
241241

242+
dnl Make sure we include the source directory in the include search path.
243+
PHP_ADD_INCLUDE([$abs_srcdir], [1])
244+
242245
dnl Include the Makefile.frag, which we use to handle build time
243246
dnl dependencies.
244247
PHP_ADD_MAKEFILE_FRAGMENT

agent/newrelic-install.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,10 @@ for pmv in "20170718" "20180731" "20190902"; do
335335
done
336336
fi
337337
# Currently supported versions:
338-
# (8.0, 8.1, 8.2, 8.3)
338+
# (8.0, 8.1, 8.2, 8.3, 8.4)
339339
# for x64 and aarch64
340340
if [ ${arch} = x64 ] || [ ${arch} = aarch64 ]; then
341-
for pmv in "20200930" "20210902" "20220829" "20230831"; do
341+
for pmv in "20200930" "20210902" "20220829" "20230831" "20240924"; do
342342
check_file "${ilibdir}/agent/${arch}/newrelic-${pmv}.so"
343343
done
344344
fi
@@ -542,6 +542,7 @@ add_to_path /usr/local/php-8.0/bin
542542
add_to_path /usr/local/php-8.1/bin
543543
add_to_path /usr/local/php-8.2/bin
544544
add_to_path /usr/local/php-8.3/bin
545+
add_to_path /usr/local/php-8.4/bin
545546

546547
add_to_path /opt/local/bin
547548
add_to_path /usr/php/bin
@@ -553,6 +554,7 @@ add_to_path /usr/php-8.0/bin
553554
add_to_path /usr/php-8.1/bin
554555
add_to_path /usr/php-8.2/bin
555556
add_to_path /usr/php-8.3/bin
557+
add_to_path /usr/php-8.4/bin
556558

557559
add_to_path /usr/php/7.2/bin
558560
add_to_path /usr/php/7.3/bin
@@ -561,6 +563,7 @@ add_to_path /usr/php/8.0/bin
561563
add_to_path /usr/php/8.1/bin
562564
add_to_path /usr/php/8.2/bin
563565
add_to_path /usr/php/8.3/bin
566+
add_to_path /usr/php/8.4/bin
564567

565568
add_to_path /opt/php/bin
566569
add_to_path /opt/zend/bin
@@ -572,6 +575,7 @@ add_to_path /opt/php-8.0/bin
572575
add_to_path /opt/php-8.1/bin
573576
add_to_path /opt/php-8.2/bin
574577
add_to_path /opt/php-8.3/bin
578+
add_to_path /opt/php-8.4/bin
575579

576580
if [ -n "${NR_INSTALL_PATH}" ]; then
577581
oIFS="${IFS}"
@@ -1052,7 +1056,11 @@ for this copy of PHP. We apologize for the inconvenience.
10521056

10531057
8.3.*)
10541058
pi_php8="yes"
1055-
;;
1059+
;;
1060+
1061+
8.4.*)
1062+
pi_php8="yes"
1063+
;;
10561064

10571065
*)
10581066
error "unsupported version '${pi_ver}' of PHP found at:
@@ -1232,6 +1240,7 @@ does not exist. This particular instance of PHP will be skipped.
12321240
8.1.*) pi_modver="20210902" ;;
12331241
8.2.*) pi_modver="20220829" ;;
12341242
8.3.*) pi_modver="20230831" ;;
1243+
8.4.*) pi_modver="20240924" ;;
12351244
esac
12361245
log "${pdir}: pi_modver=${pi_modver}"
12371246

agent/php_includes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#define ZEND_8_1_X_API_NO 20210902
5555
#define ZEND_8_2_X_API_NO 20220829
5656
#define ZEND_8_3_X_API_NO 20230831
57+
#define ZEND_8_4_X_API_NO 20240924
5758

5859
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO /* PHP8+ */
5960
#include "Zend/zend_observer.h"

agent/php_internal_instrument.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3840,9 +3840,37 @@ void nr_php_generate_internal_wrap_records(void) {
38403840
NR_INTERNAL_WRAPREC("sqlite3::exec", sqlite3_exec, sqlite3, 0, 0)
38413841

38423842
NR_INTERNAL_WRAPREC("pdo::__construct", pdo_construct, pdo_construct, 0, 0)
3843+
#if ZEND_MODULE_API_NO >= ZEND_8_4_X_API_NO
3844+
NR_INTERNAL_WRAPREC("pdo\\firebird::__construct", pdo_construct, pdo_construct, 0, 0)
3845+
NR_INTERNAL_WRAPREC("pdo\\mysql::__construct", pdo_construct, pdo_construct, 0, 0)
3846+
NR_INTERNAL_WRAPREC("pdo\\odbc::__construct", pdo_construct, pdo_construct, 0, 0)
3847+
NR_INTERNAL_WRAPREC("pdo\\pgsql::__construct", pdo_construct, pdo_construct, 0, 0)
3848+
NR_INTERNAL_WRAPREC("pdo\\sqlite::__construct", pdo_construct, pdo_construct, 0, 0)
3849+
#endif
38433850
NR_INTERNAL_WRAPREC("pdo::query", pdo_query, pdo_query, 0, 0)
3851+
#if ZEND_MODULE_API_NO >= ZEND_8_4_X_API_NO
3852+
NR_INTERNAL_WRAPREC("pdo\\firebird::query", pdo_query, pdo_query, 0, 0)
3853+
NR_INTERNAL_WRAPREC("pdo\\mysql::query", pdo_query, pdo_query, 0, 0)
3854+
NR_INTERNAL_WRAPREC("pdo\\odbc::query", pdo_query, pdo_query, 0, 0)
3855+
NR_INTERNAL_WRAPREC("pdo\\pgsql::query", pdo_query, pdo_query, 0, 0)
3856+
NR_INTERNAL_WRAPREC("pdo\\sqlite::query", pdo_query, pdo_query, 0, 0)
3857+
#endif
38443858
NR_INTERNAL_WRAPREC("pdo::exec", pdo_exec, pdo_exec, 0, 0)
3859+
#if ZEND_MODULE_API_NO >= ZEND_8_4_X_API_NO
3860+
NR_INTERNAL_WRAPREC("pdo\\firebird::exec", pdo_exec, pdo_exec, 0, 0)
3861+
NR_INTERNAL_WRAPREC("pdo\\mysql::exec", pdo_exec, pdo_exec, 0, 0)
3862+
NR_INTERNAL_WRAPREC("pdo\\odbc::exec", pdo_exec, pdo_exec, 0, 0)
3863+
NR_INTERNAL_WRAPREC("pdo\\pgsql::exec", pdo_exec, pdo_exec, 0, 0)
3864+
NR_INTERNAL_WRAPREC("pdo\\sqlite::exec", pdo_exec, pdo_exec, 0, 0)
3865+
#endif
38453866
NR_INTERNAL_WRAPREC("pdo::prepare", pdo_prepare, pdo_prepare, 0, 0)
3867+
#if ZEND_MODULE_API_NO >= ZEND_8_4_X_API_NO
3868+
NR_INTERNAL_WRAPREC("pdo\\firebird::prepare", pdo_prepare, pdo_prepare, 0, 0)
3869+
NR_INTERNAL_WRAPREC("pdo\\mysql::prepare", pdo_prepare, pdo_prepare, 0, 0)
3870+
NR_INTERNAL_WRAPREC("pdo\\odbc::prepare", pdo_prepare, pdo_prepare, 0, 0)
3871+
NR_INTERNAL_WRAPREC("pdo\\pgsql::prepare", pdo_prepare, pdo_prepare, 0, 0)
3872+
NR_INTERNAL_WRAPREC("pdo\\sqlite::prepare", pdo_prepare, pdo_prepare, 0, 0)
3873+
#endif
38463874
NR_INTERNAL_WRAPREC("pdostatement::execute", pdostmt_execute,
38473875
pdostatement_execute, 0, 0)
38483876

0 commit comments

Comments
 (0)