Skip to content

Commit e78afe1

Browse files
authored
Merge pull request #840 from newrelic/dev
Release 10.18
2 parents f4c8604 + a57b812 commit e78afe1

File tree

193 files changed

+18377
-827
lines changed

Some content is hidden

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

193 files changed

+18377
-827
lines changed

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ jobs:
3232
arch: [amd64]
3333
steps:
3434
- name: Checkout newrelic-php-agent code
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3636
with:
3737
path: php-agent
3838
repository: ${{ inputs.origin }}/newrelic-php-agent
3939
ref: ${{ inputs.ref }}
4040
- name: Login to Docker Hub
41-
uses: docker/login-action@v2
41+
uses: docker/login-action@v3
4242
with:
4343
username: ${{ secrets.DOCKERHUB_USERNAME }}
4444
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -77,13 +77,13 @@ jobs:
7777
codecov: 1
7878
steps:
7979
- name: Checkout Repo
80-
uses: actions/checkout@v3
80+
uses: actions/checkout@v4
8181
with:
8282
path: php-agent
8383
repository: ${{ inputs.origin }}/newrelic-php-agent
8484
ref: ${{ inputs.ref }}
8585
- name: Login to Docker Hub
86-
uses: docker/login-action@v2
86+
uses: docker/login-action@v3
8787
with:
8888
username: ${{ secrets.DOCKERHUB_USERNAME }}
8989
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -155,7 +155,7 @@ jobs:
155155
codecov: 1
156156
steps:
157157
- name: Checkout integration tests
158-
uses: actions/checkout@v3
158+
uses: actions/checkout@v4
159159
with:
160160
path: php-agent
161161
repository: ${{ inputs.origin }}/newrelic-php-agent
@@ -187,7 +187,7 @@ jobs:
187187
chmod 755 php-agent/bin/integration_runner
188188
chmod 755 php-agent/agent/modules/newrelic.so
189189
- name: Login to Docker Hub
190-
uses: docker/login-action@v2
190+
uses: docker/login-action@v3
191191
with:
192192
username: ${{ secrets.DOCKERHUB_USERNAME }}
193193
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -250,7 +250,7 @@ jobs:
250250
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
251251
- name: Upload coverage reports to Codecov
252252
if: ${{ matrix.codecov == 1 }}
253-
uses: codecov/codecov-action@v3
253+
uses: codecov/codecov-action@v3.1.5
254254
with:
255255
token: ${{ secrets.CODECOV_TOKEN }}
256256
working-directory: ./php-agent

.github/workflows/make-agent.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ jobs:
3535
php: ['8.0', '8.1', '8.2', '8.3']
3636
steps:
3737
- name: Checkout Repo
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939
with:
4040
path: php-agent
4141
repository: ${{ inputs.origin }}/newrelic-php-agent
4242
ref: ${{ inputs.ref }}
4343
- name: Enable arm64 emulation
4444
if: ${{ inputs.arch == 'arm64' }}
45-
uses: docker/setup-qemu-action@v2
45+
uses: docker/setup-qemu-action@v3
4646
with:
4747
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
4848
platforms: arm64
4949
- name: Login to Docker Hub
50-
uses: docker/login-action@v2
50+
uses: docker/login-action@v3
5151
with:
5252
username: ${{ secrets.DOCKERHUB_USERNAME }}
5353
password: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/make-for-platform-on-arch.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@ jobs:
5454
platform: [gnu, musl]
5555
steps:
5656
- name: Checkout newrelic-php-agent code
57-
uses: actions/checkout@v3
57+
uses: actions/checkout@v4
5858
with:
5959
path: php-agent
6060
repository: ${{ inputs.origin }}/newrelic-php-agent
6161
ref: ${{ inputs.ref }}
6262
- name: Enable arm64 emulation
6363
if: ${{ inputs.arch == 'arm64' }}
64-
uses: docker/setup-qemu-action@v2
64+
uses: docker/setup-qemu-action@v3
6565
with:
6666
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
6767
platforms: arm64
6868
- name: Login to Docker Hub
69-
uses: docker/login-action@v2
69+
uses: docker/login-action@v3
7070
with:
7171
username: ${{ secrets.DOCKERHUB_USERNAME }}
7272
password: ${{ secrets.DOCKERHUB_TOKEN }}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
php: ['8.0', '8.1', '8.2', '8.3']
3838
steps:
3939
- name: Checkout integration tests
40-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4141
with:
4242
path: php-agent
4343
repository: ${{ inputs.origin }}/newrelic-php-agent
@@ -58,12 +58,12 @@ jobs:
5858
chmod 755 php-agent/agent/modules/newrelic.so
5959
- name: Enable arm64 emulation
6060
if: ${{ inputs.arch == 'arm64' }}
61-
uses: docker/setup-qemu-action@v2
61+
uses: docker/setup-qemu-action@v3
6262
with:
6363
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
6464
platforms: arm64
6565
- name: Login to Docker Hub
66-
uses: docker/login-action@v2
66+
uses: docker/login-action@v3
6767
with:
6868
username: ${{ secrets.DOCKERHUB_USERNAME }}
6969
password: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/release-build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
arch: [amd64]
3636
steps:
3737
- name: Checkout newrelic-php-agent code
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939
with:
4040
ref: ${{ github.event.client_payload.ref }}
4141
path: newrelic-php-agent
4242
- name: Login to Docker Hub
43-
uses: docker/login-action@v2
43+
uses: docker/login-action@v3
4444
with:
4545
username: ${{ secrets.DOCKERHUB_USERNAME }}
4646
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -69,12 +69,12 @@ jobs:
6969
arch: [amd64]
7070
steps:
7171
- name: Checkout Repo
72-
uses: actions/checkout@v3
72+
uses: actions/checkout@v4
7373
with:
7474
ref: ${{ github.event.client_payload.ref }}
7575
path: newrelic-php-agent
7676
- name: Login to Docker Hub
77-
uses: docker/login-action@v2
77+
uses: docker/login-action@v3
7878
with:
7979
username: ${{ secrets.DOCKERHUB_USERNAME }}
8080
password: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/repolinter.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
steps:
1919
- name: Test Default Branch
2020
id: default-branch
21-
uses: actions/github-script@v2
21+
uses: actions/github-script@v7
2222
with:
2323
script: |
24-
const data = await github.repos.get(context.repo)
24+
const data = await github.rest.repos.get(context.repo)
2525
return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0]
2626
- name: Checkout Self
2727
if: ${{ steps.default-branch.outputs.result == 'true' }}
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v4
2929
- name: Run Repolinter
3030
if: ${{ steps.default-branch.outputs.result == 'true' }}
3131
uses: newrelic/repolinter-action@v1

.github/workflows/test-agent.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ jobs:
3131
arch: [amd64, arm64]
3232
steps:
3333
- name: Checkout newrelic-php-agent code
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3535
with:
3636
path: php-agent
3737
- name: Enable arm64 emulation
3838
if: ${{ matrix.arch == 'arm64' }}
39-
uses: docker/setup-qemu-action@v2
39+
uses: docker/setup-qemu-action@v3
4040
with:
4141
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
4242
platforms: arm64
4343
- name: Login to Docker Hub
44-
uses: docker/login-action@v2
44+
uses: docker/login-action@v3
4545
with:
4646
username: ${{ secrets.DOCKERHUB_USERNAME }}
4747
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -91,17 +91,17 @@ jobs:
9191
codecov: 1
9292
steps:
9393
- name: Checkout Repo
94-
uses: actions/checkout@v3
94+
uses: actions/checkout@v4
9595
with:
9696
path: php-agent
9797
- name: Enable arm64 emulation
9898
if: ${{ matrix.arch == 'arm64' }}
99-
uses: docker/setup-qemu-action@v2
99+
uses: docker/setup-qemu-action@v3
100100
with:
101101
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
102102
platforms: arm64
103103
- name: Login to Docker Hub
104-
uses: docker/login-action@v2
104+
uses: docker/login-action@v3
105105
with:
106106
username: ${{ secrets.DOCKERHUB_USERNAME }}
107107
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -202,7 +202,7 @@ jobs:
202202
codecov: 1
203203
steps:
204204
- name: Checkout integration tests
205-
uses: actions/checkout@v3
205+
uses: actions/checkout@v4
206206
with:
207207
path: php-agent
208208
- name: Get integration_runner
@@ -233,12 +233,12 @@ jobs:
233233
chmod 755 php-agent/agent/modules/newrelic.so
234234
- name: Enable arm64 emulation
235235
if: ${{ matrix.arch == 'arm64' }}
236-
uses: docker/setup-qemu-action@v2
236+
uses: docker/setup-qemu-action@v3
237237
with:
238238
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
239239
platforms: arm64
240240
- name: Login to Docker Hub
241-
uses: docker/login-action@v2
241+
uses: docker/login-action@v3
242242
with:
243243
username: ${{ secrets.DOCKERHUB_USERNAME }}
244244
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -296,7 +296,7 @@ jobs:
296296
nr-php make gcov
297297
- name: Upload coverage reports to Codecov
298298
if: ${{ matrix.codecov == 1 }}
299-
uses: codecov/codecov-action@v3
299+
uses: codecov/codecov-action@v3.1.5
300300
with:
301301
token: ${{ secrets.CODECOV_TOKEN }}
302302
working-directory: ./php-agent

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.17.0
1+
10.18.0

agent/config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ if test "$PHP_NEWRELIC" = "yes"; then
216216
php_explain_pdo_mysql.c php_extension.c php_file_get_contents.c \
217217
php_globals.c php_hash.c php_header.c php_httprequest_send.c \
218218
php_internal_instrument.c php_minit.c php_mshutdown.c php_mysql.c \
219-
php_mysqli.c php_newrelic.c php_nrini.c php_output.c php_pdo.c \
219+
php_mysqli.c php_newrelic.c php_nrini.c php_observer.c php_output.c php_pdo.c \
220220
php_pdo_mysql.c php_pdo_pgsql.c php_pgsql.c php_psr7.c php_redis.c \
221221
php_rinit.c php_rshutdown.c php_samplers.c php_stack.c \
222222
php_stacked_segment.c php_txn.c php_user_instrument.c \

agent/fw_cakephp.c

+37
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ nr_framework_classification_t nr_cakephp_special_2(
3939
* Component::initialize(). This function takes a controller as a parameter
4040
* and we look into the params array of that controller object, and pick up
4141
* the controller and action out of that array.
42+
*
43+
* CakePHP 1.x is end-of-life and no longer supported by the agent.
44+
* Cake PHP 1.x does not support PHP 8+ and this wrapper is not updated for OAPI
45+
* compatibility.
46+
*
4247
*/
4348
NR_PHP_WRAPPER(nr_cakephp_name_the_wt_pre20) {
4449
zval* arg1 = 0;
@@ -130,6 +135,17 @@ NR_PHP_WRAPPER_END
130135
* and we get the action from the params array in that object. The
131136
* controller object ($this) has a name, and that name is used (along
132137
* with the word "Controller" appended which is what the CakePHP code does).
138+
*
139+
* CakePHP 2.x is end-of-life and in maintenance mode (critical bugfixes only).
140+
* As such, functionality added in PHP 7.1+ is not well supported.
141+
*
142+
* txn naming scheme:
143+
* In this case, `nr_txn_set_path` is called after `NR_PHP_WRAPPER_CALL` with
144+
* `NR_NOT_OK_TO_OVERWRITE`
145+
* This entails that the last wrapped call gets to name the txn.
146+
* No changes required to ensure OAPI compatibility this corresponds to the
147+
* default way of calling the wrapped function in func_end.
148+
*
133149
*/
134150
NR_PHP_WRAPPER(nr_cakephp_name_the_wt_2) {
135151
zval* arg1 = 0;
@@ -243,6 +259,11 @@ NR_PHP_WRAPPER_END
243259
*
244260
* Dispatch::cakeError will be called if there is a problem during dispatch
245261
* (action or controller not found).
262+
*
263+
* CakePHP 1.x is end-of-life and no longer supported by the agent.
264+
* Cake PHP 1.x does not support PHP 8+ and this wrapper is not updated for OAPI
265+
* compatibility.
266+
*
246267
*/
247268
NR_PHP_WRAPPER(nr_cakephp_problem_1) {
248269
const char* name = "Dispatcher::cakeError";
@@ -266,6 +287,16 @@ NR_PHP_WRAPPER_END
266287
* appropriate Exception will be created and thrown. We wrap the CakeException
267288
* constructor instead of the Exception handler, since CakePHP allows for the
268289
* handler to be completely replaced.
290+
*
291+
* CakePHP 2.x is end-of-life and in maintenance mode (critical bugfixes only).
292+
* As such, functionality added in PHP 7.1+ is not well supported.
293+
*
294+
* txn naming scheme:
295+
* In this case, `nr_txn_set_path` is called before `NR_PHP_WRAPPER_CALL` with
296+
* `NR_NOT_OK_TO_OVERWRITE` and as this corresponds to calling the wrapped
297+
* function in func_begin it needs to be explicitly set as a before_callback to
298+
* ensure OAPI compatibility. This entails that the first wrapped call gets to
299+
* name the txn.
269300
*/
270301
NR_PHP_WRAPPER(nr_cakephp_problem_2) {
271302
const char* name = "Exception";
@@ -298,6 +329,12 @@ void nr_cakephp_enable_1(TSRMLS_D) {
298329
void nr_cakephp_enable_2(TSRMLS_D) {
299330
nr_php_wrap_user_function(NR_PSTR("Controller::invokeAction"),
300331
nr_cakephp_name_the_wt_2 TSRMLS_CC);
332+
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
333+
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
334+
nr_php_wrap_user_function_before_after_clean(
335+
NR_PSTR("CakeException::__construct"), nr_cakephp_problem_2, NULL, NULL);
336+
#else
301337
nr_php_wrap_user_function(NR_PSTR("CakeException::__construct"),
302338
nr_cakephp_problem_2 TSRMLS_CC);
339+
#endif
303340
}

0 commit comments

Comments
 (0)