Skip to content

Commit 6941f6e

Browse files
ZNeumannlavarou
authored andcommitted
refactor(agent): remove oapi 'clean' callback
1 parent ef7200a commit 6941f6e

24 files changed

+262
-269
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
@@ -303,10 +303,10 @@ NR_PHP_WRAPPER(nr_drupal_http_request_after) {
303303
= nr_drupal_http_request_get_method(NR_EXECUTE_ORIG_ARGS);
304304

305305
external_params.encoded_response_header
306-
= nr_drupal_http_request_get_response_header(&func_return_value);
306+
= nr_drupal_http_request_get_response_header(NR_GET_RETURN_VALUE_PTR);
307307

308308
external_params.status
309-
= nr_drupal_http_request_get_response_code(&func_return_value);
309+
= nr_drupal_http_request_get_response_code(NR_GET_RETURN_VALUE_PTR);
310310
if (NRPRG(txn) && NRTXN(special_flags.debug_cat)) {
311311
nrl_verbosedebug(
312312
NRL_CAT, "CAT: outbound response: transport='Drupal 6-7' %s=" NRP_FMT,
@@ -329,16 +329,6 @@ NR_PHP_WRAPPER(nr_drupal_http_request_after) {
329329
}
330330
NR_PHP_WRAPPER_END
331331

332-
NR_PHP_WRAPPER(nr_drupal_http_request_clean) {
333-
NR_UNUSED_SPECIALFN;
334-
NR_UNUSED_FUNC_RETURN_VALUE;
335-
(void)wraprec;
336-
337-
NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_DRUPAL);
338-
339-
NRPRG(drupal_http_request_depth) -= 1;
340-
}
341-
NR_PHP_WRAPPER_END
342332
#else
343333

344334
/*
@@ -776,14 +766,6 @@ NR_PHP_WRAPPER(nr_drupal_wrap_module_invoke_all_after) {
776766
}
777767
NR_PHP_WRAPPER_END
778768

779-
NR_PHP_WRAPPER(nr_drupal_wrap_module_invoke_all_clean) {
780-
NR_UNUSED_SPECIALFN;
781-
NR_UNUSED_FUNC_RETURN_VALUE;
782-
(void)wraprec;
783-
nr_drupal_invoke_all_hook_stacks_pop();
784-
}
785-
NR_PHP_WRAPPER_END
786-
787769
#else
788770
NR_PHP_WRAPPER(nr_drupal_wrap_module_invoke_all) {
789771
zval* hook = NULL;
@@ -832,14 +814,14 @@ void nr_drupal_enable(TSRMLS_D) {
832814
nr_drupal_cron_run TSRMLS_CC);
833815
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
834816
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
835-
nr_php_wrap_user_function_before_after_clean(
836-
NR_PSTR("QFormBase::Run"), nr_drupal_qdrupal_name_the_wt, NULL, NULL);
837-
nr_php_wrap_user_function_before_after_clean(
817+
nr_php_wrap_user_function_before_after(
818+
NR_PSTR("QFormBase::Run"), nr_drupal_qdrupal_name_the_wt, NULL);
819+
nr_php_wrap_user_function_before_after(
838820
NR_PSTR("drupal_page_cache_header"), nr_drupal_name_wt_as_cached_page,
839-
NULL, NULL);
840-
nr_php_wrap_user_function_before_after_clean(
821+
NULL);
822+
nr_php_wrap_user_function_before_after(
841823
NR_PSTR("drupal_http_request"), nr_drupal_http_request_before,
842-
nr_drupal_http_request_after, nr_drupal_http_request_clean);
824+
nr_drupal_http_request_after);
843825
#else
844826
nr_php_wrap_user_function(NR_PSTR("QFormBase::Run"),
845827
nr_drupal_qdrupal_name_the_wt TSRMLS_CC);
@@ -858,10 +840,9 @@ void nr_drupal_enable(TSRMLS_D) {
858840
nr_drupal_wrap_module_invoke TSRMLS_CC);
859841
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
860842
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
861-
nr_php_wrap_user_function_before_after_clean(
843+
nr_php_wrap_user_function_before_after(
862844
NR_PSTR("module_invoke_all"), nr_drupal_wrap_module_invoke_all_before,
863-
nr_drupal_wrap_module_invoke_all_after,
864-
nr_drupal_wrap_module_invoke_all_clean);
845+
nr_drupal_wrap_module_invoke_all_after);
865846
#else
866847
nr_php_wrap_user_function(NR_PSTR("module_invoke_all"),
867848
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
@@ -76,13 +76,12 @@ static void nr_drupal8_add_method_callback(const zend_class_entry* ce,
7676

7777
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
7878
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
79-
static void nr_drupal8_add_method_callback_before_after_clean(
79+
static void nr_drupal8_add_method_callback_before_after(
8080
const zend_class_entry* ce,
8181
const char* method,
8282
size_t method_len,
8383
nrspecialfn_t before_callback,
84-
nrspecialfn_t after_callback,
85-
nrspecialfn_t clean_callback) {
84+
nrspecialfn_t after_callback) {
8685
zend_function* function = NULL;
8786

8887
if (NULL == ce) {
@@ -106,9 +105,9 @@ static void nr_drupal8_add_method_callback_before_after_clean(
106105
"%.*s::%.*s", NRSAFELEN(nr_php_class_entry_name_length(ce)),
107106
nr_php_class_entry_name(ce), NRSAFELEN(method_len), method);
108107

109-
nr_php_wrap_user_function_before_after_clean(
108+
nr_php_wrap_user_function_before_after(
110109
class_method, nr_strlen(class_method),
111-
before_callback, after_callback, clean_callback);
110+
before_callback, after_callback);
112111

113112
nr_free(class_method);
114113
}
@@ -542,12 +541,6 @@ NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_after) {
542541
nr_drupal_invoke_all_hook_stacks_pop();
543542
}
544543
NR_PHP_WRAPPER_END
545-
546-
NR_PHP_WRAPPER(nr_drupal94_invoke_all_with_clean) {
547-
(void)wraprec;
548-
nr_drupal_invoke_all_hook_stacks_pop();
549-
}
550-
NR_PHP_WRAPPER_END
551544
#endif // OAPI
552545

553546
/*
@@ -584,11 +577,10 @@ NR_PHP_WRAPPER(nr_drupal8_module_handler) {
584577
/* Drupal 9.4 introduced a replacement method for getImplentations */
585578
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
586579
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
587-
nr_drupal8_add_method_callback_before_after_clean(
580+
nr_drupal8_add_method_callback_before_after(
588581
ce, NR_PSTR("invokeallwith"),
589582
nr_drupal94_invoke_all_with,
590-
nr_drupal94_invoke_all_with_after,
591-
nr_drupal94_invoke_all_with_clean);
583+
nr_drupal94_invoke_all_with_after);
592584
#else
593585
nr_drupal8_add_method_callback(ce, NR_PSTR("invokeallwith"),
594586
nr_drupal94_invoke_all_with TSRMLS_CC);
@@ -711,10 +703,10 @@ void nr_drupal8_enable(TSRMLS_D) {
711703
*/
712704
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
713705
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
714-
nr_php_wrap_user_function_before_after_clean(
706+
nr_php_wrap_user_function_before_after(
715707
NR_PSTR("Symfony\\Component\\HttpKernel\\EventListe"
716708
"ner\\RouterListener::onKernelRequest"),
717-
nr_drupal8_name_the_wt_via_symfony, NULL, NULL);
709+
nr_drupal8_name_the_wt_via_symfony, NULL);
718710
#else
719711
nr_php_wrap_user_function(NR_PSTR("Symfony\\Component\\HttpKernel\\EventListe"
720712
"ner\\RouterListener::onKernelRequest"),

agent/fw_laravel.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,8 @@ static void nr_laravel5_wrap_middleware(zval* app TSRMLS_DC) {
772772
Z_STRVAL_P(classname));
773773
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
774774
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
775-
nr_php_wrap_user_function_before_after_clean(
776-
name, nr_strlen(name), nr_laravel5_middleware_handle, NULL, NULL);
775+
nr_php_wrap_user_function_before_after(
776+
name, nr_strlen(name), nr_laravel5_middleware_handle, NULL);
777777
#else
778778
nr_php_wrap_user_function(name, nr_strlen(name),
779779
nr_laravel5_middleware_handle TSRMLS_CC);
@@ -833,8 +833,8 @@ static void nr_laravel_add_callback_method(const zend_class_entry* ce,
833833

834834
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
835835
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
836-
nr_php_wrap_user_function_before_after_clean(
837-
class_method, nr_strlen(class_method), callback, NULL, NULL);
836+
nr_php_wrap_user_function_before_after(
837+
class_method, nr_strlen(class_method), callback, NULL);
838838
#else
839839
nr_php_wrap_user_function(class_method, nr_strlen(class_method),
840840
callback TSRMLS_CC);
@@ -1230,9 +1230,9 @@ void nr_laravel_enable(TSRMLS_D) {
12301230
*/
12311231
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
12321232
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
1233-
nr_php_wrap_user_function_before_after_clean(
1233+
nr_php_wrap_user_function_before_after(
12341234
NR_PSTR("Illuminate\\Console\\Application::doRun"),
1235-
nr_laravel_console_application_dorun, NULL, NULL);
1235+
nr_laravel_console_application_dorun, NULL);
12361236
#else
12371237
nr_php_wrap_user_function(NR_PSTR("Illuminate\\Console\\Application::doRun"),
12381238
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_slim.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,17 @@ void nr_slim_enable(TSRMLS_D) {
181181
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
182182

183183
/* Slim 3 */
184-
nr_php_wrap_user_function_before_after_clean(
185-
NR_PSTR("Slim\\Route::run"), nr_slim3_4_route_run, NULL, NULL);
184+
nr_php_wrap_user_function_before_after(
185+
NR_PSTR("Slim\\Route::run"), nr_slim3_4_route_run, NULL);
186186

187187
/* Slim 4 */
188-
nr_php_wrap_user_function_before_after_clean(
189-
NR_PSTR("Slim\\Routing\\Route::run"), nr_slim3_4_route_run, NULL, NULL);
188+
nr_php_wrap_user_function_before_after(
189+
NR_PSTR("Slim\\Routing\\Route::run"), nr_slim3_4_route_run, NULL);
190190

191191
/* Slim 4 */
192-
nr_php_wrap_user_function_before_after_clean(
192+
nr_php_wrap_user_function_before_after(
193193
NR_PSTR("Slim\\Routing\\Dispatcher::dispatch"), nr_slim4_route_dispatch,
194-
NULL, NULL);
194+
NULL);
195195
#else
196196
/* Slim 4*/
197197
nr_php_wrap_user_function(NR_PSTR("Slim\\Routing\\Route::run"),

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
@@ -682,16 +682,6 @@ NR_PHP_WRAPPER(nr_wordpress_handle_tag_stack_after) {
682682
}
683683
NR_PHP_WRAPPER_END
684684

685-
NR_PHP_WRAPPER(nr_wordpress_handle_tag_stack_clean) {
686-
NR_UNUSED_SPECIALFN;
687-
NR_UNUSED_FUNC_RETURN_VALUE;
688-
(void)wraprec;
689-
if (0 != NRINI(wordpress_hooks)) {
690-
clean_wordpress_tag_stack(auto_segment);
691-
}
692-
}
693-
NR_PHP_WRAPPER_END
694-
695685
NR_PHP_WRAPPER(nr_wordpress_apply_filters_after) {
696686
/* using nr_php_get_user_func_arg() so that we don't perform another copy
697687
* when all we want to do is check the string length */
@@ -763,8 +753,8 @@ NR_PHP_WRAPPER(nr_wordpress_add_filter) {
763753
if (NULL != wordpress_plugin_theme || NRPRG(wordpress_core)) {
764754
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
765755
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
766-
callback_wraprec = nr_php_wrap_callable_before_after_clean(
767-
zf, NULL, nr_wordpress_wrap_hook, nr_wordpress_wrap_hook);
756+
callback_wraprec = nr_php_wrap_callable_before_after(
757+
zf, NULL, nr_wordpress_wrap_hook);
768758
#else
769759
callback_wraprec = nr_php_wrap_callable(zf, nr_wordpress_wrap_hook);
770760
#endif
@@ -823,22 +813,22 @@ void nr_wordpress_version() {
823813
void nr_wordpress_enable(TSRMLS_D) {
824814
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
825815
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
826-
nr_php_wrap_user_function_before_after_clean(
816+
nr_php_wrap_user_function_before_after(
827817
NR_PSTR("apply_filters"), nr_wordpress_apply_filters,
828-
nr_wordpress_apply_filters_after, nr_wordpress_handle_tag_stack_clean);
818+
nr_wordpress_apply_filters_after);
829819

830820
if (0 != NRINI(wordpress_hooks)) {
831-
nr_php_wrap_user_function_before_after_clean(
821+
nr_php_wrap_user_function_before_after(
832822
NR_PSTR("apply_filters_ref_array"), nr_wordpress_exec_handle_tag,
833-
nr_wordpress_handle_tag_stack_after, nr_wordpress_handle_tag_stack_clean);
823+
nr_wordpress_handle_tag_stack_after);
834824

835-
nr_php_wrap_user_function_before_after_clean(
825+
nr_php_wrap_user_function_before_after(
836826
NR_PSTR("do_action"), nr_wordpress_exec_handle_tag,
837-
nr_wordpress_handle_tag_stack_after, nr_wordpress_handle_tag_stack_clean);
827+
nr_wordpress_handle_tag_stack_after);
838828

839-
nr_php_wrap_user_function_before_after_clean(
829+
nr_php_wrap_user_function_before_after(
840830
NR_PSTR("do_action_ref_array"), nr_wordpress_exec_handle_tag,
841-
nr_wordpress_handle_tag_stack_after, nr_wordpress_handle_tag_stack_clean);
831+
nr_wordpress_handle_tag_stack_after);
842832
if (0 != NRPRG(wordpress_plugins)) {
843833
nr_php_wrap_user_function(NR_PSTR("add_filter"), nr_wordpress_add_filter);
844834
}

0 commit comments

Comments
 (0)