Skip to content

Commit 1dcc17b

Browse files
committed
refactor(agent): remove oapi 'clean' callback
1 parent 1717ca9 commit 1dcc17b

22 files changed

+216
-221
lines changed

agent/fw_cakephp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ void nr_cakephp_enable_2(TSRMLS_D) {
331331
nr_cakephp_name_the_wt_2 TSRMLS_CC);
332332
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
333333
&& !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);
334+
nr_php_wrap_user_function_before_after(
335+
NR_PSTR("CakeException::__construct"), nr_cakephp_problem_2, NULL);
336336
#else
337337
nr_php_wrap_user_function(NR_PSTR("CakeException::__construct"),
338338
nr_cakephp_problem_2 TSRMLS_CC);

agent/fw_drupal.c

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ NR_PHP_WRAPPER(nr_drupal_http_request_after) {
301301
= nr_drupal_http_request_get_method(NR_EXECUTE_ORIG_ARGS);
302302

303303
external_params.encoded_response_header
304-
= nr_drupal_http_request_get_response_header(&func_return_value);
304+
= nr_drupal_http_request_get_response_header(NR_GET_RETURN_VALUE_PTR);
305305

306306
external_params.status
307-
= nr_drupal_http_request_get_response_code(&func_return_value);
307+
= nr_drupal_http_request_get_response_code(NR_GET_RETURN_VALUE_PTR);
308308
if (NRPRG(txn) && NRTXN(special_flags.debug_cat)) {
309309
nrl_verbosedebug(
310310
NRL_CAT, "CAT: outbound response: transport='Drupal 6-7' %s=" NRP_FMT,
@@ -327,16 +327,6 @@ NR_PHP_WRAPPER(nr_drupal_http_request_after) {
327327
}
328328
NR_PHP_WRAPPER_END
329329

330-
NR_PHP_WRAPPER(nr_drupal_http_request_clean) {
331-
NR_UNUSED_SPECIALFN;
332-
NR_UNUSED_FUNC_RETURN_VALUE;
333-
(void)wraprec;
334-
335-
NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_DRUPAL);
336-
337-
NRPRG(drupal_http_request_depth) -= 1;
338-
}
339-
NR_PHP_WRAPPER_END
340330
#else
341331

342332
/*
@@ -774,14 +764,6 @@ NR_PHP_WRAPPER(nr_drupal_wrap_module_invoke_all_after) {
774764
}
775765
NR_PHP_WRAPPER_END
776766

777-
NR_PHP_WRAPPER(nr_drupal_wrap_module_invoke_all_clean) {
778-
NR_UNUSED_SPECIALFN;
779-
NR_UNUSED_FUNC_RETURN_VALUE;
780-
(void)wraprec;
781-
nr_drupal_invoke_all_hook_stacks_pop();
782-
}
783-
NR_PHP_WRAPPER_END
784-
785767
#else
786768
NR_PHP_WRAPPER(nr_drupal_wrap_module_invoke_all) {
787769
zval* hook = NULL;
@@ -830,14 +812,14 @@ void nr_drupal_enable(TSRMLS_D) {
830812
nr_drupal_cron_run TSRMLS_CC);
831813
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
832814
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
833-
nr_php_wrap_user_function_before_after_clean(
834-
NR_PSTR("QFormBase::Run"), nr_drupal_qdrupal_name_the_wt, NULL, NULL);
835-
nr_php_wrap_user_function_before_after_clean(
815+
nr_php_wrap_user_function_before_after(
816+
NR_PSTR("QFormBase::Run"), nr_drupal_qdrupal_name_the_wt, NULL);
817+
nr_php_wrap_user_function_before_after(
836818
NR_PSTR("drupal_page_cache_header"), nr_drupal_name_wt_as_cached_page,
837-
NULL, NULL);
838-
nr_php_wrap_user_function_before_after_clean(
819+
NULL);
820+
nr_php_wrap_user_function_before_after(
839821
NR_PSTR("drupal_http_request"), nr_drupal_http_request_before,
840-
nr_drupal_http_request_after, nr_drupal_http_request_clean);
822+
nr_drupal_http_request_after);
841823
#else
842824
nr_php_wrap_user_function(NR_PSTR("QFormBase::Run"),
843825
nr_drupal_qdrupal_name_the_wt TSRMLS_CC);
@@ -856,10 +838,9 @@ void nr_drupal_enable(TSRMLS_D) {
856838
nr_drupal_wrap_module_invoke TSRMLS_CC);
857839
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
858840
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
859-
nr_php_wrap_user_function_before_after_clean(
841+
nr_php_wrap_user_function_before_after(
860842
NR_PSTR("module_invoke_all"), nr_drupal_wrap_module_invoke_all_before,
861-
nr_drupal_wrap_module_invoke_all_after,
862-
nr_drupal_wrap_module_invoke_all_clean);
843+
nr_drupal_wrap_module_invoke_all_after);
863844
#else
864845
nr_php_wrap_user_function(NR_PSTR("module_invoke_all"),
865846
nr_drupal_wrap_module_invoke_all TSRMLS_CC);

agent/fw_drupal8.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ static void nr_drupal8_add_method_callback(const zend_class_entry* ce,
7474

7575
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
7676
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
77-
static void nr_drupal8_add_method_callback_before_after_clean(
77+
static void nr_drupal8_add_method_callback_before_after(
7878
const zend_class_entry* ce,
7979
const char* method,
8080
size_t method_len,
8181
nrspecialfn_t before_callback,
82-
nrspecialfn_t after_callback,
83-
nrspecialfn_t clean_callback) {
82+
nrspecialfn_t after_callback) {
8483
zend_function* function = NULL;
8584

8685
if (NULL == ce) {
@@ -104,9 +103,9 @@ static void nr_drupal8_add_method_callback_before_after_clean(
104103
"%.*s::%.*s", NRSAFELEN(nr_php_class_entry_name_length(ce)),
105104
nr_php_class_entry_name(ce), NRSAFELEN(method_len), method);
106105

107-
nr_php_wrap_user_function_before_after_clean(
106+
nr_php_wrap_user_function_before_after(
108107
class_method, nr_strlen(class_method),
109-
before_callback, after_callback, clean_callback);
108+
before_callback, after_callback);
110109

111110
nr_free(class_method);
112111
}
@@ -540,12 +539,6 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_after) {
540539
nr_drupal_invoke_all_hook_stacks_pop();
541540
}
542541
NR_PHP_WRAPPER_END
543-
544-
NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_clean) {
545-
(void)wraprec;
546-
nr_drupal_invoke_all_hook_stacks_pop();
547-
}
548-
NR_PHP_WRAPPER_END
549542
#endif // OAPI
550543

551544
/*
@@ -582,11 +575,10 @@ NR_PHP_WRAPPER(nr_drupal8_module_handler) {
582575
/* Drupal 9.4 introduced a replacement method for getImplentations */
583576
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
584577
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
585-
nr_drupal8_add_method_callback_before_after_clean(
578+
nr_drupal8_add_method_callback_before_after(
586579
ce, NR_PSTR("invokeallwith"),
587580
nr_drupal94_invoke_all_with,
588-
nr_drupal94_invoke_all_with_after,
589-
nr_drupal94_invoke_all_with_clean);
581+
nr_drupal94_invoke_all_with_after);
590582
#else
591583
nr_drupal8_add_method_callback(ce, NR_PSTR("invokeallwith"),
592584
nr_drupal94_invoke_all_with TSRMLS_CC);
@@ -705,10 +697,10 @@ void nr_drupal8_enable(TSRMLS_D) {
705697
*/
706698
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
707699
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
708-
nr_php_wrap_user_function_before_after_clean(
700+
nr_php_wrap_user_function_before_after(
709701
NR_PSTR("Symfony\\Component\\HttpKernel\\EventListe"
710702
"ner\\RouterListener::onKernelRequest"),
711-
nr_drupal8_name_the_wt_via_symfony, NULL, NULL);
703+
nr_drupal8_name_the_wt_via_symfony, NULL);
712704
#else
713705
nr_php_wrap_user_function(NR_PSTR("Symfony\\Component\\HttpKernel\\EventListe"
714706
"ner\\RouterListener::onKernelRequest"),

agent/fw_laravel.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,8 @@ static void nr_laravel5_wrap_middleware(zval* app TSRMLS_DC) {
770770
Z_STRVAL_P(classname));
771771
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
772772
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
773-
nr_php_wrap_user_function_before_after_clean(
774-
name, nr_strlen(name), nr_laravel5_middleware_handle, NULL, NULL);
773+
nr_php_wrap_user_function_before_after(
774+
name, nr_strlen(name), nr_laravel5_middleware_handle, NULL);
775775
#else
776776
nr_php_wrap_user_function(name, nr_strlen(name),
777777
nr_laravel5_middleware_handle TSRMLS_CC);
@@ -831,8 +831,8 @@ static void nr_laravel_add_callback_method(const zend_class_entry* ce,
831831

832832
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
833833
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
834-
nr_php_wrap_user_function_before_after_clean(
835-
class_method, nr_strlen(class_method), callback, NULL, NULL);
834+
nr_php_wrap_user_function_before_after(
835+
class_method, nr_strlen(class_method), callback, NULL);
836836
#else
837837
nr_php_wrap_user_function(class_method, nr_strlen(class_method),
838838
callback TSRMLS_CC);
@@ -1226,9 +1226,9 @@ void nr_laravel_enable(TSRMLS_D) {
12261226
*/
12271227
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
12281228
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
1229-
nr_php_wrap_user_function_before_after_clean(
1229+
nr_php_wrap_user_function_before_after(
12301230
NR_PSTR("Illuminate\\Console\\Application::doRun"),
1231-
nr_laravel_console_application_dorun, NULL, NULL);
1231+
nr_laravel_console_application_dorun, NULL);
12321232
#else
12331233
nr_php_wrap_user_function(NR_PSTR("Illuminate\\Console\\Application::doRun"),
12341234
nr_laravel_console_application_dorun TSRMLS_CC);

agent/fw_laravel_queue.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -864,18 +864,18 @@ void nr_laravel_queue_enable(TSRMLS_D) {
864864
* took.
865865
*/
866866

867-
nr_php_wrap_user_function_before_after_clean(
867+
nr_php_wrap_user_function_before_after(
868868
NR_PSTR("Illuminate\\Queue\\Worker::raiseBeforeJobEvent"), NULL,
869-
nr_laravel_queue_worker_raiseBeforeJobEvent_after, NULL);
870-
nr_php_wrap_user_function_before_after_clean(
869+
nr_laravel_queue_worker_raiseBeforeJobEvent_after);
870+
nr_php_wrap_user_function_before_after(
871871
NR_PSTR("Illuminate\\Queue\\Worker::raiseAfterJobEvent"),
872-
nr_laravel_queue_worker_raiseAfterJobEvent_before, NULL, NULL);
873-
nr_php_wrap_user_function_before_after_clean(
872+
nr_laravel_queue_worker_raiseAfterJobEvent_before, NULL);
873+
nr_php_wrap_user_function_before_after(
874874
NR_PSTR("Illuminate\\Queue\\SyncQueue::raiseBeforeJobEvent"),
875-
nr_laravel_queue_syncqueue_raiseBeforeJobEvent_before, NULL, NULL);
876-
nr_php_wrap_user_function_before_after_clean(
875+
nr_laravel_queue_syncqueue_raiseBeforeJobEvent_before, NULL);
876+
nr_php_wrap_user_function_before_after(
877877
NR_PSTR("Illuminate\\Queue\\SyncQueue::raiseAfterJobEvent"),
878-
nr_laravel_queue_worker_raiseAfterJobEvent_before, NULL, NULL);
878+
nr_laravel_queue_worker_raiseAfterJobEvent_before, NULL);
879879

880880
#else
881881

agent/fw_lumen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ void nr_lumen_enable(TSRMLS_D) {
222222
nr_lumen_handle_found_route TSRMLS_CC);
223223
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
224224
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
225-
nr_php_wrap_user_function_before_after_clean(
225+
nr_php_wrap_user_function_before_after(
226226
NR_PSTR("Laravel\\Lumen\\Application::sendExceptionToHandler"),
227-
nr_lumen_exception, NULL, NULL);
227+
nr_lumen_exception, NULL);
228228
#else
229229
nr_php_wrap_user_function(
230230
NR_PSTR("Laravel\\Lumen\\Application::sendExceptionToHandler"),

agent/fw_magento2.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ void nr_magento2_enable(TSRMLS_D) {
440440
*/
441441
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
442442
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
443-
nr_php_wrap_user_function_before_after_clean(
443+
nr_php_wrap_user_function_before_after(
444444
NR_PSTR("Magento\\Framework\\App\\Action\\Action::dispatch"),
445-
nr_magento2_action_dispatch, NULL, NULL);
445+
nr_magento2_action_dispatch, NULL);
446446
#else
447447
nr_php_wrap_user_function(
448448
NR_PSTR("Magento\\Framework\\App\\Action\\Action::dispatch"),
@@ -472,10 +472,10 @@ void nr_magento2_enable(TSRMLS_D) {
472472
*/
473473
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
474474
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
475-
nr_php_wrap_user_function_before_after_clean(
475+
nr_php_wrap_user_function_before_after(
476476
NR_PSTR(
477477
"Magento\\Webapi\\Controller\\Rest\\InputParamsResolver::resolve"),
478-
nr_magento2_inputparamsresolver_resolve, NULL, NULL);
478+
nr_magento2_inputparamsresolver_resolve, NULL);
479479
#else
480480
nr_php_wrap_user_function(
481481
NR_PSTR(
@@ -497,14 +497,14 @@ void nr_magento2_enable(TSRMLS_D) {
497497
nr_magento2_soap_iswsdllistrequest TSRMLS_CC);
498498
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
499499
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
500-
nr_php_wrap_user_function_before_after_clean(
500+
nr_php_wrap_user_function_before_after(
501501
NR_PSTR("Magento\\Webapi\\Controller\\Soap\\Request\\Handler::_"
502502
"prepareRequestData"),
503-
nr_magento2_soap_handler_preparerequestdata, NULL, NULL);
504-
nr_php_wrap_user_function_before_after_clean(
503+
nr_magento2_soap_handler_preparerequestdata, NULL);
504+
nr_php_wrap_user_function_before_after(
505505
NR_PSTR("Magento\\Webapi\\Controller\\Soap\\Request\\Handler::"
506506
"prepareOperationInput"),
507-
nr_magento2_soap_handler_prepareoperationinput, NULL, NULL);
507+
nr_magento2_soap_handler_prepareoperationinput, NULL);
508508

509509
#else
510510
nr_php_wrap_user_function(

agent/fw_symfony4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ void nr_symfony4_enable(TSRMLS_D) {
267267
*/
268268
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
269269
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
270-
nr_php_wrap_user_function_before_after_clean(
270+
nr_php_wrap_user_function_before_after(
271271
NR_PSTR("Symfony\\Component\\Console\\Command\\Command::run"),
272-
nr_symfony4_console_application_run, NULL, NULL);
272+
nr_symfony4_console_application_run, NULL);
273273
#else
274274
nr_php_wrap_user_function(
275275
NR_PSTR("Symfony\\Component\\Console\\Command\\Command::run"),

agent/fw_wordpress.c

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -681,16 +681,6 @@ NR_PHP_WRAPPER(nr_wordpress_handle_tag_stack_after) {
681681
}
682682
NR_PHP_WRAPPER_END
683683

684-
NR_PHP_WRAPPER(nr_wordpress_handle_tag_stack_clean) {
685-
NR_UNUSED_SPECIALFN;
686-
NR_UNUSED_FUNC_RETURN_VALUE;
687-
(void)wraprec;
688-
if (0 != NRINI(wordpress_hooks)) {
689-
clean_wordpress_tag_stack(auto_segment);
690-
}
691-
}
692-
NR_PHP_WRAPPER_END
693-
694684
NR_PHP_WRAPPER(nr_wordpress_apply_filters_after) {
695685
/* using nr_php_get_user_func_arg() so that we don't perform another copy
696686
* when all we want to do is check the string length */
@@ -762,8 +752,8 @@ NR_PHP_WRAPPER(nr_wordpress_add_filter) {
762752
if (NULL != wordpress_plugin_theme || NRPRG(wordpress_core)) {
763753
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
764754
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
765-
callback_wraprec = nr_php_wrap_callable_before_after_clean(
766-
zf, NULL, nr_wordpress_wrap_hook, nr_wordpress_wrap_hook);
755+
callback_wraprec = nr_php_wrap_callable_before_after(
756+
zf, NULL, nr_wordpress_wrap_hook);
767757
#else
768758
callback_wraprec = nr_php_wrap_callable(zf, nr_wordpress_wrap_hook);
769759
#endif
@@ -818,22 +808,22 @@ void nr_wordpress_version() {
818808
void nr_wordpress_enable(TSRMLS_D) {
819809
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
820810
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
821-
nr_php_wrap_user_function_before_after_clean(
811+
nr_php_wrap_user_function_before_after(
822812
NR_PSTR("apply_filters"), nr_wordpress_apply_filters,
823-
nr_wordpress_apply_filters_after, nr_wordpress_handle_tag_stack_clean);
813+
nr_wordpress_apply_filters_after);
824814

825815
if (0 != NRINI(wordpress_hooks)) {
826-
nr_php_wrap_user_function_before_after_clean(
816+
nr_php_wrap_user_function_before_after(
827817
NR_PSTR("apply_filters_ref_array"), nr_wordpress_exec_handle_tag,
828-
nr_wordpress_handle_tag_stack_after, nr_wordpress_handle_tag_stack_clean);
818+
nr_wordpress_handle_tag_stack_after);
829819

830-
nr_php_wrap_user_function_before_after_clean(
820+
nr_php_wrap_user_function_before_after(
831821
NR_PSTR("do_action"), nr_wordpress_exec_handle_tag,
832-
nr_wordpress_handle_tag_stack_after, nr_wordpress_handle_tag_stack_clean);
822+
nr_wordpress_handle_tag_stack_after);
833823

834-
nr_php_wrap_user_function_before_after_clean(
824+
nr_php_wrap_user_function_before_after(
835825
NR_PSTR("do_action_ref_array"), nr_wordpress_exec_handle_tag,
836-
nr_wordpress_handle_tag_stack_after, nr_wordpress_handle_tag_stack_clean);
826+
nr_wordpress_handle_tag_stack_after);
837827
if (0 != NRPRG(wordpress_plugins)) {
838828
nr_php_wrap_user_function(NR_PSTR("add_filter"), nr_wordpress_add_filter);
839829
}

agent/fw_yii.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,11 @@ NR_PHP_WRAPPER_END
9191
void nr_yii_enable(TSRMLS_D) {
9292
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
9393
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
94-
nr_php_wrap_user_function_before_after_clean(
95-
NR_PSTR("CAction::runWithParams"), nr_yii_runWithParams_wrapper, NULL,
96-
NULL);
97-
nr_php_wrap_user_function_before_after_clean(
94+
nr_php_wrap_user_function_before_after(
95+
NR_PSTR("CAction::runWithParams"), nr_yii_runWithParams_wrapper, NULL);
96+
nr_php_wrap_user_function_before_after(
9897
NR_PSTR("CInlineAction::runWithParams"), nr_yii_runWithParams_wrapper,
99-
NULL, NULL);
98+
NULL);
10099
#else
101100
nr_php_wrap_user_function(NR_PSTR("CAction::runWithParams"),
102101
nr_yii_runWithParams_wrapper TSRMLS_CC);

0 commit comments

Comments
 (0)