Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(agent): remove guzzle client construct function
  • Loading branch information
hahuja2 committed Aug 30, 2022
commit 6a879ff10ae7093861b2b3f5893d112b00553284
20 changes: 0 additions & 20 deletions agent/lib_guzzle_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include "util_memory.h"
#include "util_strings.h"

int php_version_compare(char*, char*);

char* nr_guzzle_create_async_context_name(const char* prefix, const zval* obj) {
if (!nr_php_is_zval_valid_object(obj)) {
return NULL;
Expand Down Expand Up @@ -313,21 +311,3 @@ char* nr_guzzle_response_get_header(const char* header,

return value;
}

NR_PHP_WRAPPER_START(nr_guzzle_client_construct) {
zval* this_var = nr_php_scope_get(NR_EXECUTE_ORIG_ARGS TSRMLS_CC);
char *version = NULL;
version = nr_guzzle_version(this_var TSRMLS_CC);

(void)wraprec;
NR_UNUSED_SPECIALFN;
nr_php_scope_release(&this_var);
if (php_version_compare(version, "7") >= 0){
NR_PHP_WRAPPER_DELEGATE(nr_guzzle7_client_construct);
} else if (php_version_compare(version, "6") >= 0) {
NR_PHP_WRAPPER_DELEGATE(nr_guzzle6_client_construct);
} else{
NR_PHP_WRAPPER_DELEGATE(nr_guzzle4_client_construct);
}
}
NR_PHP_WRAPPER_END
7 changes: 0 additions & 7 deletions agent/lib_guzzle_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,4 @@ extern void nr_guzzle_request_set_outbound_headers(zval* request,
extern char* nr_guzzle_response_get_header(const char* header,
zval* response TSRMLS_DC);

/*
* Purpose : Wrapper for Client::__construct() that delegates to the correct
* Guzzle 4-5 or Guzzle 6 handler based on which version of Guzzle
* the Client object comes from.
*/
extern NR_PHP_WRAPPER_PROTOTYPE(nr_guzzle_client_construct);

#endif /* LIB_GUZZLE_COMMON_HDR */