static databuf_t* ftp_getdata(ftpbuf_t *ftp TSRMLS_DC);
/* accepts the data connection, returns updated data buffer */
-static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp);
+static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC);
/* closes the data connection, returns NULL */
static databuf_t* data_close(ftpbuf_t *ftp, databuf_t *data);
goto bail;
}
- if ((data = data_accept(data, ftp)) == NULL) {
+ if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
goto bail;
}
if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) {
goto bail;
}
- if ((data = data_accept(data, ftp)) == NULL) {
+ if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
goto bail;
}
/* {{{ data_accept
*/
databuf_t*
-data_accept(databuf_t *data, ftpbuf_t *ftp)
+data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC)
{
php_sockaddr_storage addr;
socklen_t size;
#if HAVE_OPENSSL_EXT
SSL_CTX *ctx;
- TSRMLS_FETCH();
#endif
if (data->fd != -1) {
}
/* pull data buffer into tmpfile */
- if ((data = data_accept(data, ftp)) == NULL) {
+ if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
goto bail;
}
size = 0;
goto bail;
}
- if ((data = data_accept(data, ftp)) == NULL) {
+ if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
goto bail;
}
if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) {
goto bail;
}
- if ((data = data_accept(data, ftp)) == NULL) {
+ if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
goto bail;
}
ftp->data = data;
/* {{{ pcre_get_compiled_regex
*/
-PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options) {
+PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) {
pcre *re = NULL;
int coptions = 0;
int soptions = 0;
#endif
pcre_cache_entry *pce;
pcre_cache_entry new_entry;
- TSRMLS_FETCH();
/* Try to lookup the cached regex entry, and if successful, just pass
back the compiled pattern, otherwise go on and compile it. */
}
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
/* {{{ preg_do_repl_func
*/
-static int preg_do_repl_func(zval *function, char *subject, int *offsets, int count, char **result)
+static int preg_do_repl_func(zval *function, char *subject, int *offsets, int count, char **result TSRMLS_DC)
{
zval *retval_ptr; /* Function return value */
zval **args[1]; /* Argument to pass to function */
zval *subpats; /* Captured subpatterns */
int result_len; /* Return value length */
int i;
- TSRMLS_FETCH();
MAKE_STD_ZVAL(subpats);
array_init(subpats);
walk_last; /* Last walked character */
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options TSRMLS_CC)) == NULL) {
return NULL;
}
} else if (is_callable_replace) {
/* Use custom function to get replacement string and its length. */
eval_result_len = preg_do_repl_func(replace_val, subject, offsets,
- count, &eval_result);
+ count, &eval_result TSRMLS_CC);
new_len += eval_result_len;
} else { /* do regular substitution */
walk = replace;
convert_to_string_ex(subject);
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
}
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
PHP_FUNCTION(preg_grep);
PHPAPI char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int *result_len, int limit TSRMLS_DC);
-PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options);
+PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options TSRMLS_DC);
extern zend_module_entry pcre_module_entry;
#define pcre_module_ptr &pcre_module_entry
struct timeval tv;
gettimeofday(&tv, NULL);
- date_fmt = php_std_date(tv.tv_sec + PS(cookie_lifetime));
+ date_fmt = php_std_date(tv.tv_sec + PS(cookie_lifetime) TSRMLS_CC);
smart_str_appends(&ncookie, COOKIE_EXPIRES);
smart_str_appends(&ncookie, date_fmt);
}
#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
else if (aggr_type == AGGREGATE_BY_REGEXP) {
- if ((re = pcre_get_compiled_regex(Z_STRVAL_P(aggr_filter), &re_extra, &re_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_P(aggr_filter), &re_extra, &re_options TSRMLS_CC)) == NULL) {
return;
}
}
}
#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
else if (aggr_type == AGGREGATE_BY_REGEXP) {
- if ((re = pcre_get_compiled_regex(Z_STRVAL_P(aggr_filter), &re_extra, &re_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_P(aggr_filter), &re_extra, &re_options TSRMLS_CC)) == NULL) {
return;
}
}
convert_to_boolean_ex(process_sections);
if (Z_BVAL_PP(process_sections)) {
- TSRMLS_FETCH();
-
BG(active_ini_file_section) = NULL;
ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
} else {
/* {{{ php_print_credits
*/
-PHPAPI void php_print_credits(int flag)
+PHPAPI void php_print_credits(int flag TSRMLS_DC)
{
- TSRMLS_FETCH();
-
if (flag & PHP_CREDITS_FULLPAGE) {
php_print_info_htmlhead(TSRMLS_C);
}
#endif /* HAVE_CREDITS_DEFS */
-PHPAPI void php_print_credits(int flag);
+PHPAPI void php_print_credits(int flag TSRMLS_DC);
#endif
/* {{{ php_info_print_css
*/
-PHPAPI void php_info_print_css(void)
+PHPAPI void php_info_print_css(TSRMLS_D)
{
- TSRMLS_FETCH();
-
PUTS("body {background-color: #ffffff; color: #000000;}\n");
PUTS("body, td, th, h1, h2 {font-family: sans-serif;}\n");
PUTS("pre {margin: 0px; font-family: monospace;}\n");
#ifndef CSS_H
#define CSS_H
-PHPAPI void php_info_print_css(void);
+PHPAPI void php_info_print_css(TSRMLS_D);
#endif
/* {{{ php_std_date
Return date string in standard format for http headers */
-char *php_std_date(time_t t)
+char *php_std_date(time_t t TSRMLS_DC)
{
struct tm *tm1, tmbuf;
char *str;
- TSRMLS_FETCH();
tm1 = php_gmtime_r(&t, &tmbuf);
str = emalloc(81);
PHP_FUNCTION(strtotime);
int php_idate(char format, int timestamp, int gm);
-extern char *php_std_date(time_t t);
+extern char *php_std_date(time_t t TSRMLS_DC);
void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm);
#if HAVE_STRFTIME
void _php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
}
/* }}} */
-PHPAPI int php_header()
+PHPAPI int php_header(TSRMLS_D)
{
- TSRMLS_FETCH();
-
if (sapi_send_headers(TSRMLS_C)==FAILURE || SG(request_info).headers_only) {
return 0; /* don't allow output */
} else {
* pick an expiry date 1 year and 1 second in the past
*/
t = time(NULL) - 31536001;
- dt = php_std_date(t);
+ dt = php_std_date(t TSRMLS_CC);
sprintf(cookie, "Set-Cookie: %s=deleted; expires=%s", name, dt);
efree(dt);
} else {
sprintf(cookie, "Set-Cookie: %s=%s", name, value ? encoded_value : "");
if (expires > 0) {
strcat(cookie, "; expires=");
- dt = php_std_date(expires);
+ dt = php_std_date(expires TSRMLS_CC);
strcat(cookie, dt);
efree(dt);
}
PHP_FUNCTION(setcookie);
PHP_FUNCTION(headers_sent);
-PHPAPI int php_header(void);
+PHPAPI int php_header(TSRMLS_D);
PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure TSRMLS_DC);
#endif
/* {{{ php_info_print_style
*/
-void php_info_print_style(void)
+void php_info_print_style(TSRMLS_D)
{
php_printf("<style type=\"text/css\"><!--\n");
- php_info_print_css();
+ php_info_print_css(TSRMLS_C);
php_printf("//--></style>\n");
}
/* }}} */
PUTS("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n");
PUTS("<html>");
PUTS("<head>\n");
- php_info_print_style();
+ php_info_print_style(TSRMLS_C);
PUTS("<title>phpinfo()</title>");
/*
php_printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" />\n", charset);
flag = PHP_CREDITS_ALL;
}
- php_print_credits(flag);
+ php_print_credits(flag TSRMLS_CC);
RETURN_TRUE;
}
/* }}} */
PHPAPI void php_print_info_htmlhead(TSRMLS_D);
PHPAPI void php_print_info(int flag TSRMLS_DC);
PHPAPI void php_print_style(void);
-PHPAPI void php_info_print_style(void);
+PHPAPI void php_info_print_style(TSRMLS_D);
PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header);
PHPAPI void php_info_print_table_header(int num_cols, ...);
PHPAPI void php_info_print_table_row(int num_cols, ...);
/* {{{ custom_levdist
*/
-static int custom_levdist(char *str1, char *str2, char *callback_name)
+static int custom_levdist(char *str1, char *str2, char *callback_name TSRMLS_DC)
{
- TSRMLS_FETCH();
-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The general Levenshtein support is not there yet");
/* not there yet */
convert_to_string_ex(callback_name);
distance = custom_levdist(Z_STRVAL_PP(str1), Z_STRVAL_PP(str2),
- Z_STRVAL_PP(callback_name));
+ Z_STRVAL_PP(callback_name) TSRMLS_CC);
break;
default:
int result = 0;
if (SG(request_info).headers_only) {
- php_header();
+ php_header(TSRMLS_C);
zend_bailout();
}
- if (php_header()) {
+ if (php_header(TSRMLS_C)) {
if (zend_is_compiling(TSRMLS_C)) {
OG(output_start_filename) = zend_get_compiled_filename(TSRMLS_C);
OG(output_start_lineno) = zend_get_compiled_lineno(TSRMLS_C);
if (php_info_logos(SG(request_info).query_string+1 TSRMLS_CC)) {
return 1;
} else if (!strcmp(SG(request_info).query_string+1, PHP_CREDITS_GUID)) {
- php_print_credits(PHP_CREDITS_ALL);
+ php_print_credits(PHP_CREDITS_ALL TSRMLS_CC);
return 1;
}
}
}
php_end_ob_buffers(1 TSRMLS_CC);
- php_header();
+ php_header(TSRMLS_C);
if (run_sub_req(rr)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", (*filename)->value.str.val);
/* Flush everything. */
php_end_ob_buffers(1 TSRMLS_CC);
- php_header();
+ php_header(TSRMLS_C);
if (ap_run_sub_req(rr)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", Z_STRVAL_PP(filename));
}
php_end_ob_buffers(1 TSRMLS_CC);
- php_header();
+ php_header(TSRMLS_C);
if (run_sub_req(rr)) {
php_error(E_WARNING, "Unable to include '%s' - request execution failed", (*filename)->value.str.val);
static void sapi_cgi_log_message(char *message)
{
- if (php_header()) {
+ TSRMLS_FETCH();
+
+ if (php_header(TSRMLS_C)) {
fprintf(stderr, "%s", message);
fprintf(stderr, "\n");
}
static void sapi_cli_log_message(char *message)
{
- if (php_header()) {
+ TSRMLS_FETCH();
+
+ if (php_header(TSRMLS_C)) {
fprintf(stderr, "%s", message);
fprintf(stderr, "\n");
}
}
} else {
php_execute_script(&file_handle TSRMLS_CC);
- php_header(); /* Make sure headers have been sent */
+ php_header(TSRMLS_C); /* Make sure headers have been sent */
}
/*