Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 17 additions & 1 deletion apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ static int apm_end_silence_opcode_handler(ZEND_USER_OPCODE_HANDLER_ARGS)
return ZEND_USER_OPCODE_DISPATCH;
}

int apm_write(const char *str,
#if PHP_VERSION_ID < 70100
static int apm_write(const char *str,
#if PHP_VERSION_ID >= 70000
size_t
#else
Expand All @@ -107,6 +108,7 @@ length)
smart_str_0(APM_G(buffer));
return length;
}
#endif

void (*old_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);

Expand Down Expand Up @@ -596,8 +598,15 @@ void extract_data(TSRMLS_D)
zend_is_auto_global_compat("_COOKIE");
if (FETCH_HTTP_GLOBALS(COOKIE)) {
if (Z_ARRVAL_P(tmp)->nNumOfElements > 0) {
#if PHP_VERSION_ID >= 70100
zend_string *tmpstr;
tmpstr = zend_print_zval_r_to_str(tmp, 0);
smart_str_append(&APM_RD(cookies), tmpstr);
zend_string_release(tmpstr);
#else
APM_G(buffer) = &APM_RD(cookies);
zend_print_zval_r_ex(apm_write, tmp, 0 TSRMLS_CC);
#endif
APM_RD(cookies_found) = 1;
}
}
Expand All @@ -606,8 +615,15 @@ void extract_data(TSRMLS_D)
zend_is_auto_global_compat("_POST");
if (FETCH_HTTP_GLOBALS(POST)) {
if (Z_ARRVAL_P(tmp)->nNumOfElements > 0) {
#if PHP_VERSION_ID >= 70100
zend_string *tmpstr;
tmpstr = zend_print_zval_r_to_str(tmp, 0);
smart_str_append(&APM_RD(post_vars), tmpstr);
zend_string_release(tmpstr);
#else
APM_G(buffer) = &APM_RD(post_vars);
zend_print_zval_r_ex(apm_write, tmp, 0 TSRMLS_CC);
#endif
APM_RD(post_vars_found) = 1;
}
}
Expand Down
10 changes: 1 addition & 9 deletions php_apm.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,6 @@ ZEND_END_MODULE_GLOBALS(apm)
# define add_assoc_long_compat(array, key, value) add_assoc_long_ex((array), (key), (sizeof(key)), (value));
#endif

int apm_write(const char *str,
#if PHP_VERSION_ID >= 70000
size_t
#else
uint
#endif
length);

void extract_data(TSRMLS_D);
#endif

void extract_data(TSRMLS_D);