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 @@ -343,7 +343,11 @@ const zend_function_entry nr_guzzle6_requesthandler_functions[]
343
343
344
344
/* }}} */
345
345
346
+ #if ZEND_MODULE_API_NO >= ZEND_8_2_X_API_NO
347
+ void nr_guzzle6_client_construct (NR_EXECUTE_PROTO ) {
348
+ #else
346
349
NR_PHP_WRAPPER_START (nr_guzzle6_client_construct ) {
350
+ #endif
347
351
zval * config ;
348
352
zend_class_entry * guzzle_client_ce ;
349
353
zval * handler_stack ;
@@ -364,16 +368,22 @@ NR_PHP_WRAPPER_START(nr_guzzle6_client_construct) {
364
368
version );
365
369
nr_free (version );
366
370
371
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
367
372
(void )wraprec ;
373
+ #endif
368
374
NR_UNUSED_SPECIALFN ;
369
375
370
376
/* This is how we distinguish Guzzle 4/5. */
371
377
if (nr_guzzle_does_zval_implement_has_emitter (this_var TSRMLS_CC )) {
378
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
372
379
NR_PHP_WRAPPER_CALL ;
380
+ #endif
373
381
goto end ;
374
382
}
375
383
384
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
376
385
NR_PHP_WRAPPER_CALL ;
386
+ #endif
377
387
378
388
/*
379
389
* Get our middleware callable (which is just a string), and make sure it's
@@ -420,7 +430,9 @@ NR_PHP_WRAPPER_START(nr_guzzle6_client_construct) {
420
430
nr_php_zval_free (& middleware );
421
431
nr_php_scope_release (& this_var );
422
432
}
433
+ #if ZEND_MODULE_API_NO < ZEND_8_2_X_API_NO
423
434
NR_PHP_WRAPPER_END
435
+ #endif
424
436
425
437
void nr_guzzle6_enable (TSRMLS_D ) {
426
438
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