File tree Expand file tree Collapse file tree 6 files changed +54
-4
lines changed Expand file tree Collapse file tree 6 files changed +54
-4
lines changed Original file line number Diff line number Diff line change 20
20
#include "util_memory.h"
21
21
#include "util_strings.h"
22
22
23
+ #define PHP_PACKAGE_NAME "drupal/drupal"
24
+
23
25
/*
24
26
* Set the Web Transaction (WT) name to "(cached page)"
25
27
*
@@ -879,4 +881,15 @@ void nr_drupal_enable(TSRMLS_D) {
879
881
nr_php_user_function_add_declared_callback (
880
882
NR_PSTR ("drupal_http_request" ), nr_drupal_replace_http_request TSRMLS_CC );
881
883
#endif
884
+
885
+ if (NRINI (vulnerability_management_package_detection_enabled )) {
886
+ nr_txn_add_php_package (NRPRG (txn ), PHP_PACKAGE_NAME ,
887
+ PHP_PACKAGE_VERSION_UNKNOWN );
888
+ }
889
+
890
+ nr_fw_support_add_package_supportability_metric (
891
+ NRPRG (txn ), PHP_PACKAGE_NAME , NULL ,
892
+ nr_php_packages_get_package (NRPRG (txn )-> php_packages ,
893
+ PHP_PACKAGE_NAME ));
894
+
882
895
}
Original file line number Diff line number Diff line change 13
13
#include "util_logging.h"
14
14
#include "util_memory.h"
15
15
16
+ #define PHP_PACKAGE_NAME "laminas/laminas-mvc"
17
+
16
18
/*
17
19
* Laminas is a rebranding of Zend, but the logic remains the same,
18
20
* it is simply a name change and corresponds directly to Zend 3.x.
@@ -163,7 +165,11 @@ void nr_laminas3_enable(TSRMLS_D) {
163
165
nr_laminas3_name_the_wt TSRMLS_CC );
164
166
165
167
if (NRINI (vulnerability_management_package_detection_enabled )) {
166
- nr_txn_add_php_package (NRPRG (txn ), "laminas/laminas-mvc" ,
168
+ nr_txn_add_php_package (NRPRG (txn ), PHP_PACKAGE_NAME ,
167
169
PHP_PACKAGE_VERSION_UNKNOWN );
168
170
}
171
+ nr_fw_support_add_package_supportability_metric (
172
+ NRPRG (txn ), PHP_PACKAGE_NAME , NULL ,
173
+ nr_php_packages_get_package (NRPRG (txn )-> php_packages ,
174
+ PHP_PACKAGE_NAME ));
169
175
}
Original file line number Diff line number Diff line change 10
10
#include "fw_support.h"
11
11
#include "fw_symfony_common.h"
12
12
13
+ #define PHP_PACKAGE_NAME "symfony/http-kernel"
14
+
13
15
NR_PHP_WRAPPER (nr_symfony4_exception ) {
14
16
int priority = nr_php_error_get_priority (E_ERROR );
15
17
zval * event = NULL ;
@@ -277,7 +279,12 @@ void nr_symfony4_enable(TSRMLS_D) {
277
279
#endif
278
280
279
281
if (NRINI (vulnerability_management_package_detection_enabled )) {
280
- nr_txn_add_php_package (NRPRG (txn ), "symfony/http-kernel" ,
282
+ nr_txn_add_php_package (NRPRG (txn ), PHP_PACKAGE_NAME ,
281
283
PHP_PACKAGE_VERSION_UNKNOWN );
282
284
}
285
+
286
+ nr_fw_support_add_package_supportability_metric (
287
+ NRPRG (txn ), PHP_PACKAGE_NAME , NULL ,
288
+ nr_php_packages_get_package (NRPRG (txn )-> php_packages ,
289
+ PHP_PACKAGE_NAME ));
283
290
}
Original file line number Diff line number Diff line change 14
14
#include "util_memory.h"
15
15
#include "util_strings.h"
16
16
17
+ #define PHP_PACKAGE_NAME "yiisoft/yii2"
17
18
/*
18
19
* Yii1: Set the web transaction name from the controllerId + actionId combo.
19
20
*
@@ -221,4 +222,14 @@ void nr_yii2_enable(TSRMLS_D) {
221
222
nr_php_wrap_user_function (NR_PSTR ("yii\\base\\ErrorHandler::logException" ),
222
223
nr_yii2_error_handler_wrapper TSRMLS_CC );
223
224
#endif
225
+
226
+ if (NRINI (vulnerability_management_package_detection_enabled )) {
227
+ nr_txn_add_php_package (NRPRG (txn ), PHP_PACKAGE_NAME ,
228
+ PHP_PACKAGE_VERSION_UNKNOWN );
229
+ }
230
+
231
+ nr_fw_support_add_package_supportability_metric (
232
+ NRPRG (txn ), PHP_PACKAGE_NAME , NULL ,
233
+ nr_php_packages_get_package (NRPRG (txn )-> php_packages ,
234
+ PHP_PACKAGE_NAME ));
224
235
}
Original file line number Diff line number Diff line change 16
16
#include "php_call.h"
17
17
#include "lib_doctrine2.h"
18
18
19
+ #define PHP_PACKAGE_NAME "doctrine/orm"
20
+
19
21
/*
20
22
* This answers the somewhat complicated question of whether we should
21
23
* instrument DQL, which is dependent on the input query setting as well as SQL
@@ -106,7 +108,11 @@ void nr_doctrine2_enable(TSRMLS_D) {
106
108
#endif /* OAPI */
107
109
108
110
if (NRINI (vulnerability_management_package_detection_enabled )) {
109
- nr_txn_add_php_package (NRPRG (txn ), "doctrine/orm" ,
111
+ nr_txn_add_php_package (NRPRG (txn ), PHP_PACKAGE_NAME ,
110
112
PHP_PACKAGE_VERSION_UNKNOWN );
111
113
}
114
+ nr_fw_support_add_package_supportability_metric (
115
+ NRPRG (txn ), PHP_PACKAGE_NAME , NULL ,
116
+ nr_php_packages_get_package (NRPRG (txn )-> php_packages ,
117
+ PHP_PACKAGE_NAME ));
112
118
}
Original file line number Diff line number Diff line change 33
33
#include "util_logging.h"
34
34
#include "util_memory.h"
35
35
36
+ #define PHP_PACKAGE_NAME "guzzlehttp/guzzle"
37
+
36
38
/*
37
39
* We rely on the const correctness of certain Zend functions that weren't
38
40
* const correct before 5.3 and/or 5.4: since Guzzle 4 requires 5.4.0 anyway,
@@ -520,9 +522,14 @@ void nr_guzzle4_enable(TSRMLS_D) {
520
522
nr_guzzle_client_construct TSRMLS_CC );
521
523
522
524
if (NRINI (vulnerability_management_package_detection_enabled )) {
523
- nr_txn_add_php_package (NRPRG (txn ), "guzzlehttp/guzzle" ,
525
+ nr_txn_add_php_package (NRPRG (txn ), PHP_PACKAGE_NAME ,
524
526
PHP_PACKAGE_VERSION_UNKNOWN );
525
527
}
528
+
529
+ nr_fw_support_add_package_supportability_metric (
530
+ NRPRG (txn ), PHP_PACKAGE_NAME , NULL ,
531
+ nr_php_packages_get_package (NRPRG (txn )-> php_packages ,
532
+ PHP_PACKAGE_NAME ));
526
533
}
527
534
528
535
void nr_guzzle4_minit (TSRMLS_D ) {
You can’t perform that action at this time.
0 commit comments