Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(agent): Utilize OAPI to automatically dispatch to wrappers #886

Draft
wants to merge 23 commits into
base: zjn/oapi/remove-clean
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixups
ZNeumann authored and lavarou committed Nov 6, 2024

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso
commit 8c97ad448a0bfcb12381d4b6ba3d40e590ba739f
2 changes: 2 additions & 0 deletions agent/fw_drupal_common.c
Original file line number Diff line number Diff line change
@@ -60,7 +60,9 @@ NR_PHP_WRAPPER(nr_drupal_wrap_module_hook) {
* function such as a_b_c is ambiguous (is the module a or a_b?). Instead,
* we'll see if they're defined in the wraprec.
*/
#if ZEND_MODULE_API_NO >= ZEND_8_2_X_API_NO
wraprec = nr_php_get_wraprec(execute_data->func);
#endif
if ((NULL != wraprec->drupal_hook) && (NULL != wraprec->drupal_module)) {
nr_drupal_create_metric(auto_segment, NR_PSTR(NR_DRUPAL_MODULE_PREFIX),
wraprec->drupal_module, wraprec->drupal_module_len);
6 changes: 4 additions & 2 deletions agent/fw_wordpress.c
Original file line number Diff line number Diff line change
@@ -357,7 +357,6 @@ NR_PHP_WRAPPER(nr_wordpress_wrap_hook_plugin) {
char* plugin = NULL;

NR_UNUSED_SPECIALFN;
(void)wraprec;

/*
* We only want to hook the function being called if this is a WordPress
@@ -370,7 +369,10 @@ NR_PHP_WRAPPER(nr_wordpress_wrap_hook_plugin) {
if ((0 == NRINI(wordpress_hooks)) || (NULL == tag)) {
NR_PHP_WRAPPER_LEAVE;
}
plugin = nr_wordpress_plugin_from_function(execute_data->func);
// Use optimized wraprec hashmap over plugin hashmap
wraprec = nr_php_get_wraprec(execute_data->func);
plugin = wraprec->wordpress_plugin_theme;
//plugin = nr_wordpress_plugin_from_function(execute_data->func);

NR_PHP_WRAPPER_CALL;
if (NULL != plugin) {