File tree Expand file tree Collapse file tree 5 files changed +35
-5
lines changed Expand file tree Collapse file tree 5 files changed +35
-5
lines changed Original file line number Diff line number Diff line change @@ -436,22 +436,33 @@ const zend_function_entry nr_guzzle4_subscriber_functions[]
436
436
* Purpose : Registers an event subscriber for a newly instantiated
437
437
* GuzzleHttp\Client object.
438
438
*/
439
+
440
+ #if ZEND_MODULE_API_NO >= ZEND_8_2_X_API_NO
441
+ void nr_guzzle4_client_construct (NR_EXECUTE_PROTO ) {
442
+ #else
439
443
NR_PHP_WRAPPER_START (nr_guzzle4_client_construct ) {
444
+ #endif
440
445
zval * emitter = NULL ;
441
446
zval * retval = NULL ;
442
447
zval * subscriber = NULL ;
443
448
zval * this_var = nr_php_scope_get (NR_EXECUTE_ORIG_ARGS TSRMLS_CC );
444
449
450
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
445
451
(void )wraprec ;
452
+ #endif
446
453
NR_UNUSED_SPECIALFN ;
447
454
448
455
/* This is how we distinguish Guzzle 4/5 from other versions. */
449
456
if (0 == nr_guzzle_does_zval_implement_has_emitter (this_var TSRMLS_CC )) {
457
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
450
458
NR_PHP_WRAPPER_CALL ;
459
+ #endif
451
460
goto end ;
452
461
}
453
462
463
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
454
464
NR_PHP_WRAPPER_CALL ;
465
+ #endif
455
466
456
467
/*
457
468
* We can't have newrelic\Guzzle4\Subscriber implement
@@ -503,7 +514,9 @@ NR_PHP_WRAPPER_START(nr_guzzle4_client_construct) {
503
514
nr_php_zval_free (& emitter );
504
515
nr_php_zval_free (& subscriber );
505
516
}
517
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
506
518
NR_PHP_WRAPPER_END
519
+ #endif
507
520
508
521
void nr_guzzle4_enable (TSRMLS_D ) {
509
522
if (0 == NRINI (guzzle_enabled )) {
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ extern void nr_guzzle4_rshutdown(TSRMLS_D);
26
26
/*
27
27
* Purpose : Client::__construct() wrapper for Guzzle 4.
28
28
*/
29
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
29
30
extern NR_PHP_WRAPPER_PROTOTYPE (nr_guzzle4_client_construct );
31
+ #else
32
+ extern void nr_guzzle4_client_construct (NR_EXECUTE_PROTO );
33
+ #endif
30
34
31
35
#endif /* LIB_GUZZLE4_HDR */
Original file line number Diff line number Diff line change @@ -342,7 +342,11 @@ const zend_function_entry nr_guzzle6_requesthandler_functions[]
342
342
343
343
/* }}} */
344
344
345
+ #if ZEND_MODULE_API_NO >= ZEND_8_2_X_API_NO
346
+ void nr_guzzle6_client_construct (NR_EXECUTE_PROTO ) {
347
+ #else
345
348
NR_PHP_WRAPPER_START (nr_guzzle6_client_construct ) {
349
+ #endif
346
350
zval * config ;
347
351
zend_class_entry * guzzle_client_ce ;
348
352
zval * handler_stack ;
@@ -357,16 +361,22 @@ NR_PHP_WRAPPER_START(nr_guzzle6_client_construct) {
357
361
nr_free (version );
358
362
}
359
363
364
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
360
365
(void )wraprec ;
366
+ #endif
361
367
NR_UNUSED_SPECIALFN ;
362
368
363
369
/* This is how we distinguish Guzzle 4/5. */
364
370
if (nr_guzzle_does_zval_implement_has_emitter (this_var TSRMLS_CC )) {
371
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
365
372
NR_PHP_WRAPPER_CALL ;
373
+ #endif
366
374
goto end ;
367
375
}
368
376
377
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
369
378
NR_PHP_WRAPPER_CALL ;
379
+ #endif
370
380
371
381
/*
372
382
* Get our middleware callable (which is just a string), and make sure it's
@@ -413,7 +423,9 @@ NR_PHP_WRAPPER_START(nr_guzzle6_client_construct) {
413
423
nr_php_zval_free (& middleware );
414
424
nr_php_scope_release (& this_var );
415
425
}
426
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
416
427
NR_PHP_WRAPPER_END
428
+ #endif
417
429
418
430
void nr_guzzle6_enable (TSRMLS_D ) {
419
431
int retval ;
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ extern void nr_guzzle6_minit(TSRMLS_D);
20
20
/*
21
21
* Purpose : Client::__construct() wrapper for Guzzle 6.
22
22
*/
23
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
23
24
extern NR_PHP_WRAPPER_PROTOTYPE (nr_guzzle6_client_construct );
25
+ #else
26
+ extern void nr_guzzle6_client_construct (NR_EXECUTE_PROTO );
27
+ #endif
24
28
25
29
#endif /* LIB_GUZZLE4_HDR */
Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ extern zval** nr_php_get_return_value_ptr(TSRMLS_D);
277
277
const nrtxn_t* txn = NRPRG(txn); \
278
278
const nrtime_t txn_start_time = nr_txn_start_time(txn); \
279
279
if (NRPRG(in_wrapper)) { \
280
- printf("AAHHHHHHHHHHH\n"); \
280
+ printf("AAHHHHHHHHHHH %s \n", #name ); \
281
281
} \
282
282
NRPRG(in_wrapper) = true; \
283
283
\
@@ -384,10 +384,7 @@ extern zval** nr_php_get_return_value_ptr(TSRMLS_D);
384
384
}
385
385
#else
386
386
#define NR_PHP_WRAPPER_DELEGATE (name ) \
387
- if (!was_executed) { \
388
- ((name)(execute_data)); \
389
- was_executed = 1; \
390
- }
387
+ ((name)(execute_data, func_return_value));
391
388
#endif
392
389
393
390
static inline bool is_instrumentation_set_and_not_equal (
You can’t perform that action at this time.
0 commit comments