@@ -107,6 +107,18 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
107
107
// It will only be set if the result of the eval is SUCCESS.
108
108
int result = -1 ;
109
109
110
+ // nurunlikely because this should alredy be ensured by the caller
111
+ if (nrunlikely (!NRINI (vulnerability_management_package_detection_enabled ))) {
112
+ // do nothing when collecting package information for vulnerability management is disabled
113
+ return ;
114
+ }
115
+
116
+ // nurunlikely because this should alredy be ensured by the caller
117
+ if (nrunlikely (!NRINI (vulnerability_management_composer_detection_enabled ))) {
118
+ // do nothing when use of composer to collect package info is disabled
119
+ return ;
120
+ }
121
+
110
122
#if 0
111
123
char * getpackagename
112
124
= ""
@@ -230,10 +242,8 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
230
242
nrl_verbosedebug (NRL_INSTRUMENT , "package %s, version %s" ,
231
243
NRSAFESTR (ZSTR_VAL (package_name )),
232
244
NRSAFESTR (Z_STRVAL_P (package_version )));
233
- if (NRINI (vulnerability_management_package_detection_enabled )) {
234
- nr_txn_add_php_package_from_source (NRPRG (txn ), NRSAFESTR (ZSTR_VAL (package_name )),
235
- NRSAFESTR (Z_STRVAL_P (package_version )), NR_PHP_PACKAGE_SOURCE_COMPOSER );
236
- }
245
+ nr_txn_add_php_package_from_source (NRPRG (txn ), NRSAFESTR (ZSTR_VAL (package_name )),
246
+ NRSAFESTR (Z_STRVAL_P (package_version )), NR_PHP_PACKAGE_SOURCE_COMPOSER );
237
247
nr_fw_support_add_package_supportability_metric (
238
248
NRPRG (txn ), NRSAFESTR (ZSTR_VAL (package_name )),
239
249
NRSAFESTR (Z_STRVAL_P (package_version )));
0 commit comments