Skip to content

Commit

Permalink
fix(agent): remove PHPUnit version detection (#835)
Browse files Browse the repository at this point in the history
This PR removes the version detection code for PHPUnit.
  • Loading branch information
hahuja2 authored Feb 15, 2024
1 parent c77a3b5 commit bc86066
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion agent/fw_hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
16 changes: 0 additions & 16 deletions agent/lib_phpunit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion agent/php_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};

Expand Down

0 comments on commit bc86066

Please sign in to comment.