Skip to content

Commit 9d69fac

Browse files
authored
Merge pull request #1218 from newrelic/dev
Release 12.7
2 parents 350fd1d + aab9dd1 commit 9d69fac

126 files changed

Lines changed: 2951 additions & 1873 deletions

File tree

Some content is hidden

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

.github/workflows/release-build.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.6.0
1+
12.7.0

agent/fw_cakephp.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ NR_PHP_WRAPPER(nr_cakephp_name_the_wt_4) {
8888
action_zval = nr_php_call(request, "getParam", &action_param);
8989
zval_dtor(&action_param);
9090
if (!nr_php_is_zval_non_empty_string(action_zval)) {
91-
nrl_verbosedebug(NRL_FRAMEWORK, "CakePHP: no action param found in request");
91+
nrl_verbosedebug(NRL_FRAMEWORK,
92+
"CakePHP: no action param found in request");
9293
goto end;
9394
} else {
9495
alen = Z_STRLEN_P(action_zval);
@@ -149,13 +150,13 @@ NR_PHP_WRAPPER(nr_cakephp_error_handler_wrapper) {
149150
if (NR_SUCCESS
150151
!= nr_php_error_record_exception(
151152
NRPRG(txn), exception, nr_php_error_get_priority(E_ERROR), true,
152-
"Uncaught exception ", &NRPRG(exception_filters))) {
153+
"Uncaught exception ", &NRPRG_SHARED(exception_filters))) {
153154
nrl_verbosedebug(NRL_FRAMEWORK, "%s: unable to record exception", __func__);
154155
}
155156

156157
if (NULL != request_uri) {
157-
nr_txn_set_path("CakePHP Exception", NRPRG(txn), request_uri, NR_PATH_TYPE_URI,
158-
NR_OK_TO_OVERWRITE);
158+
nr_txn_set_path("CakePHP Exception", NRPRG(txn), request_uri,
159+
NR_PATH_TYPE_URI, NR_OK_TO_OVERWRITE);
159160
} else {
160161
nrl_verbosedebug(NRL_FRAMEWORK, "%s: request uri is NULL", __func__);
161162
}

agent/fw_codeigniter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static void nr_codeigniter_name_the_wt(zend_function* func,
3737
TSRMLS_DC) {
3838
zend_op_array* op_array = NULL;
3939

40-
if ((NR_FW_CODEIGNITER != NRPRG(current_framework) || (NULL == func)
40+
if ((NR_FW_CODEIGNITER != NRPRG_SHARED(current_framework) || (NULL == func)
4141
|| (NULL == func->common.scope))) {
4242
return;
4343
}

agent/fw_drupal.c

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -246,29 +246,29 @@ NR_PHP_WRAPPER(nr_drupal_http_request_before) {
246246

247247
NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_DRUPAL);
248248

249-
NRPRG(drupal_http_request_depth) += 1;
249+
NRPRG_CTX(drupal_http_request_depth) += 1;
250250

251251
/*
252252
* We only want to create a metric here if this isn't a recursive call to
253253
* drupal_http_request() caused by the original call returning a redirect.
254254
* We can check how many drupal_http_request() calls are on the stack by
255255
* checking a counter.
256256
*/
257-
if (1 == NRPRG(drupal_http_request_depth)) {
257+
if (1 == NRPRG_CTX(drupal_http_request_depth)) {
258258
/*
259259
* Parent this segment to the txn root so as to not interfere with
260260
* the OAPI default segment stack, which is used to dispatch to the
261261
* after function properly
262262
*/
263-
NRPRG(drupal_http_request_segment)
263+
NRPRG_CTX(drupal_http_request_segment)
264264
= nr_segment_start(NRPRG(txn), NULL, NULL);
265265
/*
266266
* The new segment needs to have the wraprec data attached, so that
267267
* fcall_end is able to properly dispatch to the after wrapper, as
268268
* this new segment is now at the top of the segment stack.
269269
*/
270-
if (NULL != NRPRG(drupal_http_request_segment)) {
271-
NRPRG(drupal_http_request_segment)->wraprec = auto_segment->wraprec;
270+
if (NULL != NRPRG_CTX(drupal_http_request_segment)) {
271+
NRPRG_CTX(drupal_http_request_segment)->wraprec = auto_segment->wraprec;
272272
}
273273
}
274274
}
@@ -296,7 +296,7 @@ NR_PHP_WRAPPER(nr_drupal_http_request_after) {
296296
* We can check how many drupal_http_request() calls are on the stack by
297297
* checking a counter.
298298
*/
299-
if (1 == NRPRG(drupal_http_request_depth)) {
299+
if (1 == NRPRG_CTX(drupal_http_request_depth)) {
300300
nr_segment_external_params_t external_params
301301
= {.library = "Drupal",
302302
.uri = nr_strndup(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1))};
@@ -316,9 +316,9 @@ NR_PHP_WRAPPER(nr_drupal_http_request_after) {
316316
NRP_CAT(external_params.encoded_response_header));
317317
}
318318

319-
nr_segment_external_end(&NRPRG(drupal_http_request_segment),
319+
nr_segment_external_end(&NRPRG_CTX(drupal_http_request_segment),
320320
&external_params);
321-
NRPRG(drupal_http_request_segment) = NULL;
321+
NRPRG_CTX(drupal_http_request_segment) = NULL;
322322

323323
nr_free(external_params.encoded_response_header);
324324
nr_free(external_params.procedure);
@@ -327,7 +327,7 @@ NR_PHP_WRAPPER(nr_drupal_http_request_after) {
327327

328328
end:
329329
nr_php_arg_release(&arg1);
330-
NRPRG(drupal_http_request_depth) -= 1;
330+
NRPRG_CTX(drupal_http_request_depth) -= 1;
331331
}
332332
NR_PHP_WRAPPER_END
333333

@@ -338,7 +338,7 @@ NR_PHP_WRAPPER(nr_drupal_http_request_clean) {
338338

339339
NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_DRUPAL);
340340

341-
NRPRG(drupal_http_request_depth) -= 1;
341+
NRPRG_CTX(drupal_http_request_depth) -= 1;
342342
}
343343
NR_PHP_WRAPPER_END
344344
#else
@@ -383,7 +383,7 @@ NR_PHP_WRAPPER(nr_drupal_http_request_exec) {
383383

384384
NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_DRUPAL);
385385

386-
NRPRG(drupal_http_request_depth) += 1;
386+
NRPRG_CTX(drupal_http_request_depth) += 1;
387387

388388
/*
389389
* Grab the URL for the external metric, which is the first parameter in all
@@ -403,7 +403,7 @@ NR_PHP_WRAPPER(nr_drupal_http_request_exec) {
403403
* We can check how many drupal_http_request() calls are on the stack by
404404
* checking a counter.
405405
*/
406-
if (1 == NRPRG(drupal_http_request_depth)) {
406+
if (1 == NRPRG_CTX(drupal_http_request_depth)) {
407407
nr_segment_t* segment;
408408
nr_segment_external_params_t external_params
409409
= {.library = "Drupal",
@@ -444,7 +444,7 @@ NR_PHP_WRAPPER(nr_drupal_http_request_exec) {
444444

445445
end:
446446
nr_php_arg_release(&arg1);
447-
NRPRG(drupal_http_request_depth) -= 1;
447+
NRPRG_CTX(drupal_http_request_depth) -= 1;
448448
}
449449
NR_PHP_WRAPPER_END
450450

@@ -484,7 +484,8 @@ static void nr_drupal_wrap_hook_within_module_invoke_all(
484484
*/
485485
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
486486
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
487-
zval* curr_hook = (zval*)nr_stack_get_top(&NRPRG(drupal_invoke_all_hooks));
487+
zval* curr_hook
488+
= (zval*)nr_stack_get_top(&NRPRG_CTX(drupal_invoke_all_hooks));
488489
if (!nr_php_is_zval_non_empty_string(curr_hook)) {
489490
nrl_verbosedebug(NRL_FRAMEWORK,
490491
"%s: cannot extract hook name from global stack",
@@ -494,8 +495,8 @@ static void nr_drupal_wrap_hook_within_module_invoke_all(
494495
char* hook_name = Z_STRVAL_P(curr_hook);
495496
size_t hook_len = Z_STRLEN_P(curr_hook);
496497
#else
497-
char* hook_name = NRPRG(drupal_invoke_all_hook);
498-
size_t hook_len = NRPRG(drupal_invoke_all_hook_len);
498+
char* hook_name = NRPRG_CTX(drupal_invoke_all_hook);
499+
size_t hook_len = NRPRG_CTX(drupal_invoke_all_hook_len);
499500
#endif
500501
if (NULL == hook_name) {
501502
nrl_verbosedebug(NRL_FRAMEWORK,
@@ -542,7 +543,7 @@ static void nr_drupal_call_user_func_array_callback(zend_function* func,
542543
return;
543544
}
544545

545-
if (!nr_drupal_is_framework(NRPRG(current_framework))) {
546+
if (!nr_drupal_is_framework(NRPRG_SHARED(current_framework))) {
546547
return;
547548
}
548549

@@ -801,20 +802,20 @@ NR_PHP_WRAPPER(nr_drupal_wrap_module_invoke_all) {
801802
goto leave;
802803
}
803804

804-
prev_hook = NRPRG(drupal_invoke_all_hook);
805-
prev_hook_len = NRPRG(drupal_invoke_all_hook_len);
806-
NRPRG(drupal_invoke_all_hook)
805+
prev_hook = NRPRG_CTX(drupal_invoke_all_hook);
806+
prev_hook_len = NRPRG_CTX(drupal_invoke_all_hook_len);
807+
NRPRG_CTX(drupal_invoke_all_hook)
807808
= nr_strndup(Z_STRVAL_P(hook), Z_STRLEN_P(hook));
808-
NRPRG(drupal_invoke_all_hook_len) = Z_STRLEN_P(hook);
809-
NRPRG(check_cufa) = true;
809+
NRPRG_CTX(drupal_invoke_all_hook_len) = Z_STRLEN_P(hook);
810+
NRPRG_CTX(check_cufa) = true;
810811

811812
NR_PHP_WRAPPER_CALL;
812813

813-
nr_free(NRPRG(drupal_invoke_all_hook));
814-
NRPRG(drupal_invoke_all_hook) = prev_hook;
815-
NRPRG(drupal_invoke_all_hook_len) = prev_hook_len;
816-
if (NULL == NRPRG(drupal_invoke_all_hook)) {
817-
NRPRG(check_cufa) = false;
814+
nr_free(NRPRG_CTX(drupal_invoke_all_hook));
815+
NRPRG_CTX(drupal_invoke_all_hook) = prev_hook;
816+
NRPRG_CTX(drupal_invoke_all_hook_len) = prev_hook_len;
817+
if (NULL == NRPRG_CTX(drupal_invoke_all_hook)) {
818+
NRPRG_CTX(check_cufa) = false;
818819
}
819820

820821
leave:

agent/fw_drupal8.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ NR_PHP_WRAPPER(nr_drupal_exception) {
6666

6767
if (NR_SUCCESS
6868
!= nr_php_error_record_exception(NRPRG(txn), exception, priority, true,
69-
NULL, &NRPRG(exception_filters))) {
69+
NULL,
70+
&NRPRG_SHARED(exception_filters))) {
7071
nrl_verbosedebug(NRL_TXN, "Drupal: unable to record exception");
7172
}
7273

@@ -499,7 +500,8 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_callback) {
499500

500501
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
501502
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
502-
zval* curr_hook = (zval*)nr_stack_get_top(&NRPRG(drupal_invoke_all_hooks));
503+
zval* curr_hook
504+
= (zval*)nr_stack_get_top(&NRPRG_CTX(drupal_invoke_all_hooks));
503505
if (UNEXPECTED(!nr_php_is_zval_non_empty_string(curr_hook))) {
504506
nrl_verbosedebug(NRL_FRAMEWORK,
505507
"%s: cannot extract hook name from global stack",
@@ -510,8 +512,8 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_callback) {
510512
Z_STRVAL_P(curr_hook), Z_STRLEN_P(curr_hook));
511513
#else
512514
nr_drupal_hook_instrument(Z_STRVAL_P(module), Z_STRLEN_P(module),
513-
NRPRG(drupal_invoke_all_hook),
514-
NRPRG(drupal_invoke_all_hook_len) TSRMLS_CC);
515+
NRPRG_CTX(drupal_invoke_all_hook),
516+
NRPRG_CTX(drupal_invoke_all_hook_len) TSRMLS_CC);
515517
#endif // OAPI
516518

517519
leave:
@@ -552,12 +554,12 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with) {
552554
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
553555
nr_drupal_invoke_all_hook_stacks_push(hook);
554556
#else
555-
prev_hook = NRPRG(drupal_invoke_all_hook);
556-
prev_hook_len = NRPRG(drupal_invoke_all_hook_len);
557-
NRPRG(drupal_invoke_all_hook)
557+
prev_hook = NRPRG_CTX(drupal_invoke_all_hook);
558+
prev_hook_len = NRPRG_CTX(drupal_invoke_all_hook_len);
559+
NRPRG_CTX(drupal_invoke_all_hook)
558560
= nr_strndup(Z_STRVAL_P(hook), Z_STRLEN_P(hook));
559-
NRPRG(drupal_invoke_all_hook_len) = Z_STRLEN_P(hook);
560-
NRPRG(check_cufa) = true;
561+
NRPRG_CTX(drupal_invoke_all_hook_len) = Z_STRLEN_P(hook);
562+
NRPRG_CTX(check_cufa) = true;
561563
#endif // OAPI
562564
callback = nr_php_arg_get(2, NR_EXECUTE_ORIG_ARGS TSRMLS_CC);
563565

@@ -572,11 +574,11 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with) {
572574
nr_php_arg_release(&callback);
573575
#if ZEND_MODULE_API_NO < ZEND_8_0_X_API_NO \
574576
|| defined OVERWRITE_ZEND_EXECUTE_DATA
575-
nr_free(NRPRG(drupal_invoke_all_hook));
576-
NRPRG(drupal_invoke_all_hook) = prev_hook;
577-
NRPRG(drupal_invoke_all_hook_len) = prev_hook_len;
578-
if (NULL == NRPRG(drupal_invoke_all_hook)) {
579-
NRPRG(check_cufa) = false;
577+
nr_free(NRPRG_CTX(drupal_invoke_all_hook));
578+
NRPRG_CTX(drupal_invoke_all_hook) = prev_hook;
579+
NRPRG_CTX(drupal_invoke_all_hook_len) = prev_hook_len;
580+
if (NULL == NRPRG_CTX(drupal_invoke_all_hook)) {
581+
NRPRG_CTX(check_cufa) = false;
580582
}
581583
#endif // not OAPI
582584

0 commit comments

Comments
 (0)