From bc860662872123d8a9b7dc14644c07c1434ef8d2 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja <108540135+hahuja2@users.noreply.github.com> Date: Thu, 15 Feb 2024 15:25:54 -0800 Subject: [PATCH] fix(agent): remove PHPUnit version detection (#835) This PR removes the version detection code for PHPUnit. --- agent/fw_hooks.h | 1 - agent/lib_phpunit.c | 16 ---------------- agent/php_execute.c | 1 - 3 files changed, 18 deletions(-) diff --git a/agent/fw_hooks.h b/agent/fw_hooks.h index ee7496741..f49bc591b 100644 --- a/agent/fw_hooks.h +++ b/agent/fw_hooks.h @@ -58,6 +58,5 @@ extern void nr_monolog_enable(TSRMLS_D); /* Vulnerability Management Packages */ extern void nr_drupal_version(void); extern void nr_wordpress_version(void); -extern void nr_phpunit_version(void); #endif /* FW_HOOKS_HDR */ diff --git a/agent/lib_phpunit.c b/agent/lib_phpunit.c index 66702c5e4..436666dc9 100644 --- a/agent/lib_phpunit.c +++ b/agent/lib_phpunit.c @@ -666,22 +666,6 @@ static int nr_phpunit_are_statuses_valid(TSRMLS_D) { return 1; } -void nr_phpunit_version() { - char* string = "PHPUnit\\Runner\\Version::id();"; - zval retval; - int result - = zend_eval_string(string, &retval, "Retrieve PHPUnit Version"); - - // Add php package to transaction - if (result == SUCCESS) { - if (Z_TYPE(retval) == IS_STRING) { - char* version = Z_STRVAL(retval); - nr_txn_add_php_package(NRPRG(txn), "phpunit/phpunit", version); - } - zval_dtor(&retval); - } -} - void nr_phpunit_enable(TSRMLS_D) { if (!NRINI(phpunit_events_enabled)) { return; diff --git a/agent/php_execute.c b/agent/php_execute.c index dc4901e23..81d2f3d8b 100644 --- a/agent/php_execute.c +++ b/agent/php_execute.c @@ -605,7 +605,6 @@ typedef struct _nr_vuln_mgmt_table_t { /* Note that all paths should be in lowercase. */ static const nr_vuln_mgmt_table_t vuln_mgmt_packages[] = { {"Drupal", "core/lib/drupal.php", nr_drupal_version}, - {"PHPUnit", "runner/version.php", nr_phpunit_version}, {"Wordpress", "wp-includes/version.php", nr_wordpress_version}, };