@@ -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
328328end :
329329 nr_php_arg_release (& arg1 );
330- NRPRG (drupal_http_request_depth ) -= 1 ;
330+ NRPRG_CTX (drupal_http_request_depth ) -= 1 ;
331331}
332332NR_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}
343343NR_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
445445end :
446446 nr_php_arg_release (& arg1 );
447- NRPRG (drupal_http_request_depth ) -= 1 ;
447+ NRPRG_CTX (drupal_http_request_depth ) -= 1 ;
448448}
449449NR_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
820821leave :
0 commit comments