diff --git a/agent/fw_hooks.h b/agent/fw_hooks.h index f66d18d72..5fa6131b9 100644 --- a/agent/fw_hooks.h +++ b/agent/fw_hooks.h @@ -57,7 +57,6 @@ extern void nr_phpunit_enable(TSRMLS_D); extern void nr_predis_enable(TSRMLS_D); extern void nr_zend_http_enable(TSRMLS_D); extern void nr_monolog_enable(TSRMLS_D); -extern void nr_get_package_information(TSRMLS_D); /* Vulnerability Management Packages */ extern void nr_drupal_version(void); diff --git a/agent/fw_symfony4.c b/agent/fw_symfony4.c index 3163db0ef..7a7b8e715 100644 --- a/agent/fw_symfony4.c +++ b/agent/fw_symfony4.c @@ -215,56 +215,6 @@ NR_PHP_WRAPPER(nr_symfony4_name_the_wt) { } NR_PHP_WRAPPER_END -void nr_get_package_information() { - zval retval; - int result = -1; - char* func_string - = "" - "(function() {" - " try {" - " if (class_exists('Composer\\InstalledVersions')) {" - " if (method_exists('Composer\\InstalledVersions', " - " 'getInstalledPackages') && method_exists('Composer\\InstalledVersions', " - " 'getVersion')) {" - " return Composer\\InstalledVersions::getInstalledPackages();" - " } else {" - " return NULL;" - " }" - " } else {" - " return NULL;" - " }" - " } catch (Exception $e) {" - " return NULL;" - " }" - "})();"; - - char* getVersion = "Composer\\InstalledVersions::getVersion(\"%s\");"; - zend_eval_string(func_string, &retval, "Retrieve symfony package name"); - - if (result == SUCCESS) { - if (Z_TYPE(retval) == IS_ARRAY) { - zval* value; - char buf[512]; - int result2; - zval retval2; - char* version; - (void)version; - ZEND_HASH_FOREACH_VAL(Z_ARRVAL(retval), value) { - if (Z_TYPE_P(value) == IS_STRING) { - snprintf(buf, sizeof(buf), getVersion, Z_STRVAL_P(value)); - result2 = zend_eval_string(buf, &retval2, "Retrieve symfony Version"); - if (SUCCESS == result2) { - if (nr_php_is_zval_valid_string(&retval2)) { - version = Z_STRVAL(retval2); - } - } - } - } ZEND_HASH_FOREACH_END(); - } - zval_dtor(&retval); - } -} - void nr_symfony4_enable(TSRMLS_D) { /* * We set the path to 'unknown' to prevent having to name routing errors. diff --git a/agent/php_agent.c b/agent/php_agent.c index 7cae420bf..50d942b62 100644 --- a/agent/php_agent.c +++ b/agent/php_agent.c @@ -1229,36 +1229,3 @@ bool nr_php_function_is_static_method(const zend_function* func) { return (func->common.fn_flags & ZEND_ACC_STATIC); } - -nr_composer_classification_t nr_composer_special( - const char* filename TSRMLS_DC) { - NR_UNUSED_TSRMLS; - - if (nr_strcaseidx(filename, "vendor/composer/") >= 0) { - zval retval; - int result = -1; - char* func_string - = "" - "(function() {" - " try {" - " if (file_exists('vendor/composer/installed.php')) {" - " return 'SUCCESS';" - " } else {" - " return NULL;" - " }" - " } catch (exception $e) {" - " return NULL;" - " }" - "})();"; - result = zend_eval_string(func_string, &retval, "check if file exists" TSRMLS_CC); - if (result == SUCCESS) { - NR_PHP_PROCESS_GLOBALS(composer_exists) = 1; - return FILE_EXISTS; - } else { - NR_PHP_PROCESS_GLOBALS(composer_exists) = 0; - return FILE_DOES_NOT_EXIST; - } - } - - return FILE_DOES_NOT_EXIST; -} diff --git a/agent/php_agent.h b/agent/php_agent.h index ce1a450ac..fbdc34620 100644 --- a/agent/php_agent.h +++ b/agent/php_agent.h @@ -847,9 +847,6 @@ extern zval* nr_php_parse_str(const char* str, size_t len TSRMLS_DC); */ extern bool nr_php_function_is_static_method(const zend_function* func); -extern nr_composer_classification_t nr_composer_special( - const char* filename TSRMLS_DC); - /* * Purpose : Get the execution data for the current PHP environment. * diff --git a/agent/php_execute.h b/agent/php_execute.h index e7bc87927..dd446a594 100644 --- a/agent/php_execute.h +++ b/agent/php_execute.h @@ -41,13 +41,6 @@ typedef enum { typedef nr_framework_classification_t (*nr_framework_special_fn_t)( const char* filename TSRMLS_DC); -typedef enum { - FILE_EXISTS, /* The file we are looking for exists */ - FILE_DOES_NOT_EXIST, /* The file we are looking for does not exist */ -} nr_composer_classification_t; -typedef nr_composer_classification_t (*nr_composer_special_fn_t)( - const char* filename); - /* * Version specific metadata that we have to gather before we call the original * execute_ex handler, as different versions of PHP behave differently in terms diff --git a/agent/php_globals.h b/agent/php_globals.h index 8c99f6a18..c73b93e43 100644 --- a/agent/php_globals.h +++ b/agent/php_globals.h @@ -76,7 +76,6 @@ typedef struct _nrphpglobals_t { int preload_framework_library_detection; /* Enables preloading framework and library detection */ char* docker_id; /* 64 byte hex docker ID parsed from /proc/self/mountinfo */ - int composer_exists; /* Check if composer exists*/ /* Original PHP callback pointer contents */ nrphperrfn_t orig_error_cb;