diff options
Diffstat (limited to 'sapi')
89 files changed, 2047 insertions, 2126 deletions
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c index 2796dd23a5..9df215ecd6 100644 --- a/sapi/aolserver/aolserver.c +++ b/sapi/aolserver/aolserver.c @@ -86,7 +86,7 @@ static void php_ns_config(php_ns_context *ctx, char global); */ static int -php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) +php_ns_sapi_ub_write(const char *str, uint str_length) { int n; uint sent = 0; @@ -111,7 +111,7 @@ php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) */ static int -php_ns_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) +php_ns_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers) { char *header_name, *header_content; char *p; @@ -145,7 +145,7 @@ php_ns_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct */ static int -php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers) { if(SG(sapi_headers).send_default_content_type) { Ns_ConnSetRequiredHeaders(NSG(conn), "text/html", 0); @@ -162,7 +162,7 @@ php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) */ static int -php_ns_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) +php_ns_sapi_read_post(char *buf, uint count_bytes) { uint max_read; uint total_read = 0; @@ -185,7 +185,7 @@ php_ns_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) * the HTTP request header */ -static char *php_ns_sapi_read_cookies(TSRMLS_D) +static char *php_ns_sapi_read_cookies(void) { int i; char *http_cookie = NULL; @@ -295,13 +295,13 @@ php_ns_startup(sapi_module_struct *sapi_module) */ #define ADD_STRINGX(name, buf) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) + php_register_variable(name, buf, track_vars_array) #define ADD_STRING(name) \ ADD_STRINGX(name, buf) static void -php_ns_sapi_register_variables(zval *track_vars_array TSRMLS_DC) +php_ns_sapi_register_variables(zval *track_vars_array) { int i; char buf[NS_BUF_SIZE + 1]; @@ -402,7 +402,7 @@ static sapi_module_struct aolserver_sapi_module = { */ static int -php_ns_module_main(TSRMLS_D) +php_ns_module_main(void) { zend_file_handle file_handle; @@ -412,11 +412,11 @@ php_ns_module_main(TSRMLS_D) file_handle.opened_path = NULL; php_ns_config(global_context, 0); - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { return NS_ERROR; } - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); php_request_shutdown(NULL); return NS_OK; @@ -428,7 +428,7 @@ php_ns_module_main(TSRMLS_D) */ static void -php_ns_request_ctor(TSRMLS_D) +php_ns_request_ctor(void) { char *server; Ns_DString ds; @@ -477,7 +477,7 @@ php_ns_request_ctor(TSRMLS_D) */ static void -php_ns_request_dtor(TSRMLS_D) +php_ns_request_dtor(void) { free(SG(request_info).path_translated); if (SG(request_info).query_string) @@ -494,17 +494,16 @@ static int php_ns_request_handler(void *context, Ns_Conn *conn) { int status = NS_OK; - TSRMLS_FETCH(); NSG(conn) = conn; SG(server_context) = global_context; - php_ns_request_ctor(TSRMLS_C); + php_ns_request_ctor(); - status = php_ns_module_main(TSRMLS_C); + status = php_ns_module_main(); - php_ns_request_dtor(TSRMLS_C); + php_ns_request_dtor(); return status; } diff --git a/sapi/apache/mod_php7.c b/sapi/apache/mod_php7.c index 687586952f..afd1d18472 100644 --- a/sapi/apache/mod_php7.c +++ b/sapi/apache/mod_php7.c @@ -30,13 +30,13 @@ /* {{{ Prototypes */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC); +int apache_php_module_main(request_rec *r, int display_source_mode); static void php_save_umask(void); static void php_restore_umask(void); -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC); -static char *sapi_apache_read_cookies(TSRMLS_D); -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC); -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC); +static int sapi_apache_read_post(char *buffer, uint count_bytes); +static char *sapi_apache_read_cookies(void); +static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers); +static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers); static int send_php(request_rec *r, int display_source_mode, char *filename); static int send_parsed_php(request_rec * r); static int send_parsed_php_source(request_rec * r); @@ -92,7 +92,7 @@ static void php_save_umask(void) /* {{{ sapi_apache_ub_write */ -static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) +static int sapi_apache_ub_write(const char *str, uint str_length) { int ret=0; @@ -108,7 +108,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_apache_flush */ -static void sapi_apache_flush(void *server_context TSRMLS_DC) +static void sapi_apache_flush(void *server_context) { if (server_context) { #if MODULE_MAGIC_NUMBER > 19970110 @@ -122,7 +122,7 @@ static void sapi_apache_flush(void *server_context TSRMLS_DC) /* {{{ sapi_apache_read_post */ -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_apache_read_post(char *buffer, uint count_bytes) { int total_read_bytes=0, read_bytes; request_rec *r = (request_rec *) SG(server_context); @@ -155,7 +155,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) /* {{{ sapi_apache_read_cookies */ -static char *sapi_apache_read_cookies(TSRMLS_D) +static char *sapi_apache_read_cookies(void) { return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, "HTTP_COOKIE"); } @@ -163,7 +163,7 @@ static char *sapi_apache_read_cookies(TSRMLS_D) /* {{{ sapi_apache_header_handler */ -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers) { char *header_name, *header_content, *p; request_rec *r = (request_rec *) SG(server_context); @@ -218,7 +218,7 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head /* {{{ sapi_apache_send_headers */ -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers) { request_rec *r = SG(server_context); const char *sline = SG(sapi_headers).http_status_line; @@ -251,7 +251,7 @@ static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ sapi_apache_register_server_variables */ -static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_apache_register_server_variables(zval *track_vars_array) { register int i; array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env); @@ -270,8 +270,8 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_ val = ""; } val_len = strlen(val); - if (sapi_module.input_filter(PARSE_SERVER, elts[i].key, &val, val_len, &new_val_len TSRMLS_CC)) { - php_register_variable_safe(elts[i].key, val, new_val_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, elts[i].key, &val, val_len, &new_val_len)) { + php_register_variable_safe(elts[i].key, val, new_val_len, track_vars_array); } } @@ -284,11 +284,11 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_ if (symbol_table && !zend_hash_str_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")-1) && (path_translated = zend_hash_str_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME")-1)) != NULL) { - php_register_variable("PATH_TRANSLATED", Z_STRVAL_P(path_translated), track_vars_array TSRMLS_CC); + php_register_variable("PATH_TRANSLATED", Z_STRVAL_P(path_translated), track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &((request_rec *) SG(server_context))->uri, strlen(((request_rec *) SG(server_context))->uri), &new_val_len TSRMLS_CC)) { - php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &((request_rec *) SG(server_context))->uri, strlen(((request_rec *) SG(server_context))->uri), &new_val_len)) { + php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array); } } /* }}} */ @@ -307,7 +307,7 @@ static int php_apache_startup(sapi_module_struct *sapi_module) /* {{{ php_apache_log_message */ -static void php_apache_log_message(char *message TSRMLS_DC) +static void php_apache_log_message(char *message) { if (SG(server_context)) { #if MODULE_MAGIC_NUMBER >= 19970831 @@ -325,9 +325,8 @@ static void php_apache_log_message(char *message TSRMLS_DC) */ static void php_apache_request_shutdown(void *dummy) { - TSRMLS_FETCH(); - php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC); + php_output_set_status(PHP_OUTPUT_DISABLED); if (AP(in_request)) { AP(in_request) = 0; php_request_shutdown(dummy); @@ -342,7 +341,7 @@ static void php_apache_request_shutdown(void *dummy) /* {{{ php_apache_sapi_activate */ -static int php_apache_sapi_activate(TSRMLS_D) +static int php_apache_sapi_activate(void) { request_rec *r = (request_rec *) SG(server_context); @@ -369,7 +368,7 @@ static int php_apache_sapi_activate(TSRMLS_D) /* {{{ php_apache_get_stat */ -static struct stat *php_apache_get_stat(TSRMLS_D) +static struct stat *php_apache_get_stat(void) { return &((request_rec *) SG(server_context))->finfo; } @@ -377,7 +376,7 @@ static struct stat *php_apache_get_stat(TSRMLS_D) /* {{{ php_apache_getenv */ -static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC) +static char *php_apache_getenv(char *name, size_t name_len) { if (SG(server_context) == NULL) { return NULL; @@ -389,7 +388,7 @@ static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC) /* {{{ sapi_apache_get_fd */ -static int sapi_apache_get_fd(int *nfd TSRMLS_DC) +static int sapi_apache_get_fd(int *nfd) { #if PHP_APACHE_HAVE_CLIENT_FD request_rec *r = SG(server_context); @@ -408,7 +407,7 @@ static int sapi_apache_get_fd(int *nfd TSRMLS_DC) /* {{{ sapi_apache_force_http_10 */ -static int sapi_apache_force_http_10(TSRMLS_D) +static int sapi_apache_force_http_10(void) { request_rec *r = SG(server_context); @@ -420,7 +419,7 @@ static int sapi_apache_force_http_10(TSRMLS_D) /* {{{ sapi_apache_get_target_uid */ -static int sapi_apache_get_target_uid(uid_t *obj TSRMLS_DC) +static int sapi_apache_get_target_uid(uid_t *obj) { *obj = ap_user_id; return SUCCESS; @@ -429,7 +428,7 @@ static int sapi_apache_get_target_uid(uid_t *obj TSRMLS_DC) /* {{{ sapi_apache_get_target_gid */ -static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC) +static int sapi_apache_get_target_gid(gid_t *obj) { *obj = ap_group_id; return SUCCESS; @@ -438,7 +437,7 @@ static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC) /* {{{ php_apache_get_request_time */ -static double php_apache_get_request_time(TSRMLS_D) +static double php_apache_get_request_time(void) { return (double) ((request_rec *)SG(server_context))->request_time; } @@ -446,7 +445,7 @@ static double php_apache_get_request_time(TSRMLS_D) /* {{{ sapi_apache_child_terminate */ -static void sapi_apache_child_terminate(TSRMLS_D) +static void sapi_apache_child_terminate(void) { #ifndef MULTITHREAD ap_child_terminate((request_rec *)SG(server_context)); @@ -517,7 +516,7 @@ static void php_restore_umask(void) /* {{{ init_request_info */ -static void init_request_info(TSRMLS_D) +static void init_request_info(void) { request_rec *r = ((request_rec *) SG(server_context)); char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); @@ -564,7 +563,7 @@ static void init_request_info(TSRMLS_D) /* {{{ php_apache_alter_ini_entries */ -static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC) +static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry) { zend_string *key = STR_INIT(per_dir_entry->key, per_dir_entry->key_length, 0); zend_alter_ini_entry_chars(key, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, per_dir_entry->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE); @@ -575,7 +574,7 @@ static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_ /* {{{ php_apache_get_default_mimetype */ -static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) +static char *php_apache_get_default_mimetype(request_rec *r) { char *mimetype; @@ -583,7 +582,7 @@ static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) /* Assume output will be of the default MIME type. Individual scripts may change this later. */ char *tmpmimetype; - tmpmimetype = sapi_get_default_content_type(TSRMLS_C); + tmpmimetype = sapi_get_default_content_type(); mimetype = pstrdup(r->pool, tmpmimetype); efree(tmpmimetype); } else { @@ -599,7 +598,6 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) { int retval; HashTable *per_dir_conf; - TSRMLS_FETCH(); if (AP(in_request)) { zend_file_handle fh; @@ -609,7 +607,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) fh.free_filename = 0; fh.type = ZEND_HANDLE_FILENAME; - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh); + zend_execute_scripts(ZEND_INCLUDE, NULL, 1, &fh); return OK; } @@ -624,16 +622,16 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php7_module); if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); + zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries); } /* If PHP parser engine has been turned off with an "engine off" * directive, then decline to handle this request */ if (!AP(engine)) { - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); + r->content_type = php_apache_get_default_mimetype(r); zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return DECLINED; } @@ -645,7 +643,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) #if MODULE_MAGIC_NUMBER > 19961007 if ((retval = setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) { zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return retval; } @@ -655,7 +653,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) #if MODULE_MAGIC_NUMBER < 19970912 if ((retval = set_last_modified(r, r->finfo.st_mtime))) { zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return retval; } @@ -667,7 +665,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) } /* Assume output will be of the default MIME type. Individual scripts may change this later in the request. */ - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); + r->content_type = php_apache_get_default_mimetype(r); /* Init timeout */ hard_timeout("send", r); @@ -676,8 +674,8 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) add_common_vars(r); add_cgi_vars(r); - init_request_info(TSRMLS_C); - apache_php_module_main(r, display_source_mode TSRMLS_CC); + init_request_info(); + apache_php_module_main(r, display_source_mode); /* Done, restore umask, turn off timeout, close file and return */ php_restore_umask(); @@ -693,10 +691,9 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) static int send_parsed_php(request_rec * r) { int result = send_php(r, 0, NULL); - TSRMLS_FETCH(); ap_table_setn(r->notes, "mod_php_memory_usage", - ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1 TSRMLS_CC))); + ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1))); return result; } @@ -904,18 +901,17 @@ static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf, static int php_xbithack_handler(request_rec * r) { HashTable *per_dir_conf; - TSRMLS_FETCH(); if (!(r->finfo.st_mode & S_IXUSR)) { return DECLINED; } per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php7_module); if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); + zend_hash_apply((HashTable *) per_dir_conf, (apply_func_t) php_apache_alter_ini_entries); } if(!AP(xbithack)) { zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return DECLINED; } @@ -973,8 +969,7 @@ static void php_init_handler(server_rec *s, pool *p) } #if MODULE_MAGIC_NUMBER >= 19980527 { - TSRMLS_FETCH(); - if (PG(expose_php)) { + if (PG(expose_php)) { ap_add_version_component("PHP/" PHP_VERSION); } } diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c index f6e9e61203..b151495b66 100644 --- a/sapi/apache/php_apache.c +++ b/sapi/apache/php_apache.c @@ -120,7 +120,7 @@ PHP_INI_END() -static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC) +static void php_apache_globals_ctor(php_apache_info_struct *apache_globals) { apache_globals->in_request = 0; } @@ -131,7 +131,7 @@ static PHP_MINIT_FUNCTION(apache) #ifdef ZTS ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL); #else - php_apache_globals_ctor(&php_apache_info TSRMLS_CC); + php_apache_globals_ctor(&php_apache_info); #endif REGISTER_INI_ENTRIES(); return SUCCESS; @@ -298,11 +298,11 @@ PHP_FUNCTION(apache_child_terminate) ap_child_terminate( ((request_rec *)SG(server_context)) ); RETURN_TRUE; } else { /* tell them to get lost! */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is disabled"); + php_error_docref(NULL, E_WARNING, "This function is disabled"); RETURN_FALSE; } #else - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not supported in this build"); + php_error_docref(NULL, E_WARNING, "This function is not supported in this build"); RETURN_FALSE; #endif } @@ -316,7 +316,7 @@ PHP_FUNCTION(apache_note) int note_name_len, note_val_len; char *old_val; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { return; } @@ -350,29 +350,29 @@ PHP_FUNCTION(virtual) int filename_len; request_rec *rr = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { return; } if (!(rr = sub_req_lookup_uri (filename, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); if (rr) destroy_sub_req (rr); RETURN_FALSE; } if (rr->status != 200) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename); if (rr) destroy_sub_req (rr); RETURN_FALSE; } - php_output_end_all(TSRMLS_C); - php_header(TSRMLS_C); + php_output_end_all(); + php_header(); if (run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - request execution failed", filename); if (rr) destroy_sub_req (rr); RETURN_FALSE; @@ -440,7 +440,7 @@ PHP_FUNCTION(apache_setenv) char *var = NULL, *val = NULL; request_rec *r = (request_rec *) SG(server_context); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) { return; } @@ -462,12 +462,12 @@ PHP_FUNCTION(apache_lookup_uri) int filename_len; request_rec *rr=NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) { return; } if (!(rr = sub_req_lookup_uri(filename, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed '%s'", filename); + php_error_docref(NULL, E_WARNING, "URI lookup failed '%s'", filename); RETURN_FALSE; } @@ -540,12 +540,12 @@ PHP_FUNCTION(apache_exec_uri) int filename_len; request_rec *rr=NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) { return; } if(!(rr = ap_sub_req_lookup_uri(filename, ((request_rec *) SG(server_context))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed", filename); + php_error_docref(NULL, E_WARNING, "URI lookup failed", filename); RETURN_FALSE; } diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c index 466cf6b8ff..f0c54c59ad 100644 --- a/sapi/apache/sapi_apache.c +++ b/sapi/apache/sapi_apache.c @@ -25,12 +25,12 @@ /* {{{ apache_php_module_main */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) +int apache_php_module_main(request_rec *r, int display_source_mode) { int retval = OK; zend_file_handle file_handle; - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { return FAILURE; } /* sending a file handle to another dll is not working @@ -40,7 +40,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); - if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC) != SUCCESS) { + if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini) != SUCCESS) { retval = NOT_FOUND; } } else { @@ -50,7 +50,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) file_handle.opened_path = NULL; file_handle.free_filename = 0; - (void) php_execute_script(&file_handle TSRMLS_CC); + (void) php_execute_script(&file_handle); } AP(in_request) = 0; diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h index 7918cf6de8..5d9e795667 100644 --- a/sapi/apache2filter/php_apache.h +++ b/sapi/apache2filter/php_apache.h @@ -54,8 +54,8 @@ char *get_php_config(void *conf, char *name, size_t name_len); void apply_config(void *); extern const command_rec php_dir_cmds[]; -static size_t php_apache_read_stream(void *, char *, size_t TSRMLS_DC); -static size_t php_apache_fsizer_stream(void * TSRMLS_DC); +static size_t php_apache_read_stream(void *, char *, size_t); +static size_t php_apache_fsizer_stream(void *); #define APR_ARRAY_FOREACH_OPEN(arr, key, val) \ { \ diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c index ea137384f2..ad0f229003 100644 --- a/sapi/apache2filter/php_functions.c +++ b/sapi/apache2filter/php_functions.c @@ -43,7 +43,7 @@ #include "php_apache.h" -static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) +static request_rec *php_apache_lookup_uri(char *filename) { php_struct *ctx; @@ -63,18 +63,18 @@ PHP_FUNCTION(virtual) int filename_len; request_rec *rr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { return; } - if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); + if (!(rr = php_apache_lookup_uri(filename))) { + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); RETURN_FALSE; } if (rr->status == HTTP_OK) { if (ap_run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - request execution failed", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -82,7 +82,7 @@ PHP_FUNCTION(virtual) RETURN_TRUE; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -101,12 +101,12 @@ PHP_FUNCTION(apache_lookup_uri) char *filename; int filename_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { return; } - if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); + if (!(rr = php_apache_lookup_uri(filename))) { + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); RETURN_FALSE; } @@ -143,7 +143,7 @@ PHP_FUNCTION(apache_lookup_uri) return; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -197,7 +197,7 @@ PHP_FUNCTION(apache_note) int note_name_len, note_val_len; char *old_note_val=NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { return; } @@ -228,7 +228,7 @@ PHP_FUNCTION(apache_setenv) zend_bool walk_to_top = 0; int arg_count = ZEND_NUM_ARGS(); - if (zend_parse_parameters(arg_count TSRMLS_CC, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) { + if (zend_parse_parameters(arg_count, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) { return; } @@ -257,7 +257,7 @@ PHP_FUNCTION(apache_getenv) int arg_count = ZEND_NUM_ARGS(); char *env_val=NULL; - if (zend_parse_parameters(arg_count TSRMLS_CC, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) { + if (zend_parse_parameters(arg_count, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) { return; } diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index 389686124d..315fafd550 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -64,7 +64,7 @@ char *apache2_php_ini_path_override = NULL; static int -php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) +php_apache_sapi_ub_write(const char *str, uint str_length) { apr_bucket *b; apr_bucket_brigade *bb; @@ -91,7 +91,7 @@ php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) } static int -php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) +php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers) { php_struct *ctx; char *val, *ptr; @@ -141,7 +141,7 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e } static int -php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers) { php_struct *ctx = SG(server_context); @@ -151,7 +151,7 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) } static int -php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) +php_apache_sapi_read_post(char *buf, uint count_bytes) { apr_size_t len; php_struct *ctx = SG(server_context); @@ -177,7 +177,7 @@ php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) return len; } static struct stat* -php_apache_sapi_get_stat(TSRMLS_D) +php_apache_sapi_get_stat(void) { php_struct *ctx = SG(server_context); @@ -202,7 +202,7 @@ php_apache_sapi_get_stat(TSRMLS_D) } static char * -php_apache_sapi_read_cookies(TSRMLS_D) +php_apache_sapi_read_cookies(void) { php_struct *ctx = SG(server_context); const char *http_cookie; @@ -214,7 +214,7 @@ php_apache_sapi_read_cookies(TSRMLS_D) } static char * -php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) +php_apache_sapi_getenv(char *name, size_t name_len) { php_struct *ctx = SG(server_context); const char *env_var; @@ -225,7 +225,7 @@ php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) } static void -php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) +php_apache_sapi_register_variables(zval *track_vars_array) { php_struct *ctx = SG(server_context); const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); @@ -236,19 +236,19 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) if (!val) { val = ""; } - if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len TSRMLS_CC)) { - php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), &new_val_len)) { + php_register_variable_safe(key, val, new_val_len, track_vars_array); } APR_ARRAY_FOREACH_CLOSE() - php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC); - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC); + php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val_len)) { + php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array); } } static void -php_apache_sapi_flush(void *server_context TSRMLS_DC) +php_apache_sapi_flush(void *server_context) { php_struct *ctx; apr_bucket_brigade *bb; @@ -263,7 +263,7 @@ php_apache_sapi_flush(void *server_context TSRMLS_DC) if (!server_context) return; - sapi_send_headers(TSRMLS_C); + sapi_send_headers(); ctx->r->status = SG(sapi_headers).http_response_code; SG(headers_sent) = 1; @@ -284,7 +284,7 @@ php_apache_sapi_flush(void *server_context TSRMLS_DC) } } -static void php_apache_sapi_log_message(char *msg TSRMLS_DC) +static void php_apache_sapi_log_message(char *msg) { php_struct *ctx; @@ -310,7 +310,7 @@ php_apache_disable_caching(ap_filter_t *f) return OK; } -static double php_apache_sapi_get_request_time(TSRMLS_D) +static double php_apache_sapi_get_request_time(void) { php_struct *ctx = SG(server_context); return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0; @@ -363,7 +363,6 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, { php_struct *ctx; apr_status_t rv; - TSRMLS_FETCH(); if (f->r->proxyreq) { return ap_get_brigade(f->next, bb, mode, block, readbytes); @@ -392,7 +391,7 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, return APR_SUCCESS; } -static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC) +static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx) { char *content_type; char *content_length; @@ -409,7 +408,7 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC) SG(request_info).request_uri = safe_strdup(f->r->uri); SG(request_info).path_translated = safe_strdup(f->r->filename); f->r->no_local_copy = 1; - content_type = sapi_get_default_content_type(TSRMLS_C); + content_type = sapi_get_default_content_type(); f->r->content_type = apr_pstrdup(f->r->pool, content_type); efree(content_type); @@ -423,7 +422,7 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC) apr_table_unset(f->r->headers_out, "ETag"); auth = apr_table_get(f->r->headers_in, "Authorization"); - php_handle_auth_data(auth TSRMLS_CC); + php_handle_auth_data(auth); if (SG(request_info).auth_user == NULL && f->r->user) { SG(request_info).auth_user = estrdup(f->r->user); @@ -431,10 +430,10 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC) ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); - php_request_startup(TSRMLS_C); + php_request_startup(); } -static void php_apache_request_dtor(ap_filter_t *f TSRMLS_DC) +static void php_apache_request_dtor(ap_filter_t *f) { php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)f->ctx; @@ -461,11 +460,10 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) zend_file_handle zfd; php_apr_bucket_brigade *pbb; apr_bucket *b; - TSRMLS_FETCH(); if (f->r->proxyreq) { zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return ap_pass_brigade(f->next, bb); } @@ -473,7 +471,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) /* handle situations where user turns the engine off */ if (*p == '0') { zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return ap_pass_brigade(f->next, bb); } @@ -512,7 +510,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, "php failed to get server context"); zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return HTTP_INTERNAL_SERVER_ERROR; } @@ -521,13 +519,13 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) if (ctx->request_processed) { zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return ap_pass_brigade(f->next, bb); } apply_config(conf); - php_apache_request_ctor(f, ctx TSRMLS_CC); + php_apache_request_ctor(f, ctx); /* It'd be nice if we could highlight based of a zend_file_handle here.... * ...but we can't. */ @@ -544,12 +542,12 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) zfd.opened_path = NULL; zfd.free_filename = 0; - php_execute_script(&zfd TSRMLS_CC); + php_execute_script(&zfd); apr_table_set(ctx->r->notes, "mod_php_memory_usage", - apr_psprintf(ctx->r->pool, "%lu", (unsigned long) zend_memory_peak_usage(1 TSRMLS_CC))); + apr_psprintf(ctx->r->pool, "%lu", (unsigned long) zend_memory_peak_usage(1))); - php_apache_request_dtor(f TSRMLS_CC); + php_apache_request_dtor(f); if (!f->r->main) { ctx->request_processed = 1; @@ -575,7 +573,6 @@ php_apache_server_shutdown(void *tmp) static void php_apache_add_version(apr_pool_t *p) { - TSRMLS_FETCH(); if (PG(expose_php)) { ap_add_version_component(p, "PHP/" PHP_VERSION); } @@ -679,7 +676,6 @@ static apr_status_t php_server_context_cleanup(void *data_) static int php_post_read_request(request_rec *r) { php_struct *ctx; - TSRMLS_FETCH(); /* Initialize filter context */ SG(server_context) = ctx = apr_pcalloc(r->pool, sizeof(*ctx)); @@ -708,7 +704,7 @@ static void php_register_hook(apr_pool_t *p) ap_register_input_filter("PHP", php_input_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE); } -static size_t php_apache_read_stream(void *handle, char *buf, size_t wantlen TSRMLS_DC) +static size_t php_apache_read_stream(void *handle, char *buf, size_t wantlen) { php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)handle; apr_bucket_brigade *rbb; @@ -728,7 +724,7 @@ static size_t php_apache_read_stream(void *handle, char *buf, size_t wantlen TSR return readlen; } -static size_t php_apache_fsizer_stream(void *handle TSRMLS_DC) +static size_t php_apache_fsizer_stream(void *handle) { php_apr_bucket_brigade *pbb = (php_apr_bucket_brigade *)handle; apr_off_t actual = 0; diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index d038f9e9b9..5225090c13 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -56,7 +56,7 @@ php_apache2_info_struct php_apache2_info; #define SECTION(name) PUTS("<h2>" name "</h2>\n") -static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) +static request_rec *php_apache_lookup_uri(char *filename) { php_struct *ctx = SG(server_context); @@ -75,31 +75,31 @@ PHP_FUNCTION(virtual) size_t filename_len; request_rec *rr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { return; } - if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); + if (!(rr = php_apache_lookup_uri(filename))) { + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); RETURN_FALSE; } if (rr->status != HTTP_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } /* Flush everything. */ - php_output_end_all(TSRMLS_C); - php_header(TSRMLS_C); + php_output_end_all(); + php_header(); /* Ensure that the ap_r* layer for the main request is flushed, to * work around http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */ ap_rflush(rr->main); if (ap_run_sub_req(rr)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - request execution failed", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -121,12 +121,12 @@ PHP_FUNCTION(apache_lookup_uri) char *filename; size_t filename_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { return; } - if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); + if (!(rr = php_apache_lookup_uri(filename))) { + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); RETURN_FALSE; } @@ -163,7 +163,7 @@ PHP_FUNCTION(apache_lookup_uri) return; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename); + php_error_docref(NULL, E_WARNING, "Unable to include '%s' - error finding URI", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } @@ -225,7 +225,7 @@ PHP_FUNCTION(apache_note) size_t note_name_len, note_val_len; char *old_note_val=NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { return; } @@ -259,7 +259,7 @@ PHP_FUNCTION(apache_setenv) int arg_count = ZEND_NUM_ARGS(); request_rec *r; - if (zend_parse_parameters(arg_count TSRMLS_CC, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) { + if (zend_parse_parameters(arg_count, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) { return; } @@ -295,7 +295,7 @@ PHP_FUNCTION(apache_getenv) char *env_val=NULL; request_rec *r; - if (zend_parse_parameters(arg_count TSRMLS_CC, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) { + if (zend_parse_parameters(arg_count, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) { return; } diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 3b93c74f7a..1284b3e879 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -76,7 +76,7 @@ ZEND_TSRMLS_CACHE_DEFINE; #endif static size_t -php_apache_sapi_ub_write(const char *str, size_t str_length TSRMLS_DC) +php_apache_sapi_ub_write(const char *str, size_t str_length) { request_rec *r; php_struct *ctx; @@ -92,7 +92,7 @@ php_apache_sapi_ub_write(const char *str, size_t str_length TSRMLS_DC) } static int -php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) +php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers) { php_struct *ctx; char *val, *ptr; @@ -154,7 +154,7 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e } static int -php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers) { php_struct *ctx = SG(server_context); const char *sline = SG(sapi_headers).http_status_line; @@ -174,7 +174,7 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* call ap_set_content_type only once, else each time we call it, configured output filters for that content type will be added */ if (!ctx->content_type) { - ctx->content_type = sapi_get_default_content_type(TSRMLS_C); + ctx->content_type = sapi_get_default_content_type(); } ap_set_content_type(ctx->r, apr_pstrdup(ctx->r->pool, ctx->content_type)); efree(ctx->content_type); @@ -184,7 +184,7 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) } static apr_size_t -php_apache_sapi_read_post(char *buf, size_t count_bytes TSRMLS_DC) +php_apache_sapi_read_post(char *buf, size_t count_bytes) { apr_size_t len, tlen=0; php_struct *ctx = SG(server_context); @@ -216,7 +216,7 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes TSRMLS_DC) } static zend_stat_t* -php_apache_sapi_get_stat(TSRMLS_D) +php_apache_sapi_get_stat(void) { php_struct *ctx = SG(server_context); @@ -241,7 +241,7 @@ php_apache_sapi_get_stat(TSRMLS_D) } static char * -php_apache_sapi_read_cookies(TSRMLS_D) +php_apache_sapi_read_cookies(void) { php_struct *ctx = SG(server_context); const char *http_cookie; @@ -253,7 +253,7 @@ php_apache_sapi_read_cookies(TSRMLS_D) } static char * -php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) +php_apache_sapi_getenv(char *name, size_t name_len) { php_struct *ctx = SG(server_context); const char *env_var; @@ -268,7 +268,7 @@ php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) } static void -php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) +php_apache_sapi_register_variables(zval *track_vars_array) { php_struct *ctx = SG(server_context); const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); @@ -279,18 +279,18 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) if (!val) { val = ""; } - if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), (size_t *)&new_val_len TSRMLS_CC)) { - php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), (size_t *)&new_val_len)) { + php_register_variable_safe(key, val, new_val_len, track_vars_array); } APR_ARRAY_FOREACH_CLOSE() - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), (size_t *)&new_val_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), (size_t *)&new_val_len)) { + php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array); } } static void -php_apache_sapi_flush(void *server_context TSRMLS_DC) +php_apache_sapi_flush(void *server_context) { php_struct *ctx; request_rec *r; @@ -305,7 +305,7 @@ php_apache_sapi_flush(void *server_context TSRMLS_DC) r = ctx->r; - sapi_send_headers(TSRMLS_C); + sapi_send_headers(); r->status = SG(sapi_headers).http_response_code; SG(headers_sent) = 1; @@ -315,7 +315,7 @@ php_apache_sapi_flush(void *server_context TSRMLS_DC) } } -static void php_apache_sapi_log_message(char *msg TSRMLS_DC) +static void php_apache_sapi_log_message(char *msg) { php_struct *ctx; @@ -328,16 +328,16 @@ static void php_apache_sapi_log_message(char *msg TSRMLS_DC) } } -static void php_apache_sapi_log_message_ex(char *msg, request_rec *r TSRMLS_DC) +static void php_apache_sapi_log_message_ex(char *msg, request_rec *r) { if (r) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, msg, r->filename); } else { - php_apache_sapi_log_message(msg TSRMLS_CC); + php_apache_sapi_log_message(msg); } } -static double php_apache_sapi_get_request_time(TSRMLS_D) +static double php_apache_sapi_get_request_time(void) { php_struct *ctx = SG(server_context); return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0; @@ -406,7 +406,6 @@ static apr_status_t php_apache_child_shutdown(void *tmp) static void php_apache_add_version(apr_pool_t *p) { - TSRMLS_FETCH(); if (PG(expose_php)) { ap_add_version_component(p, "PHP/" PHP_VERSION); } @@ -472,7 +471,7 @@ static apr_status_t php_server_context_cleanup(void *data_) return APR_SUCCESS; } -static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC) +static int php_apache_request_ctor(request_rec *r, php_struct *ctx) { char *content_length; const char *auth; @@ -499,7 +498,7 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC) apr_table_unset(r->headers_out, "ETag"); auth = apr_table_get(r->headers_in, "Authorization"); - php_handle_auth_data(auth TSRMLS_CC); + php_handle_auth_data(auth); if (SG(request_info).auth_user == NULL && r->user) { SG(request_info).auth_user = estrdup(r->user); @@ -507,18 +506,18 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC) ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); - return php_request_startup(TSRMLS_C); + return php_request_startup(); } -static void php_apache_request_dtor(request_rec *r TSRMLS_DC) +static void php_apache_request_dtor(request_rec *r) { php_request_shutdown(NULL); } -static void php_apache_ini_dtor(request_rec *r, request_rec *p TSRMLS_DC) +static void php_apache_ini_dtor(request_rec *r, request_rec *p) { if (strcmp(r->protocol, "INCLUDED")) { - zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try(); + zend_try { zend_ini_deactivate(); } zend_end_try(); } else { typedef struct { HashTable config; @@ -551,7 +550,7 @@ static int php_handler(request_rec *r) ZEND_TSRMLS_CACHE_UPDATE; #endif -#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC); +#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req); conf = ap_get_module_config(r->per_dir_config, &php7_module); @@ -596,12 +595,12 @@ normal: } if (r->finfo.filetype == 0) { - php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r TSRMLS_CC); + php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r); PHPAP_INI_OFF; return HTTP_NOT_FOUND; } if (r->finfo.filetype == APR_DIR) { - php_apache_sapi_log_message_ex("attempt to invoke directory '%s' as script", r TSRMLS_CC); + php_apache_sapi_log_message_ex("attempt to invoke directory '%s' as script", r); PHPAP_INI_OFF; return HTTP_FORBIDDEN; } @@ -623,7 +622,7 @@ zend_first_try { ctx = SG(server_context); ctx->brigade = brigade; - if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { + if (php_apache_request_ctor(r, ctx)!=SUCCESS) { zend_bailout(); } } else { @@ -634,7 +633,7 @@ zend_first_try { strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) { - if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { + if (php_apache_request_ctor(r, ctx)!=SUCCESS) { zend_bailout(); } } @@ -662,7 +661,7 @@ zend_first_try { if (strncmp(r->handler, PHP_SOURCE_MAGIC_TYPE, sizeof(PHP_SOURCE_MAGIC_TYPE) - 1) == 0) { zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); - highlight_file((char *)r->filename, &syntax_highlighter_ini TSRMLS_CC); + highlight_file((char *)r->filename, &syntax_highlighter_ini); } else { zend_file_handle zfd; @@ -672,19 +671,19 @@ zend_first_try { zfd.opened_path = NULL; if (!parent_req) { - php_execute_script(&zfd TSRMLS_CC); + php_execute_script(&zfd); } else { - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &zfd); + zend_execute_scripts(ZEND_INCLUDE, NULL, 1, &zfd); } apr_table_set(r->notes, "mod_php_memory_usage", - apr_psprintf(ctx->r->pool, "%" APR_SIZE_T_FMT, zend_memory_peak_usage(1 TSRMLS_CC))); + apr_psprintf(ctx->r->pool, "%" APR_SIZE_T_FMT, zend_memory_peak_usage(1))); } } zend_end_try(); if (!parent_req) { - php_apache_request_dtor(r TSRMLS_CC); + php_apache_request_dtor(r); ctx->request_processed = 1; bucket = apr_bucket_eos_create(r->connection->bucket_alloc); APR_BRIGADE_INSERT_TAIL(brigade, bucket); diff --git a/sapi/apache_hooks/mod_php7.c b/sapi/apache_hooks/mod_php7.c index 33e0931fb6..cd1e733f32 100644 --- a/sapi/apache_hooks/mod_php7.c +++ b/sapi/apache_hooks/mod_php7.c @@ -29,13 +29,13 @@ /* {{{ Prototypes */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC); +int apache_php_module_main(request_rec *r, int display_source_mode); static void php_save_umask(void); static void php_restore_umask(void); -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC); -static char *sapi_apache_read_cookies(TSRMLS_D); -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC); -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC); +static int sapi_apache_read_post(char *buffer, uint count_bytes); +static char *sapi_apache_read_cookies(void); +static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers); +static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers); static int send_php(request_rec *r, int display_source_mode, char *filename); static int send_parsed_php(request_rec * r); static int send_parsed_php_source(request_rec * r); @@ -237,7 +237,7 @@ static void php_save_umask(void) /* {{{ sapi_apache_ub_write */ -static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) +static int sapi_apache_ub_write(const char *str, uint str_length) { int ret=0; @@ -253,7 +253,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_apache_flush */ -static void sapi_apache_flush(void *server_context TSRMLS_DC) +static void sapi_apache_flush(void *server_context) { if (server_context) { #if MODULE_MAGIC_NUMBER > 19970110 @@ -267,7 +267,7 @@ static void sapi_apache_flush(void *server_context TSRMLS_DC) /* {{{ sapi_apache_read_post */ -static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_apache_read_post(char *buffer, uint count_bytes) { uint total_read_bytes=0, read_bytes; request_rec *r = (request_rec *) SG(server_context); @@ -300,7 +300,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC) /* {{{ sapi_apache_read_cookies */ -static char *sapi_apache_read_cookies(TSRMLS_D) +static char *sapi_apache_read_cookies(void) { return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, "HTTP_COOKIE"); } @@ -308,7 +308,7 @@ static char *sapi_apache_read_cookies(TSRMLS_D) /* {{{ sapi_apache_header_handler */ -static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers) { char *header_name, *header_content, *p; request_rec *r = (request_rec *) SG(server_context); @@ -361,7 +361,7 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head /* {{{ sapi_apache_send_headers */ -static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers) { if(SG(server_context) == NULL) { /* server_context is not here anymore */ return SAPI_HEADER_SEND_FAILED; @@ -381,7 +381,7 @@ static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ sapi_apache_register_server_variables */ -static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_apache_register_server_variables(zval *track_vars_array) { register int i; array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env); @@ -397,7 +397,7 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_ } else { val = ""; } - php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC); + php_register_variable(elts[i].key, val, track_vars_array ); } /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */ @@ -409,10 +409,10 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_ if (symbol_table && !zend_hash_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")) && zend_hash_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated)==SUCCESS) { - php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC); + php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array); } - php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC); + php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array); } /* }}} */ @@ -430,7 +430,7 @@ static int php_apache_startup(sapi_module_struct *sapi_module) /* {{{ php_apache_log_message */ -static void php_apache_log_message(char *message TSRMLS_DC) +static void php_apache_log_message(char *message) { if (SG(server_context)) { #if MODULE_MAGIC_NUMBER >= 19970831 @@ -449,9 +449,8 @@ static void php_apache_log_message(char *message TSRMLS_DC) */ static void php_apache_request_shutdown(void *dummy) { - TSRMLS_FETCH(); AP(current_hook) = AP_CLEANUP; - php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC); + php_output_set_status(PHP_OUTPUT_DISABLED); SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */ if(SG(sapi_started)) { php_request_shutdown(dummy); @@ -468,7 +467,7 @@ static void php_apache_request_shutdown(void *dummy) /* {{{ php_apache_sapi_activate */ -static int php_apache_sapi_activate(TSRMLS_D) +static int php_apache_sapi_activate(void) { request_rec *r = (request_rec *) SG(server_context); @@ -495,7 +494,7 @@ static int php_apache_sapi_activate(TSRMLS_D) /* {{{ php_apache_get_stat */ -static struct stat *php_apache_get_stat(TSRMLS_D) +static struct stat *php_apache_get_stat(void) { return &((request_rec *) SG(server_context))->finfo; } @@ -503,7 +502,7 @@ static struct stat *php_apache_get_stat(TSRMLS_D) /* {{{ php_apache_getenv */ -static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC) +static char *php_apache_getenv(char *name, size_t name_len) { return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name); } @@ -569,7 +568,7 @@ static void php_restore_umask(void) /* {{{ init_request_info */ -static void init_request_info(TSRMLS_D) +static void init_request_info(void) { request_rec *r = ((request_rec *) SG(server_context)); char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); @@ -614,7 +613,7 @@ static void init_request_info(TSRMLS_D) /* {{{ php_apache_alter_ini_entries */ -static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC) +static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry) { zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE); return 0; @@ -623,7 +622,7 @@ static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_ /* {{{ php_apache_get_default_mimetype */ -static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) +static char *php_apache_get_default_mimetype(request_rec *r) { char *mimetype; @@ -631,7 +630,7 @@ static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) /* Assume output will be of the default MIME type. Individual scripts may change this later. */ char *tmpmimetype; - tmpmimetype = sapi_get_default_content_type(TSRMLS_C); + tmpmimetype = sapi_get_default_content_type(); mimetype = pstrdup(r->pool, tmpmimetype); efree(tmpmimetype); } else { @@ -647,7 +646,6 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) { int retval; php_per_dir_config *per_dir_conf; - TSRMLS_FETCH(); if (AP(in_request)) { zend_file_handle fh; @@ -656,7 +654,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) fh.free_filename = 0; fh.type = ZEND_HANDLE_FILENAME; - zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh); + zend_execute_scripts(ZEND_INCLUDE, NULL, 1, &fh); return OK; } @@ -669,17 +667,17 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) per_dir_conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); if (per_dir_conf) { - zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); + zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries); } /* If PHP parser engine has been turned off with an "engine off" * directive, then decline to handle this request */ if (!AP(engine)) { - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); + r->content_type = php_apache_get_default_mimetype(r); r->allowed |= (1 << METHODS) - 1; zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return DECLINED; } @@ -691,7 +689,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) #if MODULE_MAGIC_NUMBER > 19961007 if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) { zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return retval; } @@ -701,7 +699,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) #if MODULE_MAGIC_NUMBER < 19970912 if ((retval = set_last_modified(r, r->finfo.st_mtime))) { zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return retval; } @@ -713,7 +711,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) } /* Assume output will be of the default MIME type. Individual scripts may change this later in the request. */ - r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); + r->content_type = php_apache_get_default_mimetype(r); /* Init timeout */ hard_timeout("send", r); @@ -726,8 +724,8 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) add_common_vars(r); add_cgi_vars(r); } - init_request_info(TSRMLS_C); - apache_php_module_main(r, display_source_mode TSRMLS_CC); + init_request_info(); + apache_php_module_main(r, display_source_mode); /* Done, restore umask, turn off timeout, close file and return */ php_restore_umask(); @@ -743,10 +741,9 @@ static int send_php(request_rec *r, int display_source_mode, char *filename) static int send_parsed_php(request_rec * r) { int result = send_php(r, 0, NULL); - TSRMLS_FETCH(); ap_table_setn(r->notes, "mod_php_memory_usage", - ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC))); + ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1))); return result; } @@ -1178,7 +1175,6 @@ static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf, static int php_xbithack_handler(request_rec * r) { php_per_dir_config *conf; - TSRMLS_FETCH(); if (!(r->finfo.st_mode & S_IXUSR)) { r->allowed |= (1 << METHODS) - 1; @@ -1186,12 +1182,12 @@ static int php_xbithack_handler(request_rec * r) } conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); if (conf) { - zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); + zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries); } if(!AP(xbithack)) { r->allowed |= (1 << METHODS) - 1; zend_try { - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); } zend_end_try(); return DECLINED; } @@ -1249,8 +1245,7 @@ static void php_init_handler(server_rec *s, pool *p) } #if MODULE_MAGIC_NUMBER >= 19980527 { - TSRMLS_FETCH(); - if (PG(expose_php)) { + if (PG(expose_php)) { ap_add_version_component("PHP/" PHP_VERSION); } } @@ -1263,12 +1258,11 @@ static int php_run_hook(php_handler *handler, request_rec *r) zval *ret = NULL; php_per_dir_config *conf; - TSRMLS_FETCH(); if(!AP(apache_config_loaded)) { conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); if (conf) - zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC); + zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries); AP(apache_config_loaded) = 1; } if (!handler->name) { @@ -1281,8 +1275,8 @@ static int php_run_hook(php_handler *handler, request_rec *r) add_cgi_vars(r); } SG(server_context) = r; - init_request_info(TSRMLS_C); - apache_php_module_hook(r, handler, &ret TSRMLS_CC); + init_request_info(); + apache_php_module_hook(r, handler, &ret); php_restore_umask(); kill_timeout(r); if (ret) { @@ -1296,7 +1290,6 @@ static int php_run_hook(php_handler *handler, request_rec *r) static int php_uri_translation(request_rec *r) { php_per_server_config *conf; - TSRMLS_FETCH(); AP(current_hook) = AP_URI_TRANS; conf = (php_per_server_config *) get_module_config(r->server->module_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_equals(&conf->uri_handlers, @@ -1307,7 +1300,6 @@ static int php_uri_translation(request_rec *r) static int php_header_hook(request_rec *r) { php_per_dir_config *conf; - TSRMLS_FETCH(); AP(current_hook) = AP_HEADER_PARSE; conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_http_error(&conf->headers_handlers, @@ -1318,7 +1310,6 @@ static int php_header_hook(request_rec *r) static int php_auth_hook(request_rec *r) { php_per_dir_config *conf; - TSRMLS_FETCH(); AP(current_hook) = AP_AUTHENTICATION; conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_equals(&conf->auth_handlers, @@ -1330,7 +1321,6 @@ static int php_access_hook(request_rec *r) { php_per_dir_config *conf; int status = DECLINED; - TSRMLS_FETCH(); AP(current_hook) = AP_ACCESS_CONTROL; conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); status = sapi_stack_apply_with_argument_stop_if_http_error(&conf->access_handlers, @@ -1343,7 +1333,6 @@ static int php_access_hook(request_rec *r) static int php_type_hook(request_rec *r) { php_per_dir_config *conf; - TSRMLS_FETCH(); AP(current_hook) = AP_TYPE_CHECKING; conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_equals(&conf->type_handlers, @@ -1355,7 +1344,6 @@ static int php_type_hook(request_rec *r) static int php_fixup_hook(request_rec *r) { php_per_dir_config *conf; - TSRMLS_FETCH(); AP(current_hook) = AP_FIXUP; conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_http_error(&conf->fixup_handlers, @@ -1367,7 +1355,6 @@ static int php_fixup_hook(request_rec *r) static int php_logger_hook(request_rec *r) { php_per_dir_config *conf; - TSRMLS_FETCH(); AP(current_hook) = AP_LOGGING; conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_stop_if_http_error(&conf->logger_handlers, @@ -1380,7 +1367,6 @@ static int php_post_read_hook(request_rec *r) { php_per_dir_config *conf; php_per_server_config *svr; - TSRMLS_FETCH(); AP(current_hook) = AP_POST_READ; svr = get_module_config(r->server->module_config, &php7_module); if(ap_is_initial_req(r)) { @@ -1395,7 +1381,6 @@ static int php_post_read_hook(request_rec *r) static int php_response_handler(request_rec *r) { php_per_dir_config *conf; - TSRMLS_FETCH(); AP(current_hook) = AP_RESPONSE; conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module); return sapi_stack_apply_with_argument_all(&conf->response_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c index e5bd3f5d61..57b4505f10 100644 --- a/sapi/apache_hooks/php_apache.c +++ b/sapi/apache_hooks/php_apache.c @@ -105,7 +105,7 @@ PHP_INI_BEGIN() PHP_INI_END() /* }}} */ -static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC) +static void php_apache_globals_ctor(php_apache_info_struct *apache_globals) { apache_globals->in_request = 0; } @@ -113,20 +113,20 @@ static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRML #define APREQ_GET_THIS(ZVAL) if (NULL == (ZVAL = getThis())) { \ php_error(E_WARNING, "%s(): underlying ApacheRequest object missing", \ - get_active_function_name(TSRMLS_C)); \ + get_active_function_name()); \ RETURN_FALSE; \ } #define APREQ_GET_REQUEST(ZVAL, R) APREQ_GET_THIS(ZVAL); \ - R = get_apache_request(ZVAL TSRMLS_CC) + R = get_apache_request(ZVAL) -static void php_apache_request_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) +static void php_apache_request_free(zend_rsrc_list_entry *rsrc) { zval *z = (zval *)rsrc->ptr; /* fprintf(stderr, "%s() %p\n", __FUNCTION__, z); */ zval_ptr_dtor(&z); } -static request_rec *get_apache_request(zval *z TSRMLS_DC) +static request_rec *get_apache_request(zval *z) { request_rec *r; zval **addr; @@ -137,28 +137,28 @@ static request_rec *get_apache_request(zval *z TSRMLS_DC) } if (Z_TYPE_P(z) != IS_OBJECT) { - php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C)); + php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name()); return NULL; } if (zend_hash_index_find(Z_OBJPROP_P(z), 0, (void **)&addr) == FAILURE) { - php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C)); + php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name()); return NULL; } r = (request_rec *)Z_LVAL_PP(addr); if (!r) { - php_error(E_WARNING, "%s(): request_rec invalid", get_active_function_name(TSRMLS_C)); + php_error(E_WARNING, "%s(): request_rec invalid", get_active_function_name()); return NULL; } return r; } -/* {{{ php_apache_request_new(request_rec *r TSRMLS_DC) +/* {{{ php_apache_request_new(request_rec *r) * create a new zval-instance for ApacheRequest that wraps request_rec */ -zval *php_apache_request_new(request_rec *r TSRMLS_DC) +zval *php_apache_request_new(request_rec *r) { zval *req; zval *addr; @@ -210,7 +210,7 @@ static void apache_request_string_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) int new_value_len; char **target; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &new_value, &new_value_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &new_value, &new_value_len) == FAILURE) { return; } @@ -260,7 +260,7 @@ static void apache_request_int_slot(int offset, INTERNAL_FUNCTION_PARAMETERS) long old_value, new_value; long *target; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &new_value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &new_value) == FAILURE) { return; } @@ -504,7 +504,7 @@ PHP_FUNCTION(apache_request_content_length) long zlen; request_rec *r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &zlen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &zlen) == FAILURE) { return; } @@ -584,7 +584,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS) zend_bool replace = 0; HashPosition pos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zb", &first, &second, &replace) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|zb", &first, &second, &replace) == FAILURE) { RETURN_FALSE; } @@ -614,7 +614,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS) break; case HASH_KEY_IS_LONG: default: - php_error(E_WARNING, "%s(): Can only add STRING keys to headers!", get_active_function_name(TSRMLS_C)); + php_error(E_WARNING, "%s(): Can only add STRING keys to headers!", get_active_function_name()); break; } @@ -715,7 +715,7 @@ PHP_FUNCTION(apache_request_remote_host) request_rec *r; char *res; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &type) == FAILURE) { return; } @@ -743,7 +743,7 @@ PHP_FUNCTION(apache_request_update_mtime) request_rec *r; long mtime = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mtime) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mtime) == FAILURE) { return; } @@ -931,7 +931,7 @@ PHP_FUNCTION(apache_request_basic_auth_pw) const char *pw; long status; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zpw) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zpw) == FAILURE) { return; } @@ -963,7 +963,7 @@ PHP_FUNCTION(apache_request_send_http_header) char *type = NULL; int typelen; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &typelen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() , "|s", &type, &typelen) == FAILURE) { return; } @@ -1034,7 +1034,7 @@ PHP_FUNCTION(apache_request_send_error_response) request_rec *r; long rec = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &rec) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &rec) == FAILURE) { return; } @@ -1049,7 +1049,7 @@ PHP_FUNCTION(apache_request_set_content_length) zval *id; request_rec *r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) { return; } @@ -1092,7 +1092,7 @@ PHP_FUNCTION(apache_request_rputs) zval *id; request_rec *r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buffer, &buffer_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buffer, &buffer_len) == FAILURE) { return; } @@ -1136,7 +1136,7 @@ PHP_FUNCTION(apache_request_log_error) long facility = APLOG_ERR; request_rec *r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &z_errstr, &z_errstr_len, &facility) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &z_errstr, &z_errstr_len, &facility) == FAILURE) { return; } @@ -1158,7 +1158,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri) int file_len; request_rec *r, *sub_r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) { return; } @@ -1168,7 +1168,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri) if (!sub_r) { RETURN_FALSE; } - return_value = php_apache_request_new(sub_r TSRMLS_CC); + return_value = php_apache_request_new(sub_r); } /* }}} */ @@ -1183,7 +1183,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file) int file_len; request_rec *r, *sub_r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) { return; } @@ -1194,7 +1194,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file) if (!sub_r) { RETURN_FALSE; } - return_value = php_apache_request_new(sub_r TSRMLS_CC); + return_value = php_apache_request_new(sub_r); } /* }}} */ @@ -1209,7 +1209,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri) int file_len, method_len; request_rec *r, *sub_r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &method, &method_len, &file, &file_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &method, &method_len, &file, &file_len) == FAILURE) { return; } @@ -1220,7 +1220,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri) if (!sub_r) { RETURN_FALSE; } - return_value = php_apache_request_new(sub_r TSRMLS_CC); + return_value = php_apache_request_new(sub_r); } /* }}} */ @@ -1255,7 +1255,7 @@ PHP_FUNCTION(apache_request_internal_redirect) int new_uri_len; request_rec *r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &new_uri, &new_uri_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &new_uri, &new_uri_len) == FAILURE) { return; } @@ -1271,7 +1271,7 @@ PHP_FUNCTION(apache_request_send_header_field) zval *id; request_rec *r; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &fieldname, &fieldname_len, &fieldval, &fieldval_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &fieldname, &fieldname_len, &fieldval, &fieldval_len) == FAILURE) { return; } @@ -1394,14 +1394,14 @@ static PHP_MINIT_FUNCTION(apache) #ifdef ZTS ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL); #else - php_apache_globals_ctor(&php_apache_info TSRMLS_CC); + php_apache_globals_ctor(&php_apache_info); #endif REGISTER_INI_ENTRIES(); le_apachereq = zend_register_list_destructors_ex(php_apache_request_free, NULL, "ApacheRequest", module_number); INIT_OVERLOADED_CLASS_ENTRY(ce, "ApacheRequest", php_apache_request_class_functions, NULL, NULL, NULL); - apacherequest_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC); + apacherequest_class_entry = zend_register_internal_class_ex(&ce, NULL); REGISTER_LONG_CONSTANT("OK", OK, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DECLINED", DECLINED, CONST_CS | CONST_PERSISTENT); @@ -1551,7 +1551,7 @@ PHP_FUNCTION(apache_note) int arg_name_len, arg_val_len; char *note_val; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &arg_name, &arg_name_len, &arg_val, &arg_val_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &arg_name, &arg_name_len, &arg_val, &arg_val_len) == FAILURE) { return; } @@ -1714,7 +1714,7 @@ PHP_FUNCTION(virtual) int filename_len; request_rec *rr = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) { return; } @@ -1732,8 +1732,8 @@ PHP_FUNCTION(virtual) RETURN_FALSE; } - php_output_end_all(TSRMLS_C); - php_header(TSRMLS_C); + php_output_end_all(); + php_header(); if (run_sub_req(rr)) { php_error(E_WARNING, "Unable to include '%s' - request execution failed", filename); @@ -1811,7 +1811,7 @@ PHP_FUNCTION(apache_setenv) char *var = NULL, *val = NULL; request_rec *r = (request_rec *) SG(server_context); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) { RETURN_FALSE; } @@ -1835,7 +1835,7 @@ PHP_FUNCTION(apache_lookup_uri) int filename_len; request_rec *rr=NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) { return; } diff --git a/sapi/apache_hooks/php_apache_http.h b/sapi/apache_hooks/php_apache_http.h index e6610741c7..f79bd91c50 100644 --- a/sapi/apache_hooks/php_apache_http.h +++ b/sapi/apache_hooks/php_apache_http.h @@ -41,4 +41,4 @@ zval *php_apache_request_new(request_rec *r); -int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC); +int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret); diff --git a/sapi/apache_hooks/sapi_apache.c b/sapi/apache_hooks/sapi_apache.c index daaad4e39d..78e7c8cbd3 100644 --- a/sapi/apache_hooks/sapi_apache.c +++ b/sapi/apache_hooks/sapi_apache.c @@ -25,11 +25,11 @@ /* {{{ apache_php_module_main */ -int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) +int apache_php_module_main(request_rec *r, int display_source_mode) { zend_file_handle file_handle; - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { return FAILURE; } /* sending a file handle to another dll is not working @@ -39,7 +39,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); - if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC)){ + if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini)){ return OK; } else { return NOT_FOUND; @@ -50,7 +50,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) file_handle.filename = SG(request_info).path_translated; file_handle.opened_path = NULL; file_handle.free_filename = 0; - (void) php_execute_script(&file_handle TSRMLS_CC); + (void) php_execute_script(&file_handle); } AP(in_request) = 0; @@ -60,7 +60,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC) /* {{{ apache_php_module_hook */ -int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC) +int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret) { zend_file_handle file_handle; zval *req; @@ -70,24 +70,24 @@ int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRM signal(SIGCHLD, sigchld_handler); #endif if(AP(current_hook) == AP_RESPONSE) { - if (php_request_startup_for_hook(TSRMLS_C) == FAILURE) + if (php_request_startup_for_hook() == FAILURE) return FAILURE; } else { - if (php_request_startup_for_hook(TSRMLS_C) == FAILURE) + if (php_request_startup_for_hook() == FAILURE) return FAILURE; } req = php_apache_request_new(r); - php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); + php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER]); switch(handler->type) { case AP_HANDLER_TYPE_FILE: - php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); + php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER]); memset(&file_handle, 0, sizeof(file_handle)); file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = handler->name; - (void) php_execute_simple_script(&file_handle, ret TSRMLS_CC); + (void) php_execute_simple_script(&file_handle, ret); break; case AP_HANDLER_TYPE_METHOD: if( (tmp = strstr(handler->name, "::")) != NULL && *(tmp+2) != '\0' ) { @@ -99,7 +99,7 @@ int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRM ALLOC_ZVAL(method); ZVAL_STRING(method, tmp +2, 1); *tmp = ':'; - call_user_function_ex(EG(function_table), &class, method, ret, 0, NULL, 0, NULL TSRMLS_CC); + call_user_function_ex(EG(function_table), &class, method, ret, 0, NULL, 0, NULL); zval_dtor(class); zval_dtor(method); } diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c index b1ffddb460..850e761955 100644 --- a/sapi/caudium/caudium.c +++ b/sapi/caudium/caudium.c @@ -103,7 +103,7 @@ typedef struct void pike_module_init(void); void pike_module_exit(void); -static void free_struct(TSRMLS_D); +static void free_struct(void); void f_php_caudium_request_handler(INT32 args); /* Defines to get to the data supplied when the script is started. */ @@ -209,7 +209,7 @@ INLINE static int lookup_integer_header(char *headername, int default_value) */ INLINE static int -php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) { +php_caudium_low_ub_write(const char *str, uint str_length) { int sent_bytes = 0; struct pike_string *to_write = NULL; GET_THIS(); @@ -239,7 +239,7 @@ php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) { */ static int -php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) +php_caudium_sapi_ub_write(const char *str, uint str_length) { GET_THIS(); int sent_bytes = 0, fd = MY_FD; @@ -269,7 +269,7 @@ php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) } THIS->written += sent_bytes; } else { - THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length TSRMLS_CC), + THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length), "write"); } return sent_bytes; @@ -335,7 +335,7 @@ php_caudium_set_header(char *header_name, char *value, char *p) */ static int php_caudium_sapi_header_handler(sapi_header_struct *sapi_header, - sapi_headers_struct *sapi_headers TSRMLS_DC) + sapi_headers_struct *sapi_headers) { char *header_name, *header_content, *p; header_name = sapi_header->header; @@ -357,7 +357,7 @@ php_caudium_sapi_header_handler(sapi_header_struct *sapi_header, */ INLINE static int -php_caudium_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +php_caudium_low_send_headers(sapi_headers_struct *sapi_headers) { struct pike_string *ind; struct svalue *s_headermap; @@ -383,10 +383,10 @@ php_caudium_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) } static int -php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers) { int res = 0; - THREAD_SAFE_RUN(res = php_caudium_low_send_headers(sapi_headers TSRMLS_CC), "send headers"); + THREAD_SAFE_RUN(res = php_caudium_low_send_headers(sapi_headers), "send headers"); return res; } @@ -395,7 +395,7 @@ php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) * the client. Used for POST/PUT requests. */ -INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes TSRMLS_DC) +INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes) { uint total_read = 0; GET_THIS(); @@ -419,10 +419,10 @@ INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes TSRMLS_D } static int -php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) +php_caudium_sapi_read_post(char *buf, uint count_bytes) { uint total_read = 0; - THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes TSRMLS_CC), "read post"); + THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes), "read post"); return total_read; } @@ -432,7 +432,7 @@ php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) */ static char * -php_caudium_sapi_read_cookies(TSRMLS_D) +php_caudium_sapi_read_cookies(void) { char *cookies; cookies = lookup_string_header("HTTP_COOKIE", NULL); @@ -477,7 +477,7 @@ static zend_module_entry php_caudium_module = { }; -INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC) +INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array) { int i; struct keypair *k; @@ -487,16 +487,16 @@ INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TS struct svalue *val; GET_THIS(); php_register_variable("PHP_SELF", SG(request_info).request_uri, - track_vars_array TSRMLS_CC); + track_vars_array); php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", - track_vars_array TSRMLS_CC); + track_vars_array); php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, - track_vars_array TSRMLS_CC); + track_vars_array); php_register_variable("REQUEST_URI", SG(request_info).request_uri, - track_vars_array TSRMLS_CC); + track_vars_array); php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, - track_vars_array TSRMLS_CC); + track_vars_array); sind = make_shared_string("env"); headers = low_mapping_string_lookup(REQUEST_DATA, sind); @@ -508,15 +508,15 @@ INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TS if(ind && ind->type == PIKE_T_STRING && val && val->type == PIKE_T_STRING) { php_register_variable(ind->u.string->str, val->u.string->str, - track_vars_array TSRMLS_CC ); + track_vars_array ); } } } } -static void sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_caudium_register_variables(zval *track_vars_array) { - THREAD_SAFE_RUN(low_sapi_caudium_register_variables(track_vars_array TSRMLS_CC), "register_variables"); + THREAD_SAFE_RUN(low_sapi_caudium_register_variables(track_vars_array), "register_variables"); } @@ -568,8 +568,7 @@ static void php_caudium_module_main(php_caudium_request *ureq) struct thread_state *state; extern struct program *thread_id_prog; #endif - TSRMLS_FETCH(); - GET_THIS(); + GET_THIS(); THIS->filename = ureq->filename; THIS->done_cb = ureq->done_cb; THIS->my_fd_obj = ureq->my_fd_obj; @@ -626,7 +625,7 @@ static void php_caudium_module_main(php_caudium_request *ureq) } /* Let PHP7 handle the deconding of the AUTH */ - php_handle_auth_data(lookup_string_header("HTTP_AUTHORIZATION", NULL), TSRMLS_C); + php_handle_auth_data(lookup_string_header("HTTP_AUTHORIZATION", NULL), ); /* Swap out this thread and release the interpreter lock to allow * Pike threads to run. We wait since the above would otherwise require * a lot of unlock/lock. @@ -644,22 +643,22 @@ static void php_caudium_module_main(php_caudium_request *ureq) file_handle.free_filename = 0; THIS->written = 0; - res = php_request_startup(TSRMLS_C); + res = php_request_startup(); if(res == FAILURE) { THREAD_SAFE_RUN({ apply_svalue(&THIS->done_cb, 0); pop_stack(); - free_struct(TSRMLS_C); + free_struct(); }, "Negative run response"); } else { - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); php_request_shutdown(NULL); THREAD_SAFE_RUN({ push_int(THIS->written); apply_svalue(&THIS->done_cb, 1); pop_stack(); - free_struct(TSRMLS_C); + free_struct(); }, "positive run response"); } @@ -737,7 +736,7 @@ void f_php_caudium_request_handler(INT32 args) pop_n_elems(args); } -static void free_struct(TSRMLS_D) +static void free_struct(void) { GET_THIS(); if(THIS->request_data) free_mapping(THIS->request_data); diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 94f35a6c83..283090d977 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -97,7 +97,7 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS; struct sigaction act, old_term, old_quit, old_int; #endif -static void (*php_php_import_environment_variables)(zval *array_ptr TSRMLS_DC); +static void (*php_php_import_environment_variables)(zval *array_ptr); #ifndef PHP_WIN32 /* these globals used for forking children on unix systems */ @@ -220,14 +220,14 @@ static php_cgi_globals_struct php_cgi_globals; #define TRANSLATE_SLASHES(path) #endif -static int print_module_info(zval *element TSRMLS_DC) +static int print_module_info(zval *element) { zend_module_entry *module = Z_PTR_P(element); php_printf("%s\n", module->name); return ZEND_HASH_APPLY_KEEP; } -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) +static int module_name_cmp(const void *a, const void *b) { Bucket *f = (Bucket *) a; Bucket *s = (Bucket *) b; @@ -236,37 +236,37 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC) ((zend_module_entry *)Z_PTR(s->val))->name); } -static void print_modules(TSRMLS_D) +static void print_modules(void) { HashTable sorted_registry; zend_hash_init(&sorted_registry, 64, NULL, NULL, 1); zend_hash_copy(&sorted_registry, &module_registry, NULL); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply(&sorted_registry, print_module_info TSRMLS_CC); + zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0); + zend_hash_apply(&sorted_registry, print_module_info); zend_hash_destroy(&sorted_registry); } -static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) +static int print_extension_info(zend_extension *ext, void *arg) { php_printf("%s\n", ext->name); return 0; } -static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC) +static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s) { return strcmp( ((zend_extension *)(*f)->data)->name, ((zend_extension *)(*s)->data)->name); } -static void print_extensions(TSRMLS_D) +static void print_extensions(void) { zend_llist sorted_exts; zend_llist_copy(&sorted_exts, &zend_extensions); sorted_exts.dtor = NULL; - zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC); + zend_llist_sort(&sorted_exts, extension_name_cmp); + zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL); zend_llist_destroy(&sorted_exts); } @@ -274,7 +274,7 @@ static void print_extensions(TSRMLS_D) #define STDOUT_FILENO 1 #endif -static inline size_t sapi_cgi_single_write(const char *str, size_t str_length TSRMLS_DC) +static inline size_t sapi_cgi_single_write(const char *str, size_t str_length) { #ifdef PHP_WRITE_STDOUT int ret; @@ -290,14 +290,14 @@ static inline size_t sapi_cgi_single_write(const char *str, size_t str_length TS #endif } -static size_t sapi_cgi_ub_write(const char *str, size_t str_length TSRMLS_DC) +static size_t sapi_cgi_ub_write(const char *str, size_t str_length) { const char *ptr = str; size_t remaining = str_length; size_t ret; while (remaining > 0) { - ret = sapi_cgi_single_write(ptr, remaining TSRMLS_CC); + ret = sapi_cgi_single_write(ptr, remaining); if (!ret) { php_handle_aborted_connection(); return str_length - remaining; @@ -309,7 +309,7 @@ static size_t sapi_cgi_ub_write(const char *str, size_t str_length TSRMLS_DC) return str_length; } -static size_t sapi_fcgi_ub_write(const char *str, size_t str_length TSRMLS_DC) +static size_t sapi_fcgi_ub_write(const char *str, size_t str_length) { const char *ptr = str; size_t remaining = str_length; @@ -330,14 +330,14 @@ static size_t sapi_fcgi_ub_write(const char *str, size_t str_length TSRMLS_DC) return str_length; } -static void sapi_cgi_flush(void *server_context TSRMLS_DC) +static void sapi_cgi_flush(void *server_context) { if (fflush(stdout) == EOF) { php_handle_aborted_connection(); } } -static void sapi_fcgi_flush(void *server_context TSRMLS_DC) +static void sapi_fcgi_flush(void *server_context) { fcgi_request *request = (fcgi_request*) server_context; @@ -403,7 +403,7 @@ static const http_error http_error_codes[] = { {0, NULL} }; -static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers) { char buf[SAPI_CGI_MAX_HEADER_LENGTH]; sapi_header_struct *h; @@ -509,7 +509,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) # define STDIN_FILENO 0 #endif -static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) +static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes) { size_t read_bytes = 0; int tmp_read_bytes; @@ -537,7 +537,7 @@ static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) return read_bytes; } -static size_t sapi_fcgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) +static size_t sapi_fcgi_read_post(char *buffer, size_t count_bytes) { size_t read_bytes = 0; int tmp_read_bytes; @@ -560,12 +560,12 @@ static size_t sapi_fcgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) return read_bytes; } -static char *sapi_cgi_getenv(char *name, size_t name_len TSRMLS_DC) +static char *sapi_cgi_getenv(char *name, size_t name_len) { return getenv(name); } -static char *sapi_fcgi_getenv(char *name, size_t name_len TSRMLS_DC) +static char *sapi_fcgi_getenv(char *name, size_t name_len) { /* when php is started by mod_fastcgi, no regular environment * is provided to PHP. It is always sent to PHP at the start @@ -625,30 +625,30 @@ static char *_sapi_cgi_putenv(char *name, size_t name_len, char *value) return getenv(name); } -static char *sapi_cgi_read_cookies(TSRMLS_D) +static char *sapi_cgi_read_cookies(void) { return getenv("HTTP_COOKIE"); } -static char *sapi_fcgi_read_cookies(TSRMLS_D) +static char *sapi_fcgi_read_cookies(void) { fcgi_request *request = (fcgi_request*) SG(server_context); return FCGI_GETENV(request, "HTTP_COOKIE"); } -static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC) +static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg) { zval *array_ptr = (zval*)arg; int filter_arg = (Z_ARR_P(array_ptr) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV]))?PARSE_ENV:PARSE_SERVER; size_t new_val_len; - if (sapi_module.input_filter(filter_arg, var, &val, strlen(val), &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); + if (sapi_module.input_filter(filter_arg, var, &val, strlen(val), &new_val_len)) { + php_register_variable_safe(var, val, new_val_len, array_ptr); } } -static void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) +static void cgi_php_import_environment_variables(zval *array_ptr) { if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) && @@ -667,15 +667,15 @@ static void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) } /* call php's original import as a catch-all */ - php_php_import_environment_variables(array_ptr TSRMLS_CC); + php_php_import_environment_variables(array_ptr); if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); - fcgi_loadenv(request, cgi_php_load_env_var, array_ptr TSRMLS_CC); + fcgi_loadenv(request, cgi_php_load_env_var, array_ptr); } } -static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_cgi_register_variables(zval *track_vars_array) { size_t php_self_len; char *php_self; @@ -683,7 +683,7 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) /* In CGI mode, we consider the environment to be a part of the server * variables */ - php_import_environment_variables(track_vars_array TSRMLS_CC); + php_import_environment_variables(track_vars_array); if (CGIG(fix_pathinfo)) { char *script_name = SG(request_info).request_uri; @@ -726,8 +726,8 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) } /* Build the special-case PHP_SELF variable for the CGI version */ - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len)) { + php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array); } if (free_php_self) { free_alloca(php_self, use_heap); @@ -735,13 +735,13 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) } else { php_self = SG(request_info).request_uri ? SG(request_info).request_uri : ""; php_self_len = strlen(php_self); - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len)) { + php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array); } } } -static void sapi_cgi_log_message(char *message TSRMLS_DC) +static void sapi_cgi_log_message(char *message) { if (fcgi_is_fastcgi() && CGIG(fcgi_logging)) { fcgi_request *request; @@ -766,11 +766,11 @@ static void sapi_cgi_log_message(char *message TSRMLS_DC) /* {{{ php_cgi_ini_activate_user_config */ -static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const char *doc_root, size_t doc_root_len, int start TSRMLS_DC) +static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const char *doc_root, size_t doc_root_len, int start) { char *ptr; user_config_cache_entry *new_entry, *entry; - time_t request_time = (time_t)sapi_get_request_time(TSRMLS_C); + time_t request_time = (time_t)sapi_get_request_time(); /* Find cached config entry: If not found, create one */ if ((entry = zend_hash_str_find_ptr(&CGIG(user_config_cache), path, path_len)) == NULL) { @@ -792,7 +792,7 @@ static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const zend_hash_clean(entry->user_config); if (!IS_ABSOLUTE_PATH(path, path_len)) { - real_path = tsrm_realpath(path, NULL TSRMLS_CC); + real_path = tsrm_realpath(path, NULL); if (real_path == NULL) { return; } @@ -823,12 +823,12 @@ static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const ptr = s2 + start; /* start is the point where doc_root ends! */ while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) { *ptr = 0; - php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC); + php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config); *ptr = '/'; ptr++; } } else { - php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC); + php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config); } if (real_path) { @@ -838,11 +838,11 @@ static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const } /* Activate ini entries with values from the user config hash */ - php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS TSRMLS_CC); + php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS); } /* }}} */ -static int sapi_cgi_activate(TSRMLS_D) +static int sapi_cgi_activate(void) { char *path, *doc_root, *server_name; size_t path_len, doc_root_len, server_name_len; @@ -866,7 +866,7 @@ static int sapi_cgi_activate(TSRMLS_D) server_name_len = strlen(server_name); server_name = estrndup(server_name, server_name_len); zend_str_tolower(server_name, server_name_len); - php_ini_activate_per_host_config(server_name, server_name_len TSRMLS_CC); + php_ini_activate_per_host_config(server_name, server_name_len); efree(server_name); } } @@ -890,7 +890,7 @@ static int sapi_cgi_activate(TSRMLS_D) path[path_len] = 0; /* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */ - php_ini_activate_per_dir_config(path, path_len TSRMLS_CC); /* Note: for global settings sake we check from root to path */ + php_ini_activate_per_dir_config(path, path_len); /* Note: for global settings sake we check from root to path */ /* Load and activate user ini files in path starting from DOCUMENT_ROOT */ if (PG(user_ini_filename) && *PG(user_ini_filename)) { @@ -912,7 +912,7 @@ static int sapi_cgi_activate(TSRMLS_D) doc_root = estrndup(doc_root, doc_root_len); zend_str_tolower(doc_root, doc_root_len); #endif - php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, (doc_root_len > 0 && (doc_root_len - 1)) TSRMLS_CC); + php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, (doc_root_len > 0 && (doc_root_len - 1))); #ifdef PHP_WIN32 efree(doc_root); @@ -926,7 +926,7 @@ static int sapi_cgi_activate(TSRMLS_D) return SUCCESS; } -static int sapi_cgi_deactivate(TSRMLS_D) +static int sapi_cgi_deactivate(void) { /* flush only when SAPI was started. The reasons are: 1. SAPI Deactivate is called from two places: module init and request shutdown @@ -942,7 +942,7 @@ static int sapi_cgi_deactivate(TSRMLS_D) php_handle_aborted_connection(); } } else { - sapi_cgi_flush(SG(server_context) TSRMLS_CC); + sapi_cgi_flush(SG(server_context)); } } return SUCCESS; @@ -1149,7 +1149,7 @@ static int is_valid_path(const char *path) Comments in the code below refer to using the above URL in a request */ -static void init_request_info(fcgi_request *request TSRMLS_DC) +static void init_request_info(fcgi_request *request) { char *env_script_filename = CGI_GETENV("SCRIPT_FILENAME"); char *env_path_translated = CGI_GETENV("PATH_TRANSLATED"); @@ -1249,7 +1249,7 @@ static void init_request_info(fcgi_request *request TSRMLS_DC) #ifdef PHP_WIN32 script_path_translated[script_path_translated_len-1] == '\\' || #endif - (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL) + (real_path = tsrm_realpath(script_path_translated, NULL)) == NULL) ) { char *pt = estrndup(script_path_translated, script_path_translated_len); size_t len = script_path_translated_len; @@ -1439,7 +1439,7 @@ static void init_request_info(fcgi_request *request TSRMLS_DC) /* The CGI RFC allows servers to pass on unvalidated Authorization data */ auth = CGI_GETENV("HTTP_AUTHORIZATION"); - php_handle_auth_data(auth TSRMLS_CC); + php_handle_auth_data(auth); } } /* }}} */ @@ -1483,7 +1483,7 @@ PHP_INI_END() /* {{{ php_cgi_globals_ctor */ -static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_DC) +static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals) { #ifdef ZTS ZEND_TSRMLS_CACHE_UPDATE; @@ -1510,7 +1510,7 @@ static PHP_MINIT_FUNCTION(cgi) #ifdef ZTS ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL); #else - php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC); + php_cgi_globals_ctor(&php_cgi_globals); #endif REGISTER_INI_ENTRIES(); return SUCCESS; @@ -1547,7 +1547,7 @@ PHP_FUNCTION(apache_child_terminate) /* {{{ */ } /* }}} */ -static void add_request_header(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC) /* {{{ */ +static void add_request_header(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg) /* {{{ */ { zval *return_value = (zval*)arg; char *str = NULL; @@ -1604,7 +1604,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */ if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); - fcgi_loadenv(request, add_request_header, return_value TSRMLS_CC); + fcgi_loadenv(request, add_request_header, return_value); } else { char buf[128]; char **env, *p, *q, *var, *val, *t = buf; @@ -1678,7 +1678,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */ } /* }}} */ -static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */ +static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{{ */ { char *s, *p; size_t len = 0; @@ -1718,7 +1718,7 @@ PHP_FUNCTION(apache_response_headers) /* {{{ */ RETURN_FALSE; } array_init(return_value); - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value TSRMLS_CC); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value); } /* }}} */ @@ -2145,7 +2145,7 @@ consult the installation file that came with this distribution, or visit \n\ no_headers = 1; SG(headers_sent) = 1; php_cgi_usage(argv[0]); - php_output_end_all(TSRMLS_C); + php_output_end_all(); exit_status = 0; goto out; } @@ -2164,7 +2164,7 @@ consult the installation file that came with this distribution, or visit \n\ #endif while (!fastcgi || fcgi_accept_request(request) >= 0) { SG(server_context) = fastcgi ? (void *) request : (void *) 1; - init_request_info(request TSRMLS_CC); + init_request_info(request); if (!cgi && !fastcgi) { while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) { @@ -2194,16 +2194,16 @@ consult the installation file that came with this distribution, or visit \n\ if (script_file) { efree(script_file); } - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); return FAILURE; } if (no_headers) { SG(headers_sent) = 1; SG(request_info).no_headers = 1; } - php_print_info(0xFFFFFFFF TSRMLS_CC); + php_print_info(0xFFFFFFFF); php_request_shutdown((void *) 0); fcgi_shutdown(); exit_status = 0; @@ -2220,11 +2220,11 @@ consult the installation file that came with this distribution, or visit \n\ } SG(headers_sent) = 1; php_printf("[PHP Modules]\n"); - print_modules(TSRMLS_C); + print_modules(); php_printf("\n[Zend Modules]\n"); - print_extensions(TSRMLS_C); + print_extensions(); php_printf("\n"); - php_output_end_all(TSRMLS_C); + php_output_end_all(); fcgi_shutdown(); exit_status = 0; goto out; @@ -2244,9 +2244,9 @@ consult the installation file that came with this distribution, or visit \n\ efree(script_file); } no_headers = 1; - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); return FAILURE; } if (no_headers) { @@ -2268,7 +2268,7 @@ consult the installation file that came with this distribution, or visit \n\ break; case 'z': /* load extension file */ - zend_load_extension(php_optarg TSRMLS_CC); + zend_load_extension(php_optarg); break; default: @@ -2353,12 +2353,12 @@ consult the installation file that came with this distribution, or visit \n\ /* request startup only after we've done all we can to * get path_translated */ - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { if (fastcgi) { fcgi_finish_request(request, 1); } SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); return FAILURE; } if (no_headers) { @@ -2372,7 +2372,7 @@ consult the installation file that came with this distribution, or visit \n\ 2. we are running as cgi or fastcgi */ if (cgi || fastcgi || SG(request_info).path_translated) { - if (php_fopen_primary_script(&file_handle TSRMLS_CC) == FAILURE) { + if (php_fopen_primary_script(&file_handle) == FAILURE) { zend_try { if (errno == EACCES) { SG(sapi_headers).http_response_code = 403; @@ -2399,7 +2399,7 @@ consult the installation file that came with this distribution, or visit \n\ php_request_shutdown((void *) 0); SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); sapi_shutdown(); #ifdef ZTS tsrm_shutdown(); @@ -2482,11 +2482,11 @@ consult the installation file that came with this distribution, or visit \n\ switch (behavior) { case PHP_MODE_STANDARD: - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); break; case PHP_MODE_LINT: PG(during_request_startup) = 0; - exit_status = php_lint_script(&file_handle TSRMLS_CC); + exit_status = php_lint_script(&file_handle); if (exit_status == SUCCESS) { zend_printf("No syntax errors detected in %s\n", file_handle.filename); } else { @@ -2494,9 +2494,9 @@ consult the installation file that came with this distribution, or visit \n\ } break; case PHP_MODE_STRIP: - if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) { - zend_strip(TSRMLS_C); - zend_file_handle_dtor(&file_handle TSRMLS_CC); + if (open_file_for_scanning(&file_handle) == SUCCESS) { + zend_strip(); + zend_file_handle_dtor(&file_handle); php_output_teardown(); } return SUCCESS; @@ -2505,13 +2505,13 @@ consult the installation file that came with this distribution, or visit \n\ { zend_syntax_highlighter_ini syntax_highlighter_ini; - if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) { + if (open_file_for_scanning(&file_handle) == SUCCESS) { php_get_highlight_struct(&syntax_highlighter_ini); - zend_highlight(&syntax_highlighter_ini TSRMLS_CC); + zend_highlight(&syntax_highlighter_ini); if (fastcgi) { goto fastcgi_request_done; } - zend_file_handle_dtor(&file_handle TSRMLS_CC); + zend_file_handle_dtor(&file_handle); php_output_teardown(); } return SUCCESS; @@ -2520,9 +2520,9 @@ consult the installation file that came with this distribution, or visit \n\ #if 0 /* Zeev might want to do something with this one day */ case PHP_MODE_INDENT: - open_file_for_scanning(&file_handle TSRMLS_CC); - zend_indent(TSRMLS_C); - zend_file_handle_dtor(&file_handle TSRMLS_CC); + open_file_for_scanning(&file_handle); + zend_indent(); + zend_file_handle_dtor(&file_handle); php_output_teardown(); return SUCCESS; break; @@ -2627,7 +2627,7 @@ parent_out: #endif SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); sapi_shutdown(); #ifdef ZTS diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c index 7925f87562..1f5ee50d03 100644 --- a/sapi/cgi/fastcgi.c +++ b/sapi/cgi/fastcgi.c @@ -323,13 +323,13 @@ static char *fcgi_hash_get(fcgi_hash *h, unsigned int hash_value, char *var, uns return NULL; } -static void fcgi_hash_apply(fcgi_hash *h, fcgi_apply_func func, void *arg TSRMLS_DC) +static void fcgi_hash_apply(fcgi_hash *h, fcgi_apply_func func, void *arg) { fcgi_hash_bucket *p = h->list; while (p) { if (EXPECTED(p->val != NULL)) { - func(p->var, p->var_len, p->val, p->val_len, arg TSRMLS_CC); + func(p->var, p->var_len, p->val, p->val_len, arg); } p = p->list_next; } @@ -1496,9 +1496,9 @@ char* fcgi_quick_putenv(fcgi_request *req, char* var, int var_len, unsigned int } } -void fcgi_loadenv(fcgi_request *req, fcgi_apply_func func, zval *array TSRMLS_DC) +void fcgi_loadenv(fcgi_request *req, fcgi_apply_func func, zval *array) { - fcgi_hash_apply(&req->env, func, array TSRMLS_CC); + fcgi_hash_apply(&req->env, func, array); } #ifdef _WIN32 diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h index 4a30a207b1..5c43d336cc 100644 --- a/sapi/cgi/fastcgi.h +++ b/sapi/cgi/fastcgi.h @@ -108,7 +108,7 @@ typedef struct _fcgi_end_request_rec { /* FastCGI client API */ -typedef void (*fcgi_apply_func)(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC); +typedef void (*fcgi_apply_func)(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg); typedef struct _fcgi_request fcgi_request; @@ -127,7 +127,7 @@ char* fcgi_getenv(fcgi_request *req, const char* var, int var_len); char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val); char* fcgi_quick_getenv(fcgi_request *req, const char* var, int var_len, unsigned int hash_value); char* fcgi_quick_putenv(fcgi_request *req, char* var, int var_len, unsigned int hash_value, char* val); -void fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array TSRMLS_DC); +void fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array); int fcgi_read(fcgi_request *req, char *str, int len); diff --git a/sapi/cli/cli.h b/sapi/cli/cli.h index e49a203821..30dc4fdfa0 100644 --- a/sapi/cli/cli.h +++ b/sapi/cli/cli.h @@ -30,12 +30,12 @@ #endif -extern PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRMLS_DC); +extern PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length); typedef struct { - size_t (*cli_shell_write)(const char *str, size_t str_length TSRMLS_DC); - size_t (*cli_shell_ub_write)(const char *str, size_t str_length TSRMLS_DC); - int (*cli_shell_run)(TSRMLS_D); + size_t (*cli_shell_write)(const char *str, size_t str_length); + size_t (*cli_shell_ub_write)(const char *str, size_t str_length); + int (*cli_shell_run)(void); } cli_shell_callbacks_t; extern PHP_CLI_API cli_shell_callbacks_t *php_cli_get_shell_callbacks(); diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 723decf065..fb6a898430 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -177,7 +177,7 @@ const opt_struct OPTIONS[] = { {'-', 0, NULL} /* end of args */ }; -static int print_module_info(zval *element TSRMLS_DC) /* {{{ */ +static int print_module_info(zval *element) /* {{{ */ { zend_module_entry *module = (zend_module_entry*)Z_PTR_P(element); php_printf("%s\n", module->name); @@ -185,7 +185,7 @@ static int print_module_info(zval *element TSRMLS_DC) /* {{{ */ } /* }}} */ -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) /* {{{ */ +static int module_name_cmp(const void *a, const void *b) /* {{{ */ { Bucket *f = (Bucket *) a; Bucket *s = (Bucket *) b; @@ -195,40 +195,40 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC) /* {{{ */ } /* }}} */ -static void print_modules(TSRMLS_D) /* {{{ */ +static void print_modules(void) /* {{{ */ { HashTable sorted_registry; zend_hash_init(&sorted_registry, 50, NULL, NULL, 0); zend_hash_copy(&sorted_registry, &module_registry, NULL); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply(&sorted_registry, print_module_info TSRMLS_CC); + zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0); + zend_hash_apply(&sorted_registry, print_module_info); zend_hash_destroy(&sorted_registry); } /* }}} */ -static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) /* {{{ */ +static int print_extension_info(zend_extension *ext, void *arg) /* {{{ */ { php_printf("%s\n", ext->name); return ZEND_HASH_APPLY_KEEP; } /* }}} */ -static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC) /* {{{ */ +static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s) /* {{{ */ { return strcmp(((zend_extension *)(*f)->data)->name, ((zend_extension *)(*s)->data)->name); } /* }}} */ -static void print_extensions(TSRMLS_D) /* {{{ */ +static void print_extensions(void) /* {{{ */ { zend_llist sorted_exts; zend_llist_copy(&sorted_exts, &zend_extensions); sorted_exts.dtor = NULL; - zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply(&sorted_exts, (llist_apply_func_t) print_extension_info TSRMLS_CC); + zend_llist_sort(&sorted_exts, extension_name_cmp); + zend_llist_apply(&sorted_exts, (llist_apply_func_t) print_extension_info); zend_llist_destroy(&sorted_exts); } /* }}} */ @@ -237,7 +237,7 @@ static void print_extensions(TSRMLS_D) /* {{{ */ #define STDOUT_FILENO 1 #endif -static inline int sapi_cli_select(int fd TSRMLS_DC) +static inline int sapi_cli_select(int fd) { fd_set wfd, dfd; struct timeval tv; @@ -256,7 +256,7 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length) /* {{{ */ { #ifdef PHP_WRITE_STDOUT zend_long ret; @@ -266,7 +266,7 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRM if (cli_shell_callbacks.cli_shell_write) { size_t shell_wrote; - shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); + shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length); if (shell_wrote > -1) { return shell_wrote; } @@ -275,7 +275,7 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRM #ifdef PHP_WRITE_STDOUT do { ret = write(STDOUT_FILENO, str, str_length); - } while (ret <= 0 && errno == EAGAIN && sapi_cli_select(STDOUT_FILENO TSRMLS_CC)); + } while (ret <= 0 && errno == EAGAIN && sapi_cli_select(STDOUT_FILENO)); if (ret <= 0) { return 0; @@ -289,7 +289,7 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRM } /* }}} */ -static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */ +static size_t sapi_cli_ub_write(const char *str, size_t str_length) /* {{{ */ { const char *ptr = str; size_t remaining = str_length; @@ -301,7 +301,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /* if (cli_shell_callbacks.cli_shell_ub_write) { size_t ub_wrote; - ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); + ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length); if (ub_wrote > -1) { return ub_wrote; } @@ -309,7 +309,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /* while (remaining > 0) { - ret = sapi_cli_single_write(ptr, remaining TSRMLS_CC); + ret = sapi_cli_single_write(ptr, remaining); if (!ret) { #ifndef PHP_CLI_WIN32_NO_CONSOLE php_handle_aborted_connection(); @@ -324,7 +324,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /* } /* }}} */ -static void sapi_cli_flush(void *server_context TSRMLS_DC) /* {{{ */ +static void sapi_cli_flush(void *server_context) /* {{{ */ { /* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams * are/could be closed before fflush() is called. @@ -340,7 +340,7 @@ static void sapi_cli_flush(void *server_context TSRMLS_DC) /* {{{ */ static char *php_self = ""; static char *script_filename = ""; -static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ +static void sapi_cli_register_variables(zval *track_vars_array) /* {{{ */ { size_t len; char *docroot = ""; @@ -348,39 +348,39 @@ static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ /* In CGI mode, we consider the environment to be a part of the server * variables */ - php_import_environment_variables(track_vars_array TSRMLS_CC); + php_import_environment_variables(track_vars_array); /* Build the special-case PHP_SELF variable for the CLI version */ len = strlen(php_self); - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, len, &len TSRMLS_CC)) { - php_register_variable("PHP_SELF", php_self, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, len, &len)) { + php_register_variable("PHP_SELF", php_self, track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &php_self, len, &len TSRMLS_CC)) { - php_register_variable("SCRIPT_NAME", php_self, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &php_self, len, &len)) { + php_register_variable("SCRIPT_NAME", php_self, track_vars_array); } /* filenames are empty for stdin */ len = strlen(script_filename); - if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &script_filename, len, &len TSRMLS_CC)) { - php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &script_filename, len, &len)) { + php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &script_filename, len, &len TSRMLS_CC)) { - php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &script_filename, len, &len)) { + php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array); } /* just make it available */ len = 0U; - if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len TSRMLS_CC)) { - php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len)) { + php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array); } } /* }}} */ -static void sapi_cli_log_message(char *message TSRMLS_DC) /* {{{ */ +static void sapi_cli_log_message(char *message) /* {{{ */ { fprintf(stderr, "%s\n", message); } /* }}} */ -static int sapi_cli_deactivate(TSRMLS_D) /* {{{ */ +static int sapi_cli_deactivate(void) /* {{{ */ { fflush(stdout); if(SG(request_info).argv0) { @@ -391,19 +391,19 @@ static int sapi_cli_deactivate(TSRMLS_D) /* {{{ */ } /* }}} */ -static char* sapi_cli_read_cookies(TSRMLS_D) /* {{{ */ +static char* sapi_cli_read_cookies(void) /* {{{ */ { return NULL; } /* }}} */ -static int sapi_cli_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s TSRMLS_DC) /* {{{ */ +static int sapi_cli_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s) /* {{{ */ { return 0; } /* }}} */ -static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */ +static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers) /* {{{ */ { /* We do nothing here, this function is needed to prevent that the fallback * header handling is called. */ @@ -411,7 +411,7 @@ static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* } /* }}} */ -static void sapi_cli_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) /* {{{ */ +static void sapi_cli_send_header(sapi_header_struct *sapi_header, void *server_context) /* {{{ */ { } /* }}} */ @@ -553,7 +553,7 @@ static void php_cli_usage(char *argv0) static php_stream *s_in_process = NULL; -static void cli_register_file_handles(TSRMLS_D) /* {{{ */ +static void cli_register_file_handles(void) /* {{{ */ { zval zin, zout, zerr; php_stream *s_in, *s_out, *s_err; @@ -587,19 +587,19 @@ static void cli_register_file_handles(TSRMLS_D) /* {{{ */ ic.flags = CONST_CS; ic.name = zend_string_init("STDIN", sizeof("STDIN")-1, 1); ic.module_number = 0; - zend_register_constant(&ic TSRMLS_CC); + zend_register_constant(&ic); ZVAL_COPY_VALUE(&oc.value, &zout); oc.flags = CONST_CS; oc.name = zend_string_init("STDOUT", sizeof("STDOUT")-1, 1); oc.module_number = 0; - zend_register_constant(&oc TSRMLS_CC); + zend_register_constant(&oc); ZVAL_COPY_VALUE(&ec.value, &zerr); ec.flags = CONST_CS; ec.name = zend_string_init("STDERR", sizeof("STDERR")-1, 1); ec.module_number = 0; - zend_register_constant(&ec TSRMLS_CC); + zend_register_constant(&ec); } /* }}} */ @@ -607,7 +607,7 @@ static const char *param_mode_conflict = "Either execute direct code, process st /* {{{ cli_seek_file_begin */ -static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno TSRMLS_DC) +static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno) { int c; @@ -644,7 +644,7 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, } /* }}} */ -static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ +static int do_cli(int argc, char **argv) /* {{{ */ { int c; zend_file_handle file_handle; @@ -671,12 +671,12 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ switch (c) { case 'i': /* php info & quit */ - if (php_request_startup(TSRMLS_C)==FAILURE) { + if (php_request_startup()==FAILURE) { goto err; } request_started = 1; - php_print_info(0xFFFFFFFF TSRMLS_CC); - php_output_end_all(TSRMLS_C); + php_print_info(0xFFFFFFFF); + php_output_end_all(); exit_status = (c == '?' && argc > 1 && !strchr(argv[1], c)); goto out; @@ -694,20 +694,20 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ #endif get_zend_version() ); - sapi_deactivate(TSRMLS_C); + sapi_deactivate(); goto out; case 'm': /* list compiled in modules */ - if (php_request_startup(TSRMLS_C)==FAILURE) { + if (php_request_startup()==FAILURE) { goto err; } request_started = 1; php_printf("[PHP Modules]\n"); - print_modules(TSRMLS_C); + print_modules(); php_printf("\n[Zend Modules]\n"); - print_extensions(TSRMLS_C); + print_extensions(); php_printf("\n"); - php_output_end_all(TSRMLS_C); + php_output_end_all(); exit_status=0; goto out; @@ -858,7 +858,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ break; case 'z': /* load extension file */ - zend_load_extension(php_optarg TSRMLS_CC); + zend_load_extension(php_optarg); break; case 'H': hide_argv = 1; @@ -917,7 +917,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ php_optind++; } if (script_file) { - if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { + if (cli_seek_file_begin(&file_handle, script_file, &lineno) != SUCCESS) { goto err; } else { char real_path[MAXPATHLEN]; @@ -948,7 +948,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ argv[php_optind-1] = (char*)file_handle.filename; SG(request_info).argv=argv+php_optind-1; - if (php_request_startup(TSRMLS_C)==FAILURE) { + if (php_request_startup()==FAILURE) { *arg_excp = arg_free; fclose(file_handle.handle.fp); PUTS("Could not startup.\n"); @@ -966,25 +966,25 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } key = zend_string_init("_SERVER", sizeof("_SERVER")-1, 0); - zend_is_auto_global(key TSRMLS_CC); + zend_is_auto_global(key); zend_string_release(key); PG(during_request_startup) = 0; switch (behavior) { case PHP_MODE_STANDARD: if (strcmp(file_handle.filename, "-")) { - cli_register_file_handles(TSRMLS_C); + cli_register_file_handles(); } if (interactive && cli_shell_callbacks.cli_shell_run) { - exit_status = cli_shell_callbacks.cli_shell_run(TSRMLS_C); + exit_status = cli_shell_callbacks.cli_shell_run(); } else { - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); exit_status = EG(exit_status); } break; case PHP_MODE_LINT: - exit_status = php_lint_script(&file_handle TSRMLS_CC); + exit_status = php_lint_script(&file_handle); if (exit_status==SUCCESS) { zend_printf("No syntax errors detected in %s\n", file_handle.filename); } else { @@ -992,8 +992,8 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } break; case PHP_MODE_STRIP: - if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { - zend_strip(TSRMLS_C); + if (open_file_for_scanning(&file_handle)==SUCCESS) { + zend_strip(); } goto out; break; @@ -1001,9 +1001,9 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ { zend_syntax_highlighter_ini syntax_highlighter_ini; - if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { + if (open_file_for_scanning(&file_handle)==SUCCESS) { php_get_highlight_struct(&syntax_highlighter_ini); - zend_highlight(&syntax_highlighter_ini TSRMLS_CC); + zend_highlight(&syntax_highlighter_ini); } goto out; } @@ -1011,15 +1011,15 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ #if 0 /* Zeev might want to do something with this one day */ case PHP_MODE_INDENT: - open_file_for_scanning(&file_handle TSRMLS_CC); - zend_indent(TSRMLS_C); - zend_file_handle_dtor(file_handle.handle TSRMLS_CC); + open_file_for_scanning(&file_handle); + zend_indent(); + zend_file_handle_dtor(file_handle.handle); goto out; break; #endif case PHP_MODE_CLI_DIRECT: - cli_register_file_handles(TSRMLS_C); - if (zend_eval_string_ex(exec_direct, NULL, "Command line code", 1 TSRMLS_CC) == FAILURE) { + cli_register_file_handles(); + if (zend_eval_string_ex(exec_direct, NULL, "Command line code", 1) == FAILURE) { exit_status=254; } break; @@ -1030,9 +1030,9 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ size_t len, index = 0; zval argn, argi; - cli_register_file_handles(TSRMLS_C); + cli_register_file_handles(); - if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) { + if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1) == FAILURE) { exit_status=254; } ZVAL_LONG(&argi, index); @@ -1046,23 +1046,23 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ zend_hash_str_update(&EG(symbol_table).ht, "argn", sizeof("argn")-1, &argn); Z_LVAL(argi) = ++index; if (exec_run) { - if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { + if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1) == FAILURE) { exit_status=254; } } else { if (script_file) { - if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { + if (cli_seek_file_begin(&file_handle, script_file, &lineno) != SUCCESS) { exit_status = 1; } else { CG(start_lineno) = lineno; - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); exit_status = EG(exit_status); } } } efree(input); } - if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1 TSRMLS_CC) == FAILURE) { + if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1) == FAILURE) { exit_status=254; } @@ -1110,7 +1110,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ zval tmp, *msg; ZVAL_OBJ(&tmp, EG(exception)); - msg = zend_read_property(zend_exception_get_default(TSRMLS_C), &tmp, "message", sizeof("message")-1, 0 TSRMLS_CC); + msg = zend_read_property(zend_exception_get_default(), &tmp, "message", sizeof("message")-1, 0); zend_printf("Exception: %s\n", Z_STRVAL_P(msg)); zval_ptr_dtor(&tmp); EG(exception) = NULL; @@ -1136,7 +1136,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ exit_status = 1; } } else { - php_info_print_module(module TSRMLS_CC); + php_info_print_module(module); } efree(lcname); @@ -1166,8 +1166,8 @@ out: } return exit_status; err: - sapi_deactivate(TSRMLS_C); - zend_ini_deactivate(TSRMLS_C); + sapi_deactivate(); + zend_ini_deactivate(); exit_status = 1; goto out; } @@ -1358,10 +1358,10 @@ exit_loop: #ifndef PHP_CLI_WIN32_NO_CONSOLE if (sapi_module == &cli_sapi_module) { #endif - exit_status = do_cli(argc, argv TSRMLS_CC); + exit_status = do_cli(argc, argv); #ifndef PHP_CLI_WIN32_NO_CONSOLE } else { - exit_status = do_cli_server(argc, argv TSRMLS_CC); + exit_status = do_cli_server(argc, argv); } #endif } zend_end_try(); @@ -1373,7 +1373,7 @@ out: free(ini_entries); } if (module_started) { - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); } if (sapi_started) { sapi_shutdown(); diff --git a/sapi/cli/php_cli_process_title.c b/sapi/cli/php_cli_process_title.c index 28fbdfb518..0725e292de 100644 --- a/sapi/cli/php_cli_process_title.c +++ b/sapi/cli/php_cli_process_title.c @@ -34,7 +34,7 @@ PHP_FUNCTION(cli_set_process_title) size_t title_len; int rc; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &title, &title_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &title, &title_len) == FAILURE) { return; } @@ -43,7 +43,7 @@ PHP_FUNCTION(cli_set_process_title) RETURN_TRUE; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cli_set_process_title had an error: %s", ps_title_errno(rc)); + php_error_docref(NULL, E_WARNING, "cli_set_process_title had an error: %s", ps_title_errno(rc)); RETURN_FALSE; } /* }}} */ @@ -62,7 +62,7 @@ PHP_FUNCTION(cli_get_process_title) rc = get_ps_title(&length, &title); if (rc != PS_TITLE_SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cli_get_process_title had an error: %s", ps_title_errno(rc)); + php_error_docref(NULL, E_WARNING, "cli_get_process_title had an error: %s", ps_title_errno(rc)); RETURN_NULL(); } diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index f024b09980..da690577d1 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -266,8 +266,8 @@ static int php_cli_output_is_tty = OUTPUT_NOT_CHECKED; static size_t php_cli_server_client_send_through(php_cli_server_client *client, const char *str, size_t str_len); static php_cli_server_chunk *php_cli_server_chunk_heap_new_self_contained(size_t len); static void php_cli_server_buffer_append(php_cli_server_buffer *buffer, php_cli_server_chunk *chunk); -static void php_cli_server_logf(const char *format TSRMLS_DC, ...); -static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message TSRMLS_DC); +static void php_cli_server_logf(const char *format, ...); +static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message); ZEND_DECLARE_MODULE_GLOBALS(cli_server); @@ -435,7 +435,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */ } /* }}} */ -static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */ +static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{{ */ { char *s, *p; ptrdiff_t len; @@ -473,14 +473,14 @@ PHP_FUNCTION(apache_response_headers) /* {{{ */ RETURN_FALSE; } array_init(return_value); - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value TSRMLS_CC); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value); } /* }}} */ /* {{{ cli_server module */ -static void cli_server_init_globals(zend_cli_server_globals *cg TSRMLS_DC) +static void cli_server_init_globals(zend_cli_server_globals *cg) { cg->color = 0; } @@ -541,7 +541,7 @@ static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */ return SUCCESS; } /* }}} */ -static size_t sapi_cli_server_ub_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */ +static size_t sapi_cli_server_ub_write(const char *str, size_t str_length) /* {{{ */ { php_cli_server_client *client = SG(server_context); if (!client) { @@ -550,7 +550,7 @@ static size_t sapi_cli_server_ub_write(const char *str, size_t str_length TSRMLS return php_cli_server_client_send_through(client, str, str_length); } /* }}} */ -static void sapi_cli_server_flush(void *server_context TSRMLS_DC) /* {{{ */ +static void sapi_cli_server_flush(void *server_context) /* {{{ */ { php_cli_server_client *client = server_context; @@ -564,17 +564,17 @@ static void sapi_cli_server_flush(void *server_context TSRMLS_DC) /* {{{ */ } if (!SG(headers_sent)) { - sapi_send_headers(TSRMLS_C); + sapi_send_headers(); SG(headers_sent) = 1; } } /* }}} */ -static int sapi_cli_server_discard_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */{ +static int sapi_cli_server_discard_headers(sapi_headers_struct *sapi_headers) /* {{{ */{ return SAPI_HEADER_SENT_SUCCESSFULLY; } /* }}} */ -static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */ +static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers) /* {{{ */ { php_cli_server_client *client = SG(server_context); smart_str buffer = { 0 }; @@ -611,7 +611,7 @@ static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers TSRMLS } /* }}} */ -static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */ +static char *sapi_cli_server_read_cookies(void) /* {{{ */ { php_cli_server_client *client = SG(server_context); char *val; @@ -621,7 +621,7 @@ static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */ return val; } /* }}} */ -static size_t sapi_cli_server_read_post(char *buf, size_t count_bytes TSRMLS_DC) /* {{{ */ +static size_t sapi_cli_server_read_post(char *buf, size_t count_bytes) /* {{{ */ { php_cli_server_client *client = SG(server_context); if (client->request.content) { @@ -634,16 +634,16 @@ static size_t sapi_cli_server_read_post(char *buf, size_t count_bytes TSRMLS_DC) return 0; } /* }}} */ -static void sapi_cli_server_register_variable(zval *track_vars_array, const char *key, const char *val TSRMLS_DC) /* {{{ */ +static void sapi_cli_server_register_variable(zval *track_vars_array, const char *key, const char *val) /* {{{ */ { char *new_val = (char *)val; size_t new_val_len; - if (sapi_module.input_filter(PARSE_SERVER, (char*)key, &new_val, strlen(val), &new_val_len TSRMLS_CC)) { - php_register_variable_safe((char *)key, new_val, new_val_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, (char*)key, &new_val, strlen(val), &new_val_len)) { + php_register_variable_safe((char *)key, new_val, new_val_len, track_vars_array); } } /* }}} */ -static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { +static int sapi_cli_server_register_entry_cb(char **entry, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { zval *track_vars_array = va_arg(args, zval *); if (hash_key->key) { char *real_key, *key; @@ -657,7 +657,7 @@ static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_arg } } spprintf(&real_key, 0, "%s_%s", "HTTP", key); - sapi_cli_server_register_variable(track_vars_array, real_key, *entry TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, real_key, *entry); efree(key); efree(real_key); } @@ -666,10 +666,10 @@ static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_arg } /* }}} */ -static void sapi_cli_server_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ +static void sapi_cli_server_register_variables(zval *track_vars_array) /* {{{ */ { php_cli_server_client *client = SG(server_context); - sapi_cli_server_register_variable(track_vars_array, "DOCUMENT_ROOT", client->server->document_root TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "DOCUMENT_ROOT", client->server->document_root); { char *tmp; if ((tmp = strrchr(client->addr_str, ':'))) { @@ -678,61 +678,61 @@ static void sapi_cli_server_register_variables(zval *track_vars_array TSRMLS_DC) port[7] = '\0'; strncpy(addr, client->addr_str, tmp - client->addr_str); addr[tmp - client->addr_str] = '\0'; - sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", addr TSRMLS_CC); - sapi_cli_server_register_variable(track_vars_array, "REMOTE_PORT", port TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", addr); + sapi_cli_server_register_variable(track_vars_array, "REMOTE_PORT", port); } else { - sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", client->addr_str TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", client->addr_str); } } { char *tmp; spprintf(&tmp, 0, "PHP %s Development Server", PHP_VERSION); - sapi_cli_server_register_variable(track_vars_array, "SERVER_SOFTWARE", tmp TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "SERVER_SOFTWARE", tmp); efree(tmp); } { char *tmp; spprintf(&tmp, 0, "HTTP/%d.%d", client->request.protocol_version / 100, client->request.protocol_version % 100); - sapi_cli_server_register_variable(track_vars_array, "SERVER_PROTOCOL", tmp TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "SERVER_PROTOCOL", tmp); efree(tmp); } - sapi_cli_server_register_variable(track_vars_array, "SERVER_NAME", client->server->host TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "SERVER_NAME", client->server->host); { char *tmp; spprintf(&tmp, 0, "%i", client->server->port); - sapi_cli_server_register_variable(track_vars_array, "SERVER_PORT", tmp TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "SERVER_PORT", tmp); efree(tmp); } - sapi_cli_server_register_variable(track_vars_array, "REQUEST_URI", client->request.request_uri TSRMLS_CC); - sapi_cli_server_register_variable(track_vars_array, "REQUEST_METHOD", SG(request_info).request_method TSRMLS_CC); - sapi_cli_server_register_variable(track_vars_array, "SCRIPT_NAME", client->request.vpath TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "REQUEST_URI", client->request.request_uri); + sapi_cli_server_register_variable(track_vars_array, "REQUEST_METHOD", SG(request_info).request_method); + sapi_cli_server_register_variable(track_vars_array, "SCRIPT_NAME", client->request.vpath); if (SG(request_info).path_translated) { - sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", SG(request_info).path_translated TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", SG(request_info).path_translated); } else if (client->server->router) { char *temp; spprintf(&temp, 0, "%s/%s", client->server->document_root, client->server->router); - sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", temp TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", temp); efree(temp); } if (client->request.path_info) { - sapi_cli_server_register_variable(track_vars_array, "PATH_INFO", client->request.path_info TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "PATH_INFO", client->request.path_info); } if (client->request.path_info_len) { char *tmp; spprintf(&tmp, 0, "%s%s", client->request.vpath, client->request.path_info); - sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", tmp TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", tmp); efree(tmp); } else { - sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", client->request.vpath TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", client->request.vpath); } if (client->request.query_string) { - sapi_cli_server_register_variable(track_vars_array, "QUERY_STRING", client->request.query_string TSRMLS_CC); + sapi_cli_server_register_variable(track_vars_array, "QUERY_STRING", client->request.query_string); } - zend_hash_apply_with_arguments(&client->request.headers TSRMLS_CC, (apply_func_args_t)sapi_cli_server_register_entry_cb, 1, track_vars_array); + zend_hash_apply_with_arguments(&client->request.headers, (apply_func_args_t)sapi_cli_server_register_entry_cb, 1, track_vars_array); } /* }}} */ -static void sapi_cli_server_log_message(char *msg TSRMLS_DC) /* {{{ */ +static void sapi_cli_server_log_message(char *msg) /* {{{ */ { char buf[52]; @@ -1087,7 +1087,7 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen return 0; } /* }}} */ -static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read TSRMLS_DC) /* {{{ */ +static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read) /* {{{ */ { #ifdef PHP_WIN32 int _nbytes_read; @@ -1103,7 +1103,7 @@ static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sen #endif if (_nbytes_read < 0) { char *errstr = get_last_error(); - php_cli_server_logf("%s" TSRMLS_CC, errstr); + php_cli_server_logf("%s", errstr); pefree(errstr, 1); php_cli_server_chunk_dtor(chunk); pefree(chunk, 1); @@ -1125,7 +1125,7 @@ static int php_cli_is_output_tty() /* {{{ */ } /* }}} */ #endif -static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message TSRMLS_DC) /* {{{ */ +static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message) /* {{{ */ { int color = 0, effective_status = status; char *basic_buf, *message_buf = "", *error_buf = ""; @@ -1191,9 +1191,9 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu } if (color) { - php_cli_server_logf("\x1b[3%dm%s%s%s\x1b[0m" TSRMLS_CC, color, basic_buf, message_buf, error_buf); + php_cli_server_logf("\x1b[3%dm%s%s%s\x1b[0m", color, basic_buf, message_buf, error_buf); } else { - php_cli_server_logf("%s%s%s" TSRMLS_CC, basic_buf, message_buf, error_buf); + php_cli_server_logf("%s%s%s", basic_buf, message_buf, error_buf); } efree(basic_buf); @@ -1205,7 +1205,7 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu } } /* }}} */ -static void php_cli_server_logf(const char *format TSRMLS_DC, ...) /* {{{ */ +static void php_cli_server_logf(const char *format, ...) /* {{{ */ { char *buf = NULL; va_list ap; @@ -1219,19 +1219,19 @@ static void php_cli_server_logf(const char *format TSRMLS_DC, ...) /* {{{ */ } if (sapi_module.log_message) { - sapi_module.log_message(buf TSRMLS_CC); + sapi_module.log_message(buf); } efree(buf); } /* }}} */ -static php_socket_t php_network_listen_socket(const char *host, int *port, int socktype, int *af, socklen_t *socklen, zend_string **errstr TSRMLS_DC) /* {{{ */ +static php_socket_t php_network_listen_socket(const char *host, int *port, int socktype, int *af, socklen_t *socklen, zend_string **errstr) /* {{{ */ { php_socket_t retval = SOCK_ERR; int err = 0; struct sockaddr *sa = NULL, **p, **sal; - int num_addrs = php_network_getaddresses(host, socktype, &sal, errstr TSRMLS_CC); + int num_addrs = php_network_getaddresses(host, socktype, &sal, errstr); if (num_addrs == 0) { return -1; } @@ -1699,7 +1699,7 @@ static int php_cli_server_client_read_request_on_message_complete(php_http_parse return 0; } -static int php_cli_server_client_read_request(php_cli_server_client *client, char **errstr TSRMLS_DC) +static int php_cli_server_client_read_request(php_cli_server_client *client, char **errstr) { char buf[16384]; static const php_http_parser_settings settings = { @@ -1816,7 +1816,7 @@ static void destroy_request_info(sapi_request_info *request_info) /* {{{ */ { } /* }}} */ -static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_server *server, php_socket_t client_sock, struct sockaddr *addr, socklen_t addr_len TSRMLS_DC) /* {{{ */ +static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_server *server, php_socket_t client_sock, struct sockaddr *addr, socklen_t addr_len) /* {{{ */ { client->server = server; client->sock = client_sock; @@ -1825,7 +1825,7 @@ static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_ser { zend_string *addr_str = 0; - php_network_populate_name_from_sockaddr(addr, addr_len, &addr_str, NULL, 0 TSRMLS_CC); + php_network_populate_name_from_sockaddr(addr, addr_len, &addr_str, NULL, 0); client->addr_str = pestrndup(addr_str->val, addr_str->len, 1); client->addr_str_len = addr_str->len; zend_string_release(addr_str); @@ -1858,15 +1858,15 @@ static void php_cli_server_client_dtor(php_cli_server_client *client) /* {{{ */ } } /* }}} */ -static void php_cli_server_close_connection(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ +static void php_cli_server_close_connection(php_cli_server *server, php_cli_server_client *client) /* {{{ */ { #ifdef DEBUG - php_cli_server_logf("%s Closing" TSRMLS_CC, client->addr_str); + php_cli_server_logf("%s Closing", client->addr_str); #endif zend_hash_index_del(&server->clients, client->sock); } /* }}} */ -static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server_client *client, int status TSRMLS_DC) /* {{{ */ +static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server_client *client, int status) /* {{{ */ { zend_string *escaped_request_uri = NULL; const char *status_string = get_status_string(status); @@ -1877,7 +1877,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server php_cli_server_content_sender_ctor(&client->content_sender); client->content_sender_initialized = 1; - escaped_request_uri = php_escape_html_entities_ex((unsigned char *)client->request.request_uri, client->request.request_uri_len, 0, ENT_QUOTES, NULL, 0 TSRMLS_CC); + escaped_request_uri = php_escape_html_entities_ex((unsigned char *)client->request.request_uri, client->request.request_uri_len, 0, ENT_QUOTES, NULL, 0); { static const char prologue_template[] = "<!doctype html><html><head><title>%d %s</title>"; @@ -1945,7 +1945,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server php_cli_server_buffer_prepend(&client->content_sender.buffer, chunk); } - php_cli_server_log_response(client, status, errstr ? errstr : "?" TSRMLS_CC); + php_cli_server_log_response(client, status, errstr ? errstr : "?"); php_cli_server_poller_add(&server->poller, POLLOUT, client->sock); if (errstr) { pefree(errstr, 1); @@ -1961,11 +1961,11 @@ fail: return FAILURE; } /* }}} */ -static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ +static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server_client *client) /* {{{ */ { if (strlen(client->request.path_translated) != client->request.path_translated_len) { /* can't handle paths that contain nul bytes */ - return php_cli_server_send_error_page(server, client, 400 TSRMLS_CC); + return php_cli_server_send_error_page(server, client, 400); } { zend_file_handle zfd; @@ -1975,27 +1975,27 @@ static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server zfd.free_filename = 0; zfd.opened_path = NULL; zend_try { - php_execute_script(&zfd TSRMLS_CC); + php_execute_script(&zfd); } zend_end_try(); } - php_cli_server_log_response(client, SG(sapi_headers).http_response_code, NULL TSRMLS_CC); + php_cli_server_log_response(client, SG(sapi_headers).http_response_code, NULL); return SUCCESS; } /* }}} */ -static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ +static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_server_client *client) /* {{{ */ { int fd; int status = 200; if (client->request.path_translated && strlen(client->request.path_translated) != client->request.path_translated_len) { /* can't handle paths that contain nul bytes */ - return php_cli_server_send_error_page(server, client, 400 TSRMLS_CC); + return php_cli_server_send_error_page(server, client, 400); } fd = client->request.path_translated ? open(client->request.path_translated, O_RDONLY): -1; if (fd < 0) { - return php_cli_server_send_error_page(server, client, 404 TSRMLS_CC); + return php_cli_server_send_error_page(server, client, 404); } php_cli_server_content_sender_ctor(&client->content_sender); @@ -2013,7 +2013,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv append_http_status_line(&buffer, client->request.protocol_version, status, 1); if (!buffer.s) { /* out of memory */ - php_cli_server_log_response(client, 500, NULL TSRMLS_CC); + php_cli_server_log_response(client, 500, NULL); return FAILURE; } append_essential_headers(&buffer, client, 1); @@ -2030,25 +2030,25 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv chunk = php_cli_server_chunk_heap_new(buffer.s, buffer.s->val, buffer.s->len); if (!chunk) { smart_str_free(&buffer); - php_cli_server_log_response(client, 500, NULL TSRMLS_CC); + php_cli_server_log_response(client, 500, NULL); return FAILURE; } php_cli_server_buffer_append(&client->content_sender.buffer, chunk); } - php_cli_server_log_response(client, 200, NULL TSRMLS_CC); + php_cli_server_log_response(client, 200, NULL); php_cli_server_poller_add(&server->poller, POLLOUT, client->sock); return SUCCESS; } /* }}} */ -static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ +static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client) { /* {{{ */ char *auth; php_cli_server_client_populate_request_info(client, &SG(request_info)); if (NULL != (auth = zend_hash_str_find_ptr(&client->request.headers, "authorization", sizeof("authorization")-1))) { - php_handle_auth_data(auth TSRMLS_CC); + php_handle_auth_data(auth); } SG(sapi_headers).http_response_code = 200; - if (FAILURE == php_request_startup(TSRMLS_C)) { + if (FAILURE == php_request_startup()) { /* should never be happen */ destroy_request_info(&SG(request_info)); return FAILURE; @@ -2059,9 +2059,9 @@ static int php_cli_server_request_startup(php_cli_server *server, php_cli_server } /* }}} */ -static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ +static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_server_client *client) { /* {{{ */ php_request_shutdown(0); - php_cli_server_close_connection(server, client TSRMLS_CC); + php_cli_server_close_connection(server, client); destroy_request_info(&SG(request_info)); SG(server_context) = NULL; SG(rfc1867_uploaded_files) = NULL; @@ -2069,7 +2069,7 @@ static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_serve } /* }}} */ -static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ +static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client) /* {{{ */ { int decline = 0; zend_file_handle zfd; @@ -2088,7 +2088,7 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server zend_try { zval retval; - if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, &retval, 1, &zfd)) { + if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE, &retval, 1, &zfd)) { if (Z_TYPE(retval) != IS_UNDEF) { decline = Z_TYPE(retval) == IS_FALSE; zval_ptr_dtor(&retval); @@ -2108,7 +2108,7 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server } /* }}} */ -static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ +static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client *client) /* {{{ */ { int is_static_file = 0; @@ -2118,30 +2118,30 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client } if (server->router || !is_static_file) { - if (FAILURE == php_cli_server_request_startup(server, client TSRMLS_CC)) { + if (FAILURE == php_cli_server_request_startup(server, client)) { SG(server_context) = NULL; - php_cli_server_close_connection(server, client TSRMLS_CC); + php_cli_server_close_connection(server, client); destroy_request_info(&SG(request_info)); return SUCCESS; } } if (server->router) { - if (!php_cli_server_dispatch_router(server, client TSRMLS_CC)) { - php_cli_server_request_shutdown(server, client TSRMLS_CC); + if (!php_cli_server_dispatch_router(server, client)) { + php_cli_server_request_shutdown(server, client); return SUCCESS; } } if (!is_static_file) { - if (SUCCESS == php_cli_server_dispatch_script(server, client TSRMLS_CC) - || SUCCESS != php_cli_server_send_error_page(server, client, 500 TSRMLS_CC)) { - php_cli_server_request_shutdown(server, client TSRMLS_CC); + if (SUCCESS == php_cli_server_dispatch_script(server, client) + || SUCCESS != php_cli_server_send_error_page(server, client, 500)) { + php_cli_server_request_shutdown(server, client); return SUCCESS; } } else { if (server->router) { - static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC); + static int (*send_header_func)(sapi_headers_struct *); send_header_func = sapi_module.send_headers; /* do not generate default content type header */ SG(sapi_headers).send_default_content_type = 0; @@ -2152,8 +2152,8 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client SG(sapi_headers).send_default_content_type = 1; SG(rfc1867_uploaded_files) = NULL; } - if (SUCCESS != php_cli_server_begin_send_static(server, client TSRMLS_CC)) { - php_cli_server_close_connection(server, client TSRMLS_CC); + if (SUCCESS != php_cli_server_begin_send_static(server, client)) { + php_cli_server_close_connection(server, client); } SG(server_context) = NULL; return SUCCESS; @@ -2183,7 +2183,7 @@ static int php_cli_server_mime_type_ctor(php_cli_server *server, const php_cli_s return SUCCESS; } /* }}} */ -static void php_cli_server_dtor(php_cli_server *server TSRMLS_DC) /* {{{ */ +static void php_cli_server_dtor(php_cli_server *server) /* {{{ */ { zend_hash_destroy(&server->clients); zend_hash_destroy(&server->extension_mime_types); @@ -2211,7 +2211,7 @@ static void php_cli_server_client_dtor_wrapper(zval *zv) /* {{{ */ pefree(p, 1); } /* }}} */ -static int php_cli_server_ctor(php_cli_server *server, const char *addr, const char *document_root, const char *router TSRMLS_DC) /* {{{ */ +static int php_cli_server_ctor(php_cli_server *server, const char *addr, const char *document_root, const char *router) /* {{{ */ { int retval = SUCCESS; char *host = NULL; @@ -2260,9 +2260,9 @@ static int php_cli_server_ctor(php_cli_server *server, const char *addr, const c goto out; } - server_sock = php_network_listen_socket(host, &port, SOCK_STREAM, &server->address_family, &server->socklen, &errstr TSRMLS_CC); + server_sock = php_network_listen_socket(host, &port, SOCK_STREAM, &server->address_family, &server->socklen, &errstr); if (server_sock == SOCK_ERR) { - php_cli_server_logf("Failed to listen on %s:%d (reason: %s)" TSRMLS_CC, host, port, errstr ? errstr->val : "?"); + php_cli_server_logf("Failed to listen on %s:%d (reason: %s)", host, port, errstr ? errstr->val : "?"); if (errstr) { zend_string_release(errstr); } @@ -2332,20 +2332,20 @@ out: return retval; } /* }}} */ -static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ +static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cli_server_client *client) /* {{{ */ { char *errstr = NULL; - int status = php_cli_server_client_read_request(client, &errstr TSRMLS_CC); + int status = php_cli_server_client_read_request(client, &errstr); if (status < 0) { - php_cli_server_logf("%s Invalid request (%s)" TSRMLS_CC, client->addr_str, errstr); + php_cli_server_logf("%s Invalid request (%s)", client->addr_str, errstr); efree(errstr); - php_cli_server_close_connection(server, client TSRMLS_CC); + php_cli_server_close_connection(server, client); return FAILURE; } else if (status == 1 && client->request.request_method == PHP_HTTP_NOT_IMPLEMENTED) { - return php_cli_server_send_error_page(server, client, 501 TSRMLS_CC); + return php_cli_server_send_error_page(server, client, 501); } else if (status == 1) { php_cli_server_poller_remove(&server->poller, POLLIN, client->sock); - php_cli_server_dispatch(server, client TSRMLS_CC); + php_cli_server_dispatch(server, client); } else { php_cli_server_poller_add(&server->poller, POLLIN, client->sock); } @@ -2353,13 +2353,13 @@ static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cl return SUCCESS; } /* }}} */ -static int php_cli_server_send_event(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ +static int php_cli_server_send_event(php_cli_server *server, php_cli_server_client *client) /* {{{ */ { if (client->content_sender_initialized) { if (client->file_fd >= 0 && !client->content_sender.buffer.first) { size_t nbytes_read; - if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read TSRMLS_CC)) { - php_cli_server_close_connection(server, client TSRMLS_CC); + if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read)) { + php_cli_server_close_connection(server, client); return FAILURE; } if (nbytes_read == 0) { @@ -2371,12 +2371,12 @@ static int php_cli_server_send_event(php_cli_server *server, php_cli_server_clie size_t nbytes_sent; int err = php_cli_server_content_sender_send(&client->content_sender, client->sock, &nbytes_sent); if (err && err != SOCK_EAGAIN) { - php_cli_server_close_connection(server, client TSRMLS_CC); + php_cli_server_close_connection(server, client); return FAILURE; } } if (!client->content_sender.buffer.first && client->file_fd < 0) { - php_cli_server_close_connection(server, client TSRMLS_CC); + php_cli_server_close_connection(server, client); } } return SUCCESS; @@ -2385,8 +2385,8 @@ static int php_cli_server_send_event(php_cli_server *server, php_cli_server_clie typedef struct php_cli_server_do_event_for_each_fd_callback_params { php_cli_server *server; - int(*rhandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC); - int(*whandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC); + int(*rhandler)(php_cli_server*, php_cli_server_client*); + int(*whandler)(php_cli_server*, php_cli_server_client*); } php_cli_server_do_event_for_each_fd_callback_params; static int php_cli_server_do_event_for_each_fd_callback(void *_params, php_socket_t fd, int event) /* {{{ */ @@ -2405,42 +2405,42 @@ static int php_cli_server_do_event_for_each_fd_callback(void *_params, php_socke if (!ZEND_VALID_SOCKET(client_sock)) { char *errstr; errstr = php_socket_strerror(php_socket_errno(), NULL, 0); - php_cli_server_logf("Failed to accept a client (reason: %s)" TSRMLS_CC, errstr); + php_cli_server_logf("Failed to accept a client (reason: %s)", errstr); efree(errstr); pefree(sa, 1); return SUCCESS; } - if (SUCCESS != php_set_sock_blocking(client_sock, 0 TSRMLS_CC)) { + if (SUCCESS != php_set_sock_blocking(client_sock, 0)) { pefree(sa, 1); closesocket(client_sock); return SUCCESS; } - if (!(client = pemalloc(sizeof(php_cli_server_client), 1)) || FAILURE == php_cli_server_client_ctor(client, server, client_sock, sa, socklen TSRMLS_CC)) { - php_cli_server_logf("Failed to create a new request object" TSRMLS_CC); + if (!(client = pemalloc(sizeof(php_cli_server_client), 1)) || FAILURE == php_cli_server_client_ctor(client, server, client_sock, sa, socklen)) { + php_cli_server_logf("Failed to create a new request object"); pefree(sa, 1); closesocket(client_sock); return SUCCESS; } #ifdef DEBUG - php_cli_server_logf("%s Accepted" TSRMLS_CC, client->addr_str); + php_cli_server_logf("%s Accepted", client->addr_str); #endif zend_hash_index_update_ptr(&server->clients, client_sock, client); - php_cli_server_recv_event_read_request(server, client TSRMLS_CC); + php_cli_server_recv_event_read_request(server, client); } else { php_cli_server_client *client; if (NULL != (client = zend_hash_index_find_ptr(&server->clients, fd))) { if (event & POLLIN) { - params->rhandler(server, client TSRMLS_CC); + params->rhandler(server, client); } if (event & POLLOUT) { - params->whandler(server, client TSRMLS_CC); + params->whandler(server, client); } } } return SUCCESS; } /* }}} */ -static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rhandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC), int(*whandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC) TSRMLS_DC) /* {{{ */ +static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rhandler)(php_cli_server*, php_cli_server_client*), int(*whandler)(php_cli_server*, php_cli_server_client*)) /* {{{ */ { php_cli_server_do_event_for_each_fd_callback_params params = { server, @@ -2451,7 +2451,7 @@ static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rha php_cli_server_poller_iter_on_active(&server->poller, ¶ms, php_cli_server_do_event_for_each_fd_callback); } /* }}} */ -static int php_cli_server_do_event_loop(php_cli_server *server TSRMLS_DC) /* {{{ */ +static int php_cli_server_do_event_loop(php_cli_server *server) /* {{{ */ { int retval = SUCCESS; while (server->is_running) { @@ -2460,14 +2460,14 @@ static int php_cli_server_do_event_loop(php_cli_server *server TSRMLS_DC) /* {{{ if (n > 0) { php_cli_server_do_event_for_each_fd(server, php_cli_server_recv_event_read_request, - php_cli_server_send_event TSRMLS_CC); + php_cli_server_send_event); } else if (n == 0) { /* do nothing */ } else { int err = php_socket_errno(); if (err != SOCK_EINTR) { char *errstr = php_socket_strerror(err, NULL, 0); - php_cli_server_logf("%s" TSRMLS_CC, errstr); + php_cli_server_logf("%s", errstr); efree(errstr); retval = FAILURE; goto out; @@ -2486,7 +2486,7 @@ static void php_cli_server_sigint_handler(int sig) /* {{{ */ } /* }}} */ -int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */ +int do_cli_server(int argc, char **argv) /* {{{ */ { char *php_optarg = NULL; int php_optind = 1; @@ -2537,7 +2537,7 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */ router = argv[php_optind]; } - if (FAILURE == php_cli_server_ctor(&server, server_bind_address, document_root, router TSRMLS_CC)) { + if (FAILURE == php_cli_server_ctor(&server, server_bind_address, document_root, router)) { return 1; } sapi_module.phpinfo_as_text = 0; @@ -2559,8 +2559,8 @@ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */ #if defined(HAVE_SIGNAL_H) && defined(SIGINT) signal(SIGINT, php_cli_server_sigint_handler); #endif - php_cli_server_do_event_loop(&server TSRMLS_CC); - php_cli_server_dtor(&server TSRMLS_CC); + php_cli_server_do_event_loop(&server); + php_cli_server_dtor(&server); return 0; } /* }}} */ diff --git a/sapi/cli/php_cli_server.h b/sapi/cli/php_cli_server.h index 9881b0c6a2..583a22c7b9 100644 --- a/sapi/cli/php_cli_server.h +++ b/sapi/cli/php_cli_server.h @@ -25,7 +25,7 @@ extern const zend_function_entry server_additional_functions[]; extern sapi_module_struct cli_server_sapi_module; -extern int do_cli_server(int argc, char **argv TSRMLS_DC); +extern int do_cli_server(int argc, char **argv); ZEND_BEGIN_MODULE_GLOBALS(cli_server) short color; diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c index aebfb9f671..c92d8838d3 100644 --- a/sapi/continuity/capi.c +++ b/sapi/continuity/capi.c @@ -127,7 +127,7 @@ PHP_MINFO_FUNCTION(continuity) /* * sapi_capi_ub_write: Write len bytes to the connection output. */ -static int sapi_capi_ub_write(const char *str, unsigned int str_length TSRMLS_DC) +static int sapi_capi_ub_write(const char *str, unsigned int str_length) { int retval; capi_request_context *rc; @@ -143,7 +143,7 @@ static int sapi_capi_ub_write(const char *str, unsigned int str_length TSRMLS_DC * sapi_capi_header_handler: Add/update response headers with those provided * by the PHP engine. */ -static int sapi_capi_header_handler(sapi_header_struct * sapi_header, sapi_headers_struct * sapi_headers TSRMLS_DC) +static int sapi_capi_header_handler(sapi_header_struct * sapi_header, sapi_headers_struct * sapi_headers) { char *header_name, *header_content, *p; capi_request_context *rc = (capi_request_context *) SG(server_context); @@ -174,7 +174,7 @@ static int sapi_capi_header_handler(sapi_header_struct * sapi_header, sapi_heade * sapi_capi_send_headers: Transmit the headers to the client. This has the * effect of starting the response under Continuity. */ -static int sapi_capi_send_headers(sapi_headers_struct * sapi_headers TSRMLS_DC) +static int sapi_capi_send_headers(sapi_headers_struct * sapi_headers) { int retval; capi_request_context *rc = (capi_request_context *) SG(server_context); @@ -195,7 +195,7 @@ static int sapi_capi_send_headers(sapi_headers_struct * sapi_headers TSRMLS_DC) } -static int sapi_capi_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_capi_read_post(char *buffer, uint count_bytes) { unsigned int max_read, total_read = 0; capi_request_context *rc = (capi_request_context *) SG(server_context); @@ -221,7 +221,7 @@ static int sapi_capi_read_post(char *buffer, uint count_bytes TSRMLS_DC) /* * sapi_capi_read_cookies: Return cookie information into PHP. */ -static char *sapi_capi_read_cookies(TSRMLS_D) +static char *sapi_capi_read_cookies(void) { char *cookie_string; capi_request_context *rc = (capi_request_context *) SG(server_context); @@ -230,7 +230,7 @@ static char *sapi_capi_read_cookies(TSRMLS_D) return cookie_string; } -static void sapi_capi_register_server_variables(zval * track_vars_array TSRMLS_DC) +static void sapi_capi_register_server_variables(zval * track_vars_array) { capi_request_context *rc = (capi_request_context *) SG(server_context); size_t i; @@ -240,101 +240,101 @@ static void sapi_capi_register_server_variables(zval * track_vars_array TSRMLS_D /* PHP_SELF and REQUEST_URI */ value = lstFset_get(rc->t->vars, "uri"); if (value != NULL) { - php_register_variable("PHP_SELF", value, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", value, track_vars_array TSRMLS_CC); + php_register_variable("PHP_SELF", value, track_vars_array); + php_register_variable("REQUEST_URI", value, track_vars_array); } /* COUNTRY CODE */ value = lstFset_get(rc->t->vars, "ccode"); if(value!=NULL) - php_register_variable("COUNTRY_CODE", value, track_vars_array TSRMLS_CC); + php_register_variable("COUNTRY_CODE", value, track_vars_array); /* argv */ value = lstFset_get(rc->t->vars, "query"); if (value != NULL) - php_register_variable("argv", value, track_vars_array TSRMLS_CC); + php_register_variable("argv", value, track_vars_array); /* GATEWAY_INTERFACE */ - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); + php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array); /* SERVER_NAME and HTTP_HOST */ value = lstFset_get(rc->t->req_hdrs, "host"); if (value != NULL) { - php_register_variable("HTTP_HOST", value, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_HOST", value, track_vars_array); /* TODO: This should probably scrub the port value if one is present. */ - php_register_variable("SERVER_NAME", value, track_vars_array TSRMLS_CC); + php_register_variable("SERVER_NAME", value, track_vars_array); } /* SERVER_SOFTWARE */ value = lstFset_get(rc->t->res_hdrs, "Server"); if (value != NULL) - php_register_variable("SERVER_SOFTWARE", value, track_vars_array TSRMLS_CC); + php_register_variable("SERVER_SOFTWARE", value, track_vars_array); /* SERVER_PROTOCOL */ value = lstFset_get(rc->t->vars, "protocol"); if (value != NULL) - php_register_variable("SERVER_PROTOCOL", value, track_vars_array TSRMLS_CC); + php_register_variable("SERVER_PROTOCOL", value, track_vars_array); /* REQUEST_METHOD */ value = lstFset_get(rc->t->vars, "method"); if (value != NULL) - php_register_variable("REQUEST_METHOD", value, track_vars_array TSRMLS_CC); + php_register_variable("REQUEST_METHOD", value, track_vars_array); /* QUERY_STRING */ value = lstFset_get(rc->t->vars, "query"); if (value != NULL) - php_register_variable("QUERY_STRING", value, track_vars_array TSRMLS_CC); + php_register_variable("QUERY_STRING", value, track_vars_array); /* DOCUMENT_ROOT */ value = lstFset_get(rc->t->vars, "docroot"); if (value != NULL) - php_register_variable("DOCUMENT_ROOT", value, track_vars_array TSRMLS_CC); + php_register_variable("DOCUMENT_ROOT", value, track_vars_array); /* HTTP_ACCEPT */ value = lstFset_get(rc->t->req_hdrs, "accept"); if (value != NULL) - php_register_variable("HTTP_ACCEPT", value, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_ACCEPT", value, track_vars_array); /* HTTP_ACCEPT_CHARSET */ value = lstFset_get(rc->t->req_hdrs, "accept-charset"); if (value != NULL) - php_register_variable("HTTP_ACCEPT_CHARSET", value, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_ACCEPT_CHARSET", value, track_vars_array); /* HTTP_ACCEPT_ENCODING */ value = lstFset_get(rc->t->req_hdrs, "accept-encoding"); if (value != NULL) - php_register_variable("HTTP_ACCEPT_ENCODING", value, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_ACCEPT_ENCODING", value, track_vars_array); /* HTTP_ACCEPT_LANGUAGE */ value = lstFset_get(rc->t->req_hdrs, "accept-language"); if (value != NULL) - php_register_variable("HTTP_ACCEPT_LANGUAGE", value, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_ACCEPT_LANGUAGE", value, track_vars_array); /* HTTP_CONNECTION */ value = lstFset_get(rc->t->req_hdrs, "connection"); if (value != NULL) - php_register_variable("HTTP_CONNECTION", value, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_CONNECTION", value, track_vars_array); /* HTTP_REFERER */ value = lstFset_get(rc->t->req_hdrs, "referer"); if (value != NULL) - php_register_variable("HTTP_REFERER", value, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_REFERER", value, track_vars_array); /* HTTP_USER_AGENT */ value = lstFset_get(rc->t->req_hdrs, "user-agent"); if (value != NULL) - php_register_variable("HTTP_USER_AGENT", value, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_USER_AGENT", value, track_vars_array); /* REMOTE_ADDR */ utlFip_to_str(rc->t->cli_ipv4_addr, buf, sizeof(buf)); - php_register_variable("REMOTE_ADDR", buf, track_vars_array TSRMLS_CC); + php_register_variable("REMOTE_ADDR", buf, track_vars_array); /* REMOTE_PORT */ /* SCRIPT_FILENAME and PATH_TRANSLATED */ value = lstFset_get(rc->t->vars, "path"); if (value != NULL) { - php_register_variable("SCRIPT_FILENAME", value, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", value, track_vars_array TSRMLS_CC); + php_register_variable("SCRIPT_FILENAME", value, track_vars_array); + php_register_variable("PATH_TRANSLATED", value, track_vars_array); } /* SERVER_ADMIN */ /* Not applicable */ @@ -343,7 +343,7 @@ static void sapi_capi_register_server_variables(zval * track_vars_array TSRMLS_D } -static void capi_log_message(char *message TSRMLS_DC) +static void capi_log_message(char *message) { capi_request_context *rc = (capi_request_context *) SG(server_context); logFmsg(0, "mod/php: %s", message); @@ -408,7 +408,7 @@ static void capi_free(void *addr) free(addr); } -static void capi_request_ctor(NSLS_D TSRMLS_DC) +static void capi_request_ctor(NSLS_D) { char *query_string = lstFset_get(NSG(t->vars), "query"); char *uri = lstFset_get(NSG(t->vars), "uri"); @@ -427,7 +427,7 @@ static void capi_request_ctor(NSLS_D TSRMLS_DC) SG(sapi_headers).http_response_code = 200; } -static void capi_request_dtor(NSLS_D TSRMLS_DC) +static void capi_request_dtor(NSLS_D) { capi_free(SG(request_info).query_string); capi_free(SG(request_info).request_uri); @@ -436,11 +436,11 @@ static void capi_request_dtor(NSLS_D TSRMLS_DC) capi_free(SG(request_info).content_type); } -int capi_module_main(NSLS_D TSRMLS_DC) +int capi_module_main(NSLS_D) { zend_file_handle file_handle; - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { return FAILURE; } file_handle.type = ZEND_HANDLE_FILENAME; @@ -448,7 +448,7 @@ int capi_module_main(NSLS_D TSRMLS_DC) file_handle.free_filename = 0; file_handle.opened_path = NULL; - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); php_request_shutdown(NULL); return SUCCESS; @@ -475,17 +475,16 @@ int phpFservice(httpTtrans * t, lstTset * opts) int retval; capi_request_context *request_context; - TSRMLS_FETCH(); - + request_context = (capi_request_context *) malloc(sizeof(capi_request_context)); request_context->t = t; request_context->read_post_bytes = -1; SG(server_context) = request_context; - capi_request_ctor(NSLS_C TSRMLS_CC); - retval = capi_module_main(NSLS_C TSRMLS_CC); - capi_request_dtor(NSLS_C TSRMLS_CC); + capi_request_ctor(NSLS_C); + retval = capi_module_main(NSLS_C); + capi_request_dtor(NSLS_C); free(request_context); diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c index 8bfaf9f52d..d326251876 100644 --- a/sapi/embed/php_embed.c +++ b/sapi/embed/php_embed.c @@ -33,12 +33,12 @@ const char HARDCODED_INI[] = "max_execution_time=0\n" "max_input_time=-1\n\0"; -static char* php_embed_read_cookies(TSRMLS_D) +static char* php_embed_read_cookies(void) { return NULL; } -static int php_embed_deactivate(TSRMLS_D) +static int php_embed_deactivate(void) { fflush(stdout); return SUCCESS; @@ -61,7 +61,7 @@ static inline size_t php_embed_single_write(const char *str, size_t str_length) } -static size_t php_embed_ub_write(const char *str, size_t str_length TSRMLS_DC) +static size_t php_embed_ub_write(const char *str, size_t str_length) { const char *ptr = str; size_t remaining = str_length; @@ -79,25 +79,25 @@ static size_t php_embed_ub_write(const char *str, size_t str_length TSRMLS_DC) return str_length; } -static void php_embed_flush(void *server_context TSRMLS_DC) +static void php_embed_flush(void *server_context) { if (fflush(stdout)==EOF) { php_handle_aborted_connection(); } } -static void php_embed_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) +static void php_embed_send_header(sapi_header_struct *sapi_header, void *server_context) { } -static void php_embed_log_message(char *message TSRMLS_DC) +static void php_embed_log_message(char *message) { fprintf (stderr, "%s\n", message); } -static void php_embed_register_variables(zval *track_vars_array TSRMLS_DC) +static void php_embed_register_variables(zval *track_vars_array) { - php_import_environment_variables(track_vars_array TSRMLS_CC); + php_import_environment_variables(track_vars_array); } static int php_embed_startup(sapi_module_struct *sapi_module) @@ -205,22 +205,22 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC) SG(request_info).argc=argc; SG(request_info).argv=argv; - if (php_request_startup(TSRMLS_C)==FAILURE) { - php_module_shutdown(TSRMLS_C); + if (php_request_startup()==FAILURE) { + php_module_shutdown(); return FAILURE; } SG(headers_sent) = 1; SG(request_info).no_headers = 1; - php_register_variable("PHP_SELF", "-", NULL TSRMLS_CC); + php_register_variable("PHP_SELF", "-", NULL); return SUCCESS; } -EMBED_SAPI_API void php_embed_shutdown(TSRMLS_D) +EMBED_SAPI_API void php_embed_shutdown(void) { php_request_shutdown((void *) 0); - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); sapi_shutdown(); #ifdef ZTS tsrm_shutdown(); diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h index b62fd9fe24..e29f99766b 100644 --- a/sapi/embed/php_embed.h +++ b/sapi/embed/php_embed.h @@ -54,7 +54,7 @@ } zend_catch { \ /* int exit_status = EG(exit_status); */ \ } zend_end_try(); \ - php_embed_shutdown(TSRMLS_C); \ + php_embed_shutdown(); \ } #ifndef PHP_WIN32 @@ -65,7 +65,7 @@ BEGIN_EXTERN_C() EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC); -EMBED_SAPI_API void php_embed_shutdown(TSRMLS_D); +EMBED_SAPI_API void php_embed_shutdown(void); extern EMBED_SAPI_API sapi_module_struct php_embed_module; END_EXTERN_C() diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index 80bc27c7a7..9997446028 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -55,7 +55,7 @@ #define GO(field) offsetof(struct fpm_global_config_s, field) #define WPO(field) offsetof(struct fpm_worker_pool_config_s, field) -static int fpm_conf_load_ini_file(char *filename TSRMLS_DC); +static int fpm_conf_load_ini_file(char *filename); static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset); #if 0 /* not used for now */ static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset); @@ -1149,7 +1149,7 @@ int fpm_conf_write_pid() /* {{{ */ } /* }}} */ -static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */ +static int fpm_conf_post_process(int force_daemon) /* {{{ */ { struct fpm_worker_pool_s *wp; @@ -1220,7 +1220,7 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */ if (!wp->config->access_log || !*wp->config->access_log) { continue; } - if (0 > fpm_log_write(wp->config->access_format TSRMLS_CC)) { + if (0 > fpm_log_write(wp->config->access_format)) { zlog(ZLOG_ERROR, "[pool %s] wrong format for access.format '%s'", wp->config->name, wp->config->access_format); return -1; } @@ -1245,7 +1245,7 @@ static void fpm_conf_cleanup(int which, void *arg) /* {{{ */ } /* }}} */ -static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ */ +static void fpm_conf_ini_parser_include(char *inc, void *arg) /* {{{ */ { char *filename; int *error = (int *)arg;; @@ -1279,7 +1279,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ * int len = strlen(g.gl_pathv[i]); if (len < 1) continue; if (g.gl_pathv[i][len - 1] == '/') continue; /* don't parse directories */ - if (0 > fpm_conf_load_ini_file(g.gl_pathv[i] TSRMLS_CC)) { + if (0 > fpm_conf_load_ini_file(g.gl_pathv[i])) { zlog(ZLOG_ERROR, "Unable to include %s from %s at line %d", g.gl_pathv[i], filename, ini_lineno); *error = 1; efree(filename); @@ -1289,7 +1289,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ * globfree(&g); } #else /* HAVE_GLOB */ - if (0 > fpm_conf_load_ini_file(inc TSRMLS_CC)) { + if (0 > fpm_conf_load_ini_file(inc)) { zlog(ZLOG_ERROR, "Unable to include %s from %s at line %d", inc, filename, ini_lineno); *error = 1; efree(filename); @@ -1301,7 +1301,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg TSRMLS_DC) /* {{{ * } /* }}} */ -static void fpm_conf_ini_parser_section(zval *section, void *arg TSRMLS_DC) /* {{{ */ +static void fpm_conf_ini_parser_section(zval *section, void *arg) /* {{{ */ { struct fpm_worker_pool_s *wp; struct fpm_worker_pool_config_s *config; @@ -1339,7 +1339,7 @@ static void fpm_conf_ini_parser_section(zval *section, void *arg TSRMLS_DC) /* { } /* }}} */ -static void fpm_conf_ini_parser_entry(zval *name, zval *value, void *arg TSRMLS_DC) /* {{{ */ +static void fpm_conf_ini_parser_entry(zval *name, zval *value, void *arg) /* {{{ */ { struct ini_value_parser_s *parser; void *config = NULL; @@ -1396,7 +1396,7 @@ static void fpm_conf_ini_parser_entry(zval *name, zval *value, void *arg TSRMLS_ } /* }}} */ -static void fpm_conf_ini_parser_array(zval *name, zval *key, zval *value, void *arg TSRMLS_DC) /* {{{ */ +static void fpm_conf_ini_parser_array(zval *name, zval *key, zval *value, void *arg) /* {{{ */ { int *error = (int *)arg; char *err = NULL; @@ -1452,7 +1452,7 @@ static void fpm_conf_ini_parser_array(zval *name, zval *key, zval *value, void * } /* }}} */ -static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */ +static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg) /* {{{ */ { int *error; @@ -1462,13 +1462,13 @@ static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback switch(callback_type) { case ZEND_INI_PARSER_ENTRY: - fpm_conf_ini_parser_entry(arg1, arg2, error TSRMLS_CC); + fpm_conf_ini_parser_entry(arg1, arg2, error); break;; case ZEND_INI_PARSER_SECTION: - fpm_conf_ini_parser_section(arg1, error TSRMLS_CC); + fpm_conf_ini_parser_section(arg1, error); break;; case ZEND_INI_PARSER_POP_ENTRY: - fpm_conf_ini_parser_array(arg1, arg3, arg2, error TSRMLS_CC); + fpm_conf_ini_parser_array(arg1, arg3, arg2, error); break;; default: zlog(ZLOG_ERROR, "[%s:%d] Unknown INI syntax", ini_filename, ini_lineno); @@ -1478,7 +1478,7 @@ static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback } /* }}} */ -int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */ +int fpm_conf_load_ini_file(char *filename) /* {{{ */ { int error = 0; char *buf = NULL, *newbuf = NULL; @@ -1532,7 +1532,7 @@ int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */ /* always append newline and null terminate */ buf[n++] = '\n'; buf[n] = '\0'; - tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error TSRMLS_CC); + tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &error); ini_filename = filename; if (error || tmp == FAILURE) { if (ini_include) free(ini_include); @@ -1545,7 +1545,7 @@ int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */ char *tmp = ini_include; ini_include = NULL; fpm_evaluate_full_path(&tmp, NULL, NULL, 0); - fpm_conf_ini_parser_include(tmp, &error TSRMLS_CC); + fpm_conf_ini_parser_include(tmp, &error); if (error) { free(tmp); ini_recursion--; @@ -1661,7 +1661,6 @@ static void fpm_conf_dump() /* {{{ */ int fpm_conf_init_main(int test_conf, int force_daemon) /* {{{ */ { int ret; - TSRMLS_FETCH(); if (fpm_globals.prefix && *fpm_globals.prefix) { if (!fpm_conf_is_dir(fpm_globals.prefix)) { @@ -1697,14 +1696,14 @@ int fpm_conf_init_main(int test_conf, int force_daemon) /* {{{ */ } } - ret = fpm_conf_load_ini_file(fpm_globals.config TSRMLS_CC); + ret = fpm_conf_load_ini_file(fpm_globals.config); if (0 > ret) { zlog(ZLOG_ERROR, "failed to load configuration file '%s'", fpm_globals.config); return -1; } - if (0 > fpm_conf_post_process(force_daemon TSRMLS_CC)) { + if (0 > fpm_conf_post_process(force_daemon)) { zlog(ZLOG_ERROR, "failed to post process the configuration"); return -1; } diff --git a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c index b0bf32ac16..94e8b29d64 100644 --- a/sapi/fpm/fpm/fpm_log.c +++ b/sapi/fpm/fpm/fpm_log.c @@ -97,7 +97,7 @@ int fpm_log_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ } /* }}} */ -int fpm_log_write(char *log_format TSRMLS_DC) /* {{{ */ +int fpm_log_write(char *log_format) /* {{{ */ { char *s, *b; char buffer[FPM_LOG_BUFFER+1]; diff --git a/sapi/fpm/fpm/fpm_log.h b/sapi/fpm/fpm/fpm_log.h index f0199d9cb6..d85d368da5 100644 --- a/sapi/fpm/fpm/fpm_log.h +++ b/sapi/fpm/fpm/fpm_log.h @@ -7,7 +7,7 @@ #include "fpm_worker_pool.h" int fpm_log_init_child(struct fpm_worker_pool_s *wp); -int fpm_log_write(char *log_format TSRMLS_DC); +int fpm_log_write(char *log_format); int fpm_log_open(int reopen); #endif diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 2552f9afe0..62846b6ba9 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -113,7 +113,7 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS; struct sigaction act, old_term, old_quit, old_int; #endif -static void (*php_php_import_environment_variables)(zval *array_ptr TSRMLS_DC); +static void (*php_php_import_environment_variables)(zval *array_ptr); #ifndef PHP_WIN32 /* these globals used for forking children on unix systems */ @@ -127,8 +127,8 @@ static int parent = 1; static int request_body_fd; static int fpm_is_running = 0; -static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC); -static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC); +static char *sapi_cgibin_getenv(char *name, size_t name_len); +static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg); #define PHP_MODE_STANDARD 1 #define PHP_MODE_HIGHLIGHT 2 @@ -218,14 +218,14 @@ static php_cgi_globals_struct php_cgi_globals; #define TRANSLATE_SLASHES(path) #endif -static int print_module_info(zval *zv TSRMLS_DC) +static int print_module_info(zval *zv) { zend_module_entry *module = Z_PTR_P(zv); php_printf("%s\n", module->name); return 0; } -static int module_name_cmp(const void *a, const void *b TSRMLS_DC) +static int module_name_cmp(const void *a, const void *b) { Bucket *f = (Bucket *) a; Bucket *s = (Bucket *) b; @@ -234,37 +234,37 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC) ((zend_module_entry *) Z_PTR(s->val))->name); } -static void print_modules(TSRMLS_D) +static void print_modules(void) { HashTable sorted_registry; zend_hash_init(&sorted_registry, 50, NULL, NULL, 1); zend_hash_copy(&sorted_registry, &module_registry, NULL); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply(&sorted_registry, print_module_info TSRMLS_CC); + zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0); + zend_hash_apply(&sorted_registry, print_module_info); zend_hash_destroy(&sorted_registry); } -static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) +static int print_extension_info(zend_extension *ext, void *arg) { php_printf("%s\n", ext->name); return 0; } -static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC) +static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s) { return strcmp( ((zend_extension *)(*f)->data)->name, ((zend_extension *)(*s)->data)->name); } -static void print_extensions(TSRMLS_D) +static void print_extensions(void) { zend_llist sorted_exts; zend_llist_copy(&sorted_exts, &zend_extensions); sorted_exts.dtor = NULL; - zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC); + zend_llist_sort(&sorted_exts, extension_name_cmp); + zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL); zend_llist_destroy(&sorted_exts); } @@ -272,7 +272,7 @@ static void print_extensions(TSRMLS_D) #define STDOUT_FILENO 1 #endif -static inline size_t sapi_cgibin_single_write(const char *str, uint str_length TSRMLS_DC) +static inline size_t sapi_cgibin_single_write(const char *str, uint str_length) { ssize_t ret; @@ -298,14 +298,14 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length T #endif } -static size_t sapi_cgibin_ub_write(const char *str, size_t str_length TSRMLS_DC) +static size_t sapi_cgibin_ub_write(const char *str, size_t str_length) { const char *ptr = str; uint remaining = str_length; size_t ret; while (remaining > 0) { - ret = sapi_cgibin_single_write(ptr, remaining TSRMLS_CC); + ret = sapi_cgibin_single_write(ptr, remaining); if (!ret) { php_handle_aborted_connection(); return str_length - remaining; @@ -318,7 +318,7 @@ static size_t sapi_cgibin_ub_write(const char *str, size_t str_length TSRMLS_DC) } -static void sapi_cgibin_flush(void *server_context TSRMLS_DC) +static void sapi_cgibin_flush(void *server_context) { /* fpm has started, let use fcgi instead of stdout */ if (fpm_is_running) { @@ -391,7 +391,7 @@ static const http_error http_error_codes[] = { {0, NULL} }; -static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers) { char buf[SAPI_CGI_MAX_HEADER_LENGTH]; sapi_header_struct *h; @@ -497,7 +497,7 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) # define STDIN_FILENO 0 #endif -static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) +static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes) { uint read_bytes = 0; int tmp_read_bytes; @@ -510,7 +510,7 @@ static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) fcgi_request *request = (fcgi_request*) SG(server_context); if (request_body_fd == -1) { char *request_body_filename = sapi_cgibin_getenv((char *) "REQUEST_BODY_FILE", - sizeof("REQUEST_BODY_FILE") - 1 TSRMLS_CC); + sizeof("REQUEST_BODY_FILE") - 1); if (request_body_filename && *request_body_filename) { request_body_fd = open(request_body_filename, O_RDONLY); @@ -537,7 +537,7 @@ static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) return read_bytes; } -static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC) +static char *sapi_cgibin_getenv(char *name, size_t name_len) { /* if fpm has started, use fcgi env */ if (fpm_is_running) { @@ -549,7 +549,7 @@ static char *sapi_cgibin_getenv(char *name, size_t name_len TSRMLS_DC) return getenv(name); } -static char *_sapi_cgibin_putenv(char *name, char *value TSRMLS_DC) +static char *_sapi_cgibin_putenv(char *name, char *value) { int name_len; @@ -562,12 +562,12 @@ static char *_sapi_cgibin_putenv(char *name, char *value TSRMLS_DC) return fcgi_putenv(request, name, name_len, value); } -static char *sapi_cgi_read_cookies(TSRMLS_D) +static char *sapi_cgi_read_cookies(void) { - return sapi_cgibin_getenv((char *) "HTTP_COOKIE", sizeof("HTTP_COOKIE") - 1 TSRMLS_CC); + return sapi_cgibin_getenv((char *) "HTTP_COOKIE", sizeof("HTTP_COOKIE") - 1); } -void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) +void cgi_php_import_environment_variables(zval *array_ptr) { fcgi_request *request; zend_string *var; @@ -591,7 +591,7 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) } /* call php's original import as a catch-all */ - php_php_import_environment_variables(array_ptr TSRMLS_CC); + php_php_import_environment_variables(array_ptr); request = (fcgi_request*) SG(server_context); filter_arg = Z_ARR_P(array_ptr) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) @@ -600,13 +600,13 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) ZEND_HASH_FOREACH_STR_KEY_PTR(request->env, var, val) { size_t new_val_len; - if (var && sapi_module.input_filter(filter_arg, var->val, &val, strlen(val), &new_val_len TSRMLS_CC)) { - php_register_variable_safe(var->val, val, new_val_len, array_ptr TSRMLS_CC); + if (var && sapi_module.input_filter(filter_arg, var->val, &val, strlen(val), &new_val_len)) { + php_register_variable_safe(var->val, val, new_val_len, array_ptr); } } ZEND_HASH_FOREACH_END(); } -static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_cgi_register_variables(zval *track_vars_array) { size_t php_self_len; char *php_self; @@ -614,12 +614,12 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) /* In CGI mode, we consider the environment to be a part of the server * variables */ - php_import_environment_variables(track_vars_array TSRMLS_CC); + php_import_environment_variables(track_vars_array); if (CGIG(fix_pathinfo)) { char *script_name = SG(request_info).request_uri; unsigned int script_name_len = script_name ? strlen(script_name) : 0; - char *path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1 TSRMLS_CC); + char *path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1); unsigned int path_info_len = path_info ? strlen(path_info) : 0; php_self_len = script_name_len + path_info_len; @@ -634,15 +634,15 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) } /* Build the special-case PHP_SELF variable for the CGI version */ - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len)) { + php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array); } efree(php_self); } else { php_self = SG(request_info).request_uri ? SG(request_info).request_uri : ""; php_self_len = strlen(php_self); - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) { - php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len)) { + php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array); } } } @@ -653,7 +653,6 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) */ void sapi_cgi_log_fastcgi(int level, char *message, size_t len) { - TSRMLS_FETCH(); fcgi_request *request = (fcgi_request*) SG(server_context); @@ -682,10 +681,10 @@ static void sapi_cgi_log_message(char *message) /* {{{ php_cgi_ini_activate_user_config */ -static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len, int start TSRMLS_DC) +static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len, int start) { char *ptr; - time_t request_time = sapi_get_request_time(TSRMLS_C); + time_t request_time = sapi_get_request_time(); user_config_cache_entry *entry = zend_hash_str_find_ptr(&CGIG(user_config_cache), path, path_len); /* Find cached config entry: If not found, create one */ @@ -708,7 +707,7 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha zend_hash_clean(entry->user_config); if (!IS_ABSOLUTE_PATH(path, path_len)) { - real_path = tsrm_realpath(path, NULL TSRMLS_CC); + real_path = tsrm_realpath(path, NULL); if (real_path == NULL) { return; } @@ -739,23 +738,23 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha ptr = s2 + start; /* start is the point where doc_root ends! */ while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) { *ptr = 0; - php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC); + php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config); *ptr = '/'; ptr++; } } else { - php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC); + php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config); } entry->expires = request_time + PG(user_ini_cache_ttl); } /* Activate ini entries with values from the user config hash */ - php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS TSRMLS_CC); + php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS); } /* }}} */ -static int sapi_cgi_activate(TSRMLS_D) +static int sapi_cgi_activate(void) { char *path, *doc_root, *server_name; uint path_len, doc_root_len, server_name_len; @@ -767,13 +766,13 @@ static int sapi_cgi_activate(TSRMLS_D) if (php_ini_has_per_host_config()) { /* Activate per-host-system-configuration defined in php.ini and stored into configuration_hash during startup */ - server_name = sapi_cgibin_getenv("SERVER_NAME", sizeof("SERVER_NAME") - 1 TSRMLS_CC); + server_name = sapi_cgibin_getenv("SERVER_NAME", sizeof("SERVER_NAME") - 1); /* SERVER_NAME should also be defined at this stage..but better check it anyway */ if (server_name) { server_name_len = strlen(server_name); server_name = estrndup(server_name, server_name_len); zend_str_tolower(server_name, server_name_len); - php_ini_activate_per_host_config(server_name, server_name_len TSRMLS_CC); + php_ini_activate_per_host_config(server_name, server_name_len); efree(server_name); } } @@ -797,11 +796,11 @@ static int sapi_cgi_activate(TSRMLS_D) path[path_len] = 0; /* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */ - php_ini_activate_per_dir_config(path, path_len TSRMLS_CC); /* Note: for global settings sake we check from root to path */ + php_ini_activate_per_dir_config(path, path_len); /* Note: for global settings sake we check from root to path */ /* Load and activate user ini files in path starting from DOCUMENT_ROOT */ if (PG(user_ini_filename) && *PG(user_ini_filename)) { - doc_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1 TSRMLS_CC); + doc_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1); /* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */ if (doc_root) { doc_root_len = strlen(doc_root); @@ -813,7 +812,7 @@ static int sapi_cgi_activate(TSRMLS_D) doc_root = estrndup(doc_root, doc_root_len); zend_str_tolower(doc_root, doc_root_len); #endif - php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1 TSRMLS_CC); + php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1); } } @@ -826,7 +825,7 @@ static int sapi_cgi_activate(TSRMLS_D) return SUCCESS; } -static int sapi_cgi_deactivate(TSRMLS_D) +static int sapi_cgi_deactivate(void) { /* flush only when SAPI was started. The reasons are: 1. SAPI Deactivate is called from two places: module init and request shutdown @@ -1039,10 +1038,10 @@ static int is_valid_path(const char *path) Comments in the code below refer to using the above URL in a request */ -static void init_request_info(TSRMLS_D) +static void init_request_info(void) { - char *env_script_filename = sapi_cgibin_getenv("SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME") - 1 TSRMLS_CC); - char *env_path_translated = sapi_cgibin_getenv("PATH_TRANSLATED", sizeof("PATH_TRANSLATED") - 1 TSRMLS_CC); + char *env_script_filename = sapi_cgibin_getenv("SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME") - 1); + char *env_path_translated = sapi_cgibin_getenv("PATH_TRANSLATED", sizeof("PATH_TRANSLATED") - 1); char *script_path_translated = env_script_filename; char *ini; int apache_was_here = 0; @@ -1070,25 +1069,25 @@ static void init_request_info(TSRMLS_D) * of the script will be retreived later via argc/argv */ if (script_path_translated) { const char *auth; - char *content_length = sapi_cgibin_getenv("CONTENT_LENGTH", sizeof("CONTENT_LENGTH") - 1 TSRMLS_CC); - char *content_type = sapi_cgibin_getenv("CONTENT_TYPE", sizeof("CONTENT_TYPE") - 1 TSRMLS_CC); - char *env_path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1 TSRMLS_CC); - char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME") - 1 TSRMLS_CC); + char *content_length = sapi_cgibin_getenv("CONTENT_LENGTH", sizeof("CONTENT_LENGTH") - 1); + char *content_type = sapi_cgibin_getenv("CONTENT_TYPE", sizeof("CONTENT_TYPE") - 1); + char *env_path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1); + char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME") - 1); /* Hack for buggy IIS that sets incorrect PATH_INFO */ - char *env_server_software = sapi_cgibin_getenv("SERVER_SOFTWARE", sizeof("SERVER_SOFTWARE") - 1 TSRMLS_CC); + char *env_server_software = sapi_cgibin_getenv("SERVER_SOFTWARE", sizeof("SERVER_SOFTWARE") - 1); if (env_server_software && env_script_name && env_path_info && strncmp(env_server_software, "Microsoft-IIS", sizeof("Microsoft-IIS") - 1) == 0 && strncmp(env_path_info, env_script_name, strlen(env_script_name)) == 0 ) { - env_path_info = _sapi_cgibin_putenv("ORIG_PATH_INFO", env_path_info TSRMLS_CC); + env_path_info = _sapi_cgibin_putenv("ORIG_PATH_INFO", env_path_info); env_path_info += strlen(env_script_name); if (*env_path_info == 0) { env_path_info = NULL; } - env_path_info = _sapi_cgibin_putenv("PATH_INFO", env_path_info TSRMLS_CC); + env_path_info = _sapi_cgibin_putenv("PATH_INFO", env_path_info); } #define APACHE_PROXY_FCGI_PREFIX "proxy:fcgi://" @@ -1123,8 +1122,8 @@ static void init_request_info(TSRMLS_D) if (CGIG(fix_pathinfo)) { struct stat st; char *real_path = NULL; - char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL") - 1 TSRMLS_CC); - char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1 TSRMLS_CC); + char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL") - 1); + char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT") - 1); char *orig_path_translated = env_path_translated; char *orig_path_info = env_path_info; char *orig_script_name = env_script_name; @@ -1132,7 +1131,7 @@ static void init_request_info(TSRMLS_D) int script_path_translated_len; if (!env_document_root && PG(doc_root)) { - env_document_root = _sapi_cgibin_putenv("DOCUMENT_ROOT", PG(doc_root) TSRMLS_CC); + env_document_root = _sapi_cgibin_putenv("DOCUMENT_ROOT", PG(doc_root)); /* fix docroot */ TRANSLATE_SLASHES(env_document_root); } @@ -1170,7 +1169,7 @@ static void init_request_info(TSRMLS_D) #ifdef PHP_WIN32 script_path_translated[script_path_translated_len-1] == '\\' || #endif - (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL) + (real_path = tsrm_realpath(script_path_translated, NULL)) == NULL) ) { char *pt = estrndup(script_path_translated, script_path_translated_len); int len = script_path_translated_len; @@ -1213,15 +1212,15 @@ static void init_request_info(TSRMLS_D) if (orig_path_info) { char old; - _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info); old = path_info[0]; path_info[0] = 0; if (!orig_script_name || strcmp(orig_script_name, env_path_info) != 0) { if (orig_script_name) { - _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name); } - SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_path_info TSRMLS_CC); + SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_path_info); } else { SG(request_info).request_uri = orig_script_name; } @@ -1233,19 +1232,19 @@ static void init_request_info(TSRMLS_D) */ int snlen = strlen(env_script_name); if (snlen>slen && !strcmp(env_script_name+snlen-slen, path_info)) { - _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name); env_script_name[snlen-slen] = 0; - SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC); + SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name); } } - env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC); + env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info); } if (!orig_script_filename || strcmp(orig_script_filename, pt) != 0) { if (orig_script_filename) { - _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename); } - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", pt TSRMLS_CC); + script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", pt); } TRANSLATE_SLASHES(pt); @@ -1275,9 +1274,9 @@ static void init_request_info(TSRMLS_D) } path_translated[path_translated_len] = '\0'; if (orig_path_translated) { - _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated); } - env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated TSRMLS_CC); + env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated); efree(path_translated); } else if ( env_script_name && strstr(pt, env_script_name) @@ -1294,9 +1293,9 @@ static void init_request_info(TSRMLS_D) } path_translated[path_translated_len] = '\0'; if (orig_path_translated) { - _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated); } - env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated TSRMLS_CC); + env_path_translated = _sapi_cgibin_putenv("PATH_TRANSLATED", path_translated); efree(path_translated); } break; @@ -1312,18 +1311,18 @@ static void init_request_info(TSRMLS_D) * have failed anyway... we output 'no input file' now. */ if (orig_script_filename) { - _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename); } - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", NULL TSRMLS_CC); + script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", NULL); SG(sapi_headers).http_response_code = 404; } if (!SG(request_info).request_uri) { if (!orig_script_name || strcmp(orig_script_name, env_script_name) != 0) { if (orig_script_name) { - _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name); } - SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC); + SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name); } else { SG(request_info).request_uri = orig_script_name; } @@ -1337,27 +1336,27 @@ static void init_request_info(TSRMLS_D) (script_path_translated != orig_script_filename && strcmp(script_path_translated, orig_script_filename) != 0)) { if (orig_script_filename) { - _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME", orig_script_filename); } - script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC); + script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated); } if (!apache_was_here && env_redirect_url) { /* if we used PATH_TRANSLATED to work around Apache mod_fastcgi (but not mod_proxy_fcgi, * hence !apache_was_here) weirdness, strip info accordingly */ if (orig_path_info) { - _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC); - _sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info); + _sapi_cgibin_putenv("PATH_INFO", NULL); } if (orig_path_translated) { - _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC); - _sapi_cgibin_putenv("PATH_TRANSLATED", NULL TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated); + _sapi_cgibin_putenv("PATH_TRANSLATED", NULL); } } if (env_script_name != orig_script_name) { if (orig_script_name) { - _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC); + _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name); } - SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC); + SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name); } else { SG(request_info).request_uri = env_script_name; } @@ -1379,39 +1378,39 @@ static void init_request_info(TSRMLS_D) SG(request_info).path_translated = estrdup(script_path_translated); } - SG(request_info).request_method = sapi_cgibin_getenv("REQUEST_METHOD", sizeof("REQUEST_METHOD") - 1 TSRMLS_CC); + SG(request_info).request_method = sapi_cgibin_getenv("REQUEST_METHOD", sizeof("REQUEST_METHOD") - 1); /* FIXME - Work out proto_num here */ - SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING") - 1 TSRMLS_CC); + SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING") - 1); SG(request_info).content_type = (content_type ? content_type : "" ); SG(request_info).content_length = (content_length ? atol(content_length) : 0); /* The CGI RFC allows servers to pass on unvalidated Authorization data */ - auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION") - 1 TSRMLS_CC); - php_handle_auth_data(auth TSRMLS_CC); + auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION") - 1); + php_handle_auth_data(auth); } /* INI stuff */ - ini = sapi_cgibin_getenv("PHP_VALUE", sizeof("PHP_VALUE") - 1 TSRMLS_CC); + ini = sapi_cgibin_getenv("PHP_VALUE", sizeof("PHP_VALUE") - 1); if (ini) { int mode = ZEND_INI_USER; char *tmp; spprintf(&tmp, 0, "%s\n", ini); - zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode TSRMLS_CC); + zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode); efree(tmp); } - ini = sapi_cgibin_getenv("PHP_ADMIN_VALUE", sizeof("PHP_ADMIN_VALUE") - 1 TSRMLS_CC); + ini = sapi_cgibin_getenv("PHP_ADMIN_VALUE", sizeof("PHP_ADMIN_VALUE") - 1); if (ini) { int mode = ZEND_INI_SYSTEM; char *tmp; spprintf(&tmp, 0, "%s\n", ini); - zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode TSRMLS_CC); + zend_parse_ini_string(tmp, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fastcgi_ini_parser, &mode); efree(tmp); } } /* }}} */ -static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */ +static void fastcgi_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg) /* {{{ */ { int *mode = (int *)arg; char *key; @@ -1464,7 +1463,7 @@ PHP_INI_END() /* {{{ php_cgi_globals_ctor */ -static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_DC) +static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals) { php_cgi_globals->rfc2616_headers = 0; php_cgi_globals->nph = 0; @@ -1486,7 +1485,7 @@ static PHP_MINIT_FUNCTION(cgi) #ifdef ZTS ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL); #else - php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC); + php_cgi_globals_ctor(&php_cgi_globals); #endif REGISTER_INI_ENTRIES(); return SUCCESS; @@ -1522,8 +1521,8 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */ if (request->fd >= 0) { - php_output_end_all(TSRMLS_C); - php_header(TSRMLS_C); + php_output_end_all(); + php_header(); fcgi_flush(request, 1); fcgi_close(request, 0, 0); @@ -1680,15 +1679,15 @@ int main(int argc, char *argv[]) case 'm': /* list compiled in modules */ cgi_sapi_module.startup(&cgi_sapi_module); - php_output_activate(TSRMLS_C); + php_output_activate(); SG(headers_sent) = 1; php_printf("[PHP Modules]\n"); - print_modules(TSRMLS_C); + print_modules(); php_printf("\n[Zend Modules]\n"); - print_extensions(TSRMLS_C); + print_extensions(); php_printf("\n"); - php_output_end_all(TSRMLS_C); - php_output_deactivate(TSRMLS_C); + php_output_end_all(); + php_output_deactivate(); fcgi_shutdown(); exit_status = FPM_EXIT_OK; goto out; @@ -1717,20 +1716,20 @@ int main(int argc, char *argv[]) case 'h': case '?': cgi_sapi_module.startup(&cgi_sapi_module); - php_output_activate(TSRMLS_C); + php_output_activate(); SG(headers_sent) = 1; php_cgi_usage(argv[0]); - php_output_end_all(TSRMLS_C); - php_output_deactivate(TSRMLS_C); + php_output_end_all(); + php_output_deactivate(); fcgi_shutdown(); exit_status = (c == 'h') ? FPM_EXIT_OK : FPM_EXIT_USAGE; goto out; case 'v': /* show php version & quit */ cgi_sapi_module.startup(&cgi_sapi_module); - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); return FPM_EXIT_SOFTWARE; } SG(headers_sent) = 1; @@ -1751,14 +1750,14 @@ int main(int argc, char *argv[]) if (php_information) { cgi_sapi_module.phpinfo_as_text = 1; cgi_sapi_module.startup(&cgi_sapi_module); - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); return FPM_EXIT_SOFTWARE; } SG(headers_sent) = 1; SG(request_info).no_headers = 1; - php_print_info(0xFFFFFFFF TSRMLS_CC); + php_print_info(0xFFFFFFFF); php_request_shutdown((void *) 0); fcgi_shutdown(); exit_status = FPM_EXIT_OK; @@ -1768,11 +1767,11 @@ int main(int argc, char *argv[]) /* No other args are permitted here as there is no interactive mode */ if (argc != php_optind) { cgi_sapi_module.startup(&cgi_sapi_module); - php_output_activate(TSRMLS_C); + php_output_activate(); SG(headers_sent) = 1; php_cgi_usage(argv[0]); - php_output_end_all(TSRMLS_C); - php_output_deactivate(TSRMLS_C); + php_output_end_all(); + php_output_deactivate(); fcgi_shutdown(); exit_status = FPM_EXIT_USAGE; goto out; @@ -1876,17 +1875,17 @@ consult the installation file that came with this distribution, or visit \n\ while (fcgi_accept_request(&request) >= 0) { request_body_fd = -1; SG(server_context) = (void *) &request; - init_request_info(TSRMLS_C); + init_request_info(); char *primary_script = NULL; fpm_request_info(); /* request startup only after we've done all we can to * get path_translated */ - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { fcgi_finish_request(&request, 1); SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); return FPM_EXIT_SOFTWARE; } @@ -1896,7 +1895,7 @@ consult the installation file that came with this distribution, or visit \n\ goto fastcgi_request_done; } - if (fpm_status_handle_request(TSRMLS_C)) { + if (fpm_status_handle_request()) { goto fastcgi_request_done; } @@ -1924,7 +1923,7 @@ consult the installation file that came with this distribution, or visit \n\ primary_script = estrdup(SG(request_info).path_translated); /* path_translated exists, we can continue ! */ - if (php_fopen_primary_script(&file_handle TSRMLS_CC) == FAILURE) { + if (php_fopen_primary_script(&file_handle) == FAILURE) { zend_try { zlog(ZLOG_ERROR, "Unable to open primary script: %s (%s)", primary_script, strerror(errno)); if (errno == EACCES) { @@ -1945,7 +1944,7 @@ consult the installation file that came with this distribution, or visit \n\ fpm_request_executing(); - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); fastcgi_request_done: if (primary_script) { @@ -1963,12 +1962,12 @@ fastcgi_request_done: ctr.line = CGIG(error_header); ctr.line_len = strlen(CGIG(error_header)); - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); + sapi_header_op(SAPI_HEADER_REPLACE, &ctr); } } - fpm_request_end(TSRMLS_C); - fpm_log_write(NULL TSRMLS_CC); + fpm_request_end(); + fpm_log_write(NULL); efree(SG(request_info).path_translated); SG(request_info).path_translated = NULL; @@ -1997,7 +1996,7 @@ fastcgi_request_done: out: SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); if (parent) { sapi_shutdown(); diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c index e0de217c00..0910e2a030 100644 --- a/sapi/fpm/fpm/fpm_php.c +++ b/sapi/fpm/fpm/fpm_php.c @@ -23,7 +23,7 @@ static char **limit_extensions = NULL; -static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int mode, int stage TSRMLS_DC) /* {{{ */ +static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int mode, int stage) /* {{{ */ { zend_ini_entry *ini_entry; zend_string *duplicate; @@ -36,7 +36,7 @@ static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_ if (!ini_entry->on_modify || ini_entry->on_modify(ini_entry, duplicate, - ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) { + ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage) == SUCCESS) { ini_entry->value = duplicate; ini_entry->modifiable = mode; } else { @@ -47,7 +47,7 @@ static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_ } /* }}} */ -static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS_DC) TSRMLS_DC) /* {{{ */ +static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint)) /* {{{ */ { char *s = 0, *e = value; @@ -57,7 +57,7 @@ static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS case ',': if (s) { *e = '\0'; - zend_disable(s, e - s TSRMLS_CC); + zend_disable(s, e - s); s = 0; } break; @@ -71,14 +71,13 @@ static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS } if (s) { - zend_disable(s, e - s TSRMLS_CC); + zend_disable(s, e - s); } } /* }}} */ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */ { - TSRMLS_FETCH(); char *name = kv->key; char *value = kv->value; @@ -87,25 +86,25 @@ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */ if (!strcmp(name, "extension") && *value) { zval zv; - php_dl(value, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC); + php_dl(value, MODULE_PERSISTENT, &zv, 1); return Z_TYPE(zv) == IS_TRUE; } - if (fpm_php_zend_ini_alter_master(name, name_len, value, value_len, mode, PHP_INI_STAGE_ACTIVATE TSRMLS_CC) == FAILURE) { + if (fpm_php_zend_ini_alter_master(name, name_len, value, value_len, mode, PHP_INI_STAGE_ACTIVATE) == FAILURE) { return -1; } if (!strcmp(name, "disable_functions") && *value) { char *v = strdup(value); PG(disable_functions) = v; - fpm_php_disable(v, zend_disable_function TSRMLS_CC); + fpm_php_disable(v, zend_disable_function); return 1; } if (!strcmp(name, "disable_classes") && *value) { char *v = strdup(value); PG(disable_classes) = v; - fpm_php_disable(v, zend_disable_class TSRMLS_CC); + fpm_php_disable(v, zend_disable_class); return 1; } @@ -156,37 +155,37 @@ static int fpm_php_set_fcgi_mgmt_vars(struct fpm_worker_pool_s *wp) /* {{{ */ /* }}} */ #endif -char *fpm_php_script_filename(TSRMLS_D) /* {{{ */ +char *fpm_php_script_filename(void) /* {{{ */ { return SG(request_info).path_translated; } /* }}} */ -char *fpm_php_request_uri(TSRMLS_D) /* {{{ */ +char *fpm_php_request_uri(void) /* {{{ */ { return (char *) SG(request_info).request_uri; } /* }}} */ -char *fpm_php_request_method(TSRMLS_D) /* {{{ */ +char *fpm_php_request_method(void) /* {{{ */ { return (char *) SG(request_info).request_method; } /* }}} */ -char *fpm_php_query_string(TSRMLS_D) /* {{{ */ +char *fpm_php_query_string(void) /* {{{ */ { return SG(request_info).query_string; } /* }}} */ -char *fpm_php_auth_user(TSRMLS_D) /* {{{ */ +char *fpm_php_auth_user(void) /* {{{ */ { return SG(request_info).auth_user; } /* }}} */ -size_t fpm_php_content_length(TSRMLS_D) /* {{{ */ +size_t fpm_php_content_length(void) /* {{{ */ { return SG(request_info).content_length; } @@ -194,8 +193,7 @@ size_t fpm_php_content_length(TSRMLS_D) /* {{{ */ static void fpm_php_cleanup(int which, void *arg) /* {{{ */ { - TSRMLS_FETCH(); - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); sapi_shutdown(); } /* }}} */ @@ -257,7 +255,7 @@ int fpm_php_limit_extensions(char *path) /* {{{ */ } /* }}} */ -char* fpm_php_get_string_from_table(zend_string *table, char *key TSRMLS_DC) /* {{{ */ +char* fpm_php_get_string_from_table(zend_string *table, char *key) /* {{{ */ { zval *data, *tmp; zend_string *str; @@ -267,7 +265,7 @@ char* fpm_php_get_string_from_table(zend_string *table, char *key TSRMLS_DC) /* /* inspired from ext/standard/info.c */ - zend_is_auto_global(table TSRMLS_CC); + zend_is_auto_global(table); /* find the table and ensure it's an array */ data = zend_hash_find(&EG(symbol_table).ht, table); diff --git a/sapi/fpm/fpm/fpm_php.h b/sapi/fpm/fpm/fpm_php.h index 20f5a9454b..a2f2138d23 100644 --- a/sapi/fpm/fpm/fpm_php.h +++ b/sapi/fpm/fpm/fpm_php.h @@ -34,17 +34,17 @@ struct fpm_worker_pool_s; int fpm_php_init_child(struct fpm_worker_pool_s *wp); -char *fpm_php_script_filename(TSRMLS_D); -char *fpm_php_request_uri(TSRMLS_D); -char *fpm_php_request_method(TSRMLS_D); -char *fpm_php_query_string(TSRMLS_D); -char *fpm_php_auth_user(TSRMLS_D); -size_t fpm_php_content_length(TSRMLS_D); +char *fpm_php_script_filename(void); +char *fpm_php_request_uri(void); +char *fpm_php_request_method(void); +char *fpm_php_query_string(void); +char *fpm_php_auth_user(void); +size_t fpm_php_content_length(void); void fpm_php_soft_quit(); int fpm_php_init_main(); int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode); int fpm_php_limit_extensions(char *path); -char* fpm_php_get_string_from_table(zend_string *table, char *key TSRMLS_DC); +char* fpm_php_get_string_from_table(zend_string *table, char *key); #endif diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c index d5b4242fc3..91394a0b47 100644 --- a/sapi/fpm/fpm/fpm_php_trace.c +++ b/sapi/fpm/fpm/fpm_php_trace.c @@ -40,7 +40,7 @@ #endif -static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC) /* {{{ */ +static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ */ { // TODO: fpm_php_trace_dump() has to be reimplemented ??? #if 0 @@ -140,7 +140,6 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC void fpm_php_trace(struct fpm_child_s *child) /* {{{ */ { - TSRMLS_FETCH(); fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, child->wp->scoreboard); FILE *slowlog; @@ -157,7 +156,7 @@ void fpm_php_trace(struct fpm_child_s *child) /* {{{ */ goto done1; } - if (0 > fpm_php_trace_dump(child, slowlog TSRMLS_CC)) { + if (0 > fpm_php_trace_dump(child, slowlog)) { fprintf(slowlog, "+++ dump failed\n"); } diff --git a/sapi/fpm/fpm/fpm_request.c b/sapi/fpm/fpm/fpm_request.c index bf431a08d0..6335559b48 100644 --- a/sapi/fpm/fpm/fpm_request.c +++ b/sapi/fpm/fpm/fpm_request.c @@ -104,14 +104,13 @@ void fpm_request_reading_headers() /* {{{ */ void fpm_request_info() /* {{{ */ { - TSRMLS_FETCH(); struct fpm_scoreboard_proc_s *proc; - char *request_uri = fpm_php_request_uri(TSRMLS_C); - char *request_method = fpm_php_request_method(TSRMLS_C); - char *script_filename = fpm_php_script_filename(TSRMLS_C); - char *query_string = fpm_php_query_string(TSRMLS_C); - char *auth_user = fpm_php_auth_user(TSRMLS_C); - size_t content_length = fpm_php_content_length(TSRMLS_C); + char *request_uri = fpm_php_request_uri(); + char *request_method = fpm_php_request_method(); + char *script_filename = fpm_php_script_filename(); + char *query_string = fpm_php_query_string(); + char *auth_user = fpm_php_auth_user(); + size_t content_length = fpm_php_content_length(); struct timeval now; fpm_clock_get(&now); @@ -172,14 +171,14 @@ void fpm_request_executing() /* {{{ */ } /* }}} */ -void fpm_request_end(TSRMLS_D) /* {{{ */ +void fpm_request_end(void) /* {{{ */ { struct fpm_scoreboard_proc_s *proc; struct timeval now; #ifdef HAVE_TIMES struct tms cpu; #endif - size_t memory = zend_memory_peak_usage(1 TSRMLS_CC); + size_t memory = zend_memory_peak_usage(1); fpm_clock_get(&now); #ifdef HAVE_TIMES diff --git a/sapi/fpm/fpm/fpm_request.h b/sapi/fpm/fpm/fpm_request.h index aebd36cff4..d9e831d100 100644 --- a/sapi/fpm/fpm/fpm_request.h +++ b/sapi/fpm/fpm/fpm_request.h @@ -9,7 +9,7 @@ void fpm_request_accepting(); /* hanging in accept() */ void fpm_request_reading_headers(); /* start reading fastcgi request from very first byte */ void fpm_request_info(); /* not a stage really but a point in the php code, where all request params have become known to sapi */ void fpm_request_executing(); /* the script is executing */ -void fpm_request_end(TSRMLS_D); /* request ended: script response have been sent to web server */ +void fpm_request_end(void); /* request ended: script response have been sent to web server */ void fpm_request_finished(); /* request processed: cleaning current request */ struct fpm_child_s; diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c index fa3fc763a5..9d8b8fcc7c 100644 --- a/sapi/fpm/fpm/fpm_status.c +++ b/sapi/fpm/fpm/fpm_status.c @@ -46,7 +46,7 @@ int fpm_status_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ } /* }}} */ -int fpm_status_handle_request(TSRMLS_D) /* {{{ */ +int fpm_status_handle_request(void) /* {{{ */ { struct fpm_scoreboard_s scoreboard, *scoreboard_p; struct fpm_scoreboard_proc_s proc; @@ -64,9 +64,9 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ /* PING */ if (fpm_status_ping_uri && fpm_status_ping_response && !strcmp(fpm_status_ping_uri, SG(request_info).request_uri)) { fpm_request_executing(); - sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1); SG(sapi_headers).http_response_code = 200; /* handle HEAD */ @@ -86,9 +86,9 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ if (!scoreboard_p) { zlog(ZLOG_ERROR, "status: unable to find or access status shared memory"); SG(sapi_headers).http_response_code = 500; - sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1); PUTS("Internal error. Please review log file for errors."); return 1; } @@ -96,9 +96,9 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ if (!fpm_spinlock(&scoreboard_p->lock, 1)) { zlog(ZLOG_NOTICE, "[pool %s] status: scoreboard already in used.", scoreboard_p->pool); SG(sapi_headers).http_response_code = 503; - sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1); PUTS("Server busy. Please try again later."); return 1; } @@ -109,16 +109,16 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ if (scoreboard.idle < 0 || scoreboard.active < 0) { zlog(ZLOG_ERROR, "[pool %s] invalid status values", scoreboard.pool); SG(sapi_headers).http_response_code = 500; - sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1); PUTS("Internal error. Please review log file for errors."); return 1; } /* send common headers */ - sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1 TSRMLS_CC); - sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Expires: Thu, 01 Jan 1970 00:00:00 GMT"), 1, 1); + sapi_add_header_ex(ZEND_STRL("Cache-Control: no-cache, no-store, must-revalidate, max-age=0"), 1, 1); SG(sapi_headers).http_response_code = 200; /* handle HEAD */ @@ -128,14 +128,14 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ /* full status ? */ _GET_str = zend_string_init("_GET", sizeof("_GET")-1, 0); - full = (fpm_php_get_string_from_table(_GET_str, "full" TSRMLS_CC) != NULL); + full = (fpm_php_get_string_from_table(_GET_str, "full") != NULL); short_syntax = short_post = NULL; full_separator = full_pre = full_syntax = full_post = NULL; encode = 0; /* HTML */ - if (fpm_php_get_string_from_table(_GET_str, "html" TSRMLS_CC)) { - sapi_add_header_ex(ZEND_STRL("Content-Type: text/html"), 1, 1 TSRMLS_CC); + if (fpm_php_get_string_from_table(_GET_str, "html")) { + sapi_add_header_ex(ZEND_STRL("Content-Type: text/html"), 1, 1); time_format = "%d/%b/%Y:%H:%M:%S %z"; encode = 1; @@ -209,8 +209,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ } /* XML */ - } else if (fpm_php_get_string_from_table(_GET_str, "xml" TSRMLS_CC)) { - sapi_add_header_ex(ZEND_STRL("Content-Type: text/xml"), 1, 1 TSRMLS_CC); + } else if (fpm_php_get_string_from_table(_GET_str, "xml")) { + sapi_add_header_ex(ZEND_STRL("Content-Type: text/xml"), 1, 1); time_format = "%s"; encode = 1; @@ -261,8 +261,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ } /* JSON */ - } else if (fpm_php_get_string_from_table(_GET_str, "json" TSRMLS_CC)) { - sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1 TSRMLS_CC); + } else if (fpm_php_get_string_from_table(_GET_str, "json")) { + sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1); time_format = "%s"; short_syntax = @@ -313,7 +313,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ /* TEXT */ } else { - sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC); + sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1); time_format = "%d/%b/%Y:%H:%M:%S %z"; short_syntax = @@ -421,7 +421,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */ if (!encode) { query_string = proc.query_string; } else { - tmp_query_string = php_escape_html_entities_ex((unsigned char *)proc.query_string, strlen(proc.query_string), 1, ENT_HTML_IGNORE_ERRORS & ENT_COMPAT, NULL, 1 TSRMLS_CC); + tmp_query_string = php_escape_html_entities_ex((unsigned char *)proc.query_string, strlen(proc.query_string), 1, ENT_HTML_IGNORE_ERRORS & ENT_COMPAT, NULL, 1); query_string = tmp_query_string->val; } } diff --git a/sapi/fpm/fpm/fpm_status.h b/sapi/fpm/fpm/fpm_status.h index 8f3daf9c72..c6c27cd031 100644 --- a/sapi/fpm/fpm/fpm_status.h +++ b/sapi/fpm/fpm/fpm_status.h @@ -28,7 +28,7 @@ void fpm_status_increment_accepted_conn(struct fpm_shm_s *shm); void fpm_status_set_pm(struct fpm_shm_s *shm, int pm); void fpm_status_update_max_children_reached(struct fpm_shm_s *shm, unsigned int max_children_reached); void fpm_status_increment_max_children_reached(struct fpm_shm_s *shm); -int fpm_status_handle_request(TSRMLS_D); +int fpm_status_handle_request(void); extern struct fpm_shm_s *fpm_status_shm; diff --git a/sapi/isapi/php7isapi.c b/sapi/isapi/php7isapi.c index 27eb1c9353..fc97af9c34 100644 --- a/sapi/isapi/php7isapi.c +++ b/sapi/isapi/php7isapi.c @@ -202,7 +202,7 @@ static zend_module_entry php_isapi_module = { }; -static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC) +static int sapi_isapi_ub_write(const char *str, uint str_length) { DWORD num_bytes = str_length; LPEXTENSION_CONTROL_BLOCK ecb; @@ -215,20 +215,20 @@ static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC) } -static int sapi_isapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_isapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers) { return SAPI_HEADER_ADD; } -static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC) +static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length) { *total_length += sapi_header->header_len+2; } -static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC) +static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr) { memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len); *combined_headers_ptr += sapi_header->header_len; @@ -239,7 +239,7 @@ static void concat_header(sapi_header_struct *sapi_header, char **combined_heade } -static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers) { uint total_length = 2; /* account for the trailing \r\n */ char *combined_headers, *combined_headers_ptr; @@ -250,19 +250,19 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* Obtain headers length */ if (SG(sapi_headers).send_default_content_type) { - sapi_get_default_content_type_header(&default_content_type TSRMLS_CC); - accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC); + sapi_get_default_content_type_header(&default_content_type); + accumulate_header_length(&default_content_type, (void *) &total_length); } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length); /* Generate headers */ combined_headers = (char *) emalloc(total_length+1); combined_headers_ptr = combined_headers; if (SG(sapi_headers).send_default_content_type) { - concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC); + concat_header(&default_content_type, (void *) &combined_headers_ptr); sapi_free_header(&default_content_type); /* we no longer need it */ } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr); *combined_headers_ptr++ = '\r'; *combined_headers_ptr++ = '\n'; *combined_headers_ptr = 0; @@ -324,7 +324,7 @@ static int php_isapi_startup(sapi_module_struct *sapi_module) } -static int sapi_isapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_isapi_read_post(char *buffer, uint count_bytes) { LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); DWORD read_from_buf=0; @@ -354,7 +354,7 @@ static int sapi_isapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) } -static char *sapi_isapi_read_cookies(TSRMLS_D) +static char *sapi_isapi_read_cookies(void) { LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); char variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; @@ -378,7 +378,7 @@ static char *sapi_isapi_read_cookies(TSRMLS_D) #ifdef WITH_ZEUS -static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) +static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array) { char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; @@ -396,7 +396,7 @@ static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpE if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE ); } - php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array ); strcpy( static_cons_buf, "/C=" ); variable_len = ISAPI_SERVER_VAR_BUF_SIZE; @@ -408,10 +408,10 @@ static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpE if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_I_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) { strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE ); } - php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array ); } -static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) +static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array) { char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; @@ -430,11 +430,11 @@ static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf, &variable_len) && static_variable_buf[0] ) { /* PHP_SELF is just PATH_INFO */ - php_register_variable( "PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "PHP_SELF", static_variable_buf, track_vars_array ); /* Chop off filename to get just the 'real' PATH_INFO' */ pathinfo_len = variable_len - scriptname_len; - php_register_variable( "PATH_INFO", static_variable_buf + scriptname_len - 1, track_vars_array TSRMLS_CC ); + php_register_variable( "PATH_INFO", static_variable_buf + scriptname_len - 1, track_vars_array ); /* append query string to give url... extra byte for '?' */ if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) { /* append query string only if it is present... */ @@ -442,8 +442,8 @@ static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, static_variable_buf[ variable_len - 1 ] = '?'; strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString ); } - php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC ); - php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "URL", static_variable_buf, track_vars_array ); + php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array ); } } @@ -451,37 +451,37 @@ static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED", static_variable_buf, &variable_len) && static_variable_buf[0] ) { static_variable_buf[ variable_len - pathinfo_len - 1 ] = '\0'; - php_register_variable( "PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "PATH_TRANSLATED", static_variable_buf, track_vars_array ); } /* Bring in the AUTHENTICATION stuff as needed */ variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_USER", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "PHP_AUTH_USER", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "PHP_AUTH_USER", static_variable_buf, track_vars_array ); } variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_PASSWORD", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "PHP_AUTH_PW", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "PHP_AUTH_PW", static_variable_buf, track_vars_array ); } variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if ( lpECB->GetServerVariable(lpECB->ConnID, "AUTH_TYPE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "AUTH_TYPE", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "AUTH_TYPE", static_variable_buf, track_vars_array ); } /* And now, for the SSL variables (if applicable) */ variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if ( lpECB->GetServerVariable(lpECB->ConnID, "CERT_COOKIE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - sapi_isapi_register_zeus_ssl_variables( lpECB, track_vars_array TSRMLS_CC ); + sapi_isapi_register_zeus_ssl_variables( lpECB, track_vars_array ); } /* Copy some of the variables we need to meet Apache specs */ variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if ( lpECB->GetServerVariable(lpECB->ConnID, "SERVER_SOFTWARE", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "SERVER_SIGNATURE", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "SERVER_SIGNATURE", static_variable_buf, track_vars_array ); } } #else -static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC) +static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array) { char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; char path_info_buf[ISAPI_SERVER_VAR_BUF_SIZE]; @@ -494,7 +494,7 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z * belongs in PHP's version of PATH_INFO. SCRIPT_NAME also becomes PHP_SELF. */ lpECB->GetServerVariable(lpECB->ConnID, "SCRIPT_NAME", static_variable_buf, &scriptname_len); - php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array TSRMLS_CC); + php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array); /* Adjust IIS' version of PATH_INFO, set PHP_SELF, * and generate REQUEST_URI @@ -503,10 +503,10 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_INFO", static_variable_buf, &variable_len) && static_variable_buf[0] ) { /* Chop off filename to get just the 'real' PATH_INFO' */ - php_register_variable( "ORIG_PATH_INFO", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "ORIG_PATH_INFO", static_variable_buf, track_vars_array ); pathinfo_len = variable_len - scriptname_len; strncpy(path_info_buf, static_variable_buf + scriptname_len - 1, sizeof(path_info_buf)-1); - php_register_variable( "PATH_INFO", path_info_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "PATH_INFO", path_info_buf, track_vars_array ); /* append query string to give url... extra byte for '?' */ if ( strlen(lpECB->lpszQueryString) + variable_len + 1 < ISAPI_SERVER_VAR_BUF_SIZE ) { /* append query string only if it is present... */ @@ -514,19 +514,19 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z static_variable_buf[ variable_len - 1 ] = '?'; strcpy( static_variable_buf + variable_len, lpECB->lpszQueryString ); } - php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC ); - php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "URL", static_variable_buf, track_vars_array ); + php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array ); } variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if ( lpECB->GetServerVariable(lpECB->ConnID, "PATH_TRANSLATED", static_variable_buf, &variable_len) && static_variable_buf[0] ) { - php_register_variable( "ORIG_PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC ); + php_register_variable( "ORIG_PATH_TRANSLATED", static_variable_buf, track_vars_array ); } if (lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_MAP_URL_TO_PATH_EX, path_info_buf, &pathinfo_len, (LPDWORD) &humi)) { /* Remove trailing \ */ if (humi.lpszPath[variable_len-2] == '\\') { humi.lpszPath[variable_len-2] = 0; } - php_register_variable("PATH_TRANSLATED", humi.lpszPath, track_vars_array TSRMLS_CC); + php_register_variable("PATH_TRANSLATED", humi.lpszPath, track_vars_array); } } @@ -538,7 +538,7 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z if (humi.lpszPath[variable_len-2] == '\\') { humi.lpszPath[variable_len-2] = 0; } - php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array TSRMLS_CC); + php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array); } if (!SG(request_info).auth_user || !SG(request_info).auth_password || @@ -546,20 +546,20 @@ static void sapi_isapi_register_iis_variables(LPEXTENSION_CONTROL_BLOCK lpECB, z variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_AUTHORIZATION", static_variable_buf, &variable_len) && static_variable_buf[0]) { - php_handle_auth_data(static_variable_buf TSRMLS_CC); + php_handle_auth_data(static_variable_buf); } } if (SG(request_info).auth_user) { - php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, track_vars_array TSRMLS_CC ); + php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, track_vars_array ); } if (SG(request_info).auth_password) { - php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, track_vars_array TSRMLS_CC ); + php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, track_vars_array ); } } #endif -static void sapi_isapi_register_server_variables2(char **server_variables, LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array, char **recorded_values TSRMLS_DC) +static void sapi_isapi_register_server_variables2(char **server_variables, LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array, char **recorded_values) { char **p=server_variables; DWORD variable_len; @@ -570,7 +570,7 @@ static void sapi_isapi_register_server_variables2(char **server_variables, LPEXT variable_len = ISAPI_SERVER_VAR_BUF_SIZE; if (lpECB->GetServerVariable(lpECB->ConnID, *p, static_variable_buf, &variable_len) && static_variable_buf[0]) { - php_register_variable(*p, static_variable_buf, track_vars_array TSRMLS_CC); + php_register_variable(*p, static_variable_buf, track_vars_array); if (recorded_values) { recorded_values[p-server_variables] = estrndup(static_variable_buf, variable_len); } @@ -578,7 +578,7 @@ static void sapi_isapi_register_server_variables2(char **server_variables, LPEXT variable_buf = (char *) emalloc(variable_len+1); if (lpECB->GetServerVariable(lpECB->ConnID, *p, variable_buf, &variable_len) && variable_buf[0]) { - php_register_variable(*p, variable_buf, track_vars_array TSRMLS_CC); + php_register_variable(*p, variable_buf, track_vars_array); } if (recorded_values) { recorded_values[p-server_variables] = variable_buf; @@ -586,14 +586,14 @@ static void sapi_isapi_register_server_variables2(char **server_variables, LPEXT efree(variable_buf); } } else { /* for compatibility with Apache SAPIs */ - php_register_variable(*p, "", track_vars_array TSRMLS_CC); + php_register_variable(*p, "", track_vars_array); } p++; } } -static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_isapi_register_server_variables(zval *track_vars_array) { DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; char *variable; @@ -605,20 +605,20 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_D /* Register the special ISAPI variables */ memset(isapi_special_server_variables, 0, sizeof(isapi_special_server_variables)); - sapi_isapi_register_server_variables2(isapi_special_server_variable_names, lpECB, track_vars_array, isapi_special_server_variables TSRMLS_CC); + sapi_isapi_register_server_variables2(isapi_special_server_variable_names, lpECB, track_vars_array, isapi_special_server_variables); if (SG(request_info).cookie_data) { - php_register_variable("HTTP_COOKIE", SG(request_info).cookie_data, track_vars_array TSRMLS_CC); + php_register_variable("HTTP_COOKIE", SG(request_info).cookie_data, track_vars_array); } /* Register the standard ISAPI variables */ - sapi_isapi_register_server_variables2(isapi_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC); + sapi_isapi_register_server_variables2(isapi_server_variable_names, lpECB, track_vars_array, NULL); if (isapi_special_server_variables[SPECIAL_VAR_HTTPS] && (atoi(isapi_special_server_variables[SPECIAL_VAR_HTTPS]) || !strcasecmp(isapi_special_server_variables[SPECIAL_VAR_HTTPS], "on")) ) { /* Register SSL ISAPI variables */ - sapi_isapi_register_server_variables2(isapi_secure_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC); + sapi_isapi_register_server_variables2(isapi_secure_server_variable_names, lpECB, track_vars_array, NULL); } if (isapi_special_server_variables[SPECIAL_VAR_HTTPS]) { @@ -627,14 +627,14 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_D #ifdef WITH_ZEUS - sapi_isapi_register_zeus_variables(lpECB, track_vars_array TSRMLS_CC); + sapi_isapi_register_zeus_variables(lpECB, track_vars_array); #else - sapi_isapi_register_iis_variables(lpECB, track_vars_array TSRMLS_CC); + sapi_isapi_register_iis_variables(lpECB, track_vars_array); #endif /* PHP_SELF support */ if (isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]) { - php_register_variable("PHP_SELF", isapi_special_server_variables[SPECIAL_VAR_PHP_SELF], track_vars_array TSRMLS_CC); + php_register_variable("PHP_SELF", isapi_special_server_variables[SPECIAL_VAR_PHP_SELF], track_vars_array); efree(isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]); } @@ -651,7 +651,7 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_D value++; } *colon = 0; - php_register_variable(variable, value, track_vars_array TSRMLS_CC); + php_register_variable(variable, value, track_vars_array); *colon = ':'; } variable = php_strtok_r(NULL, "\r\n", &strtok_buf); @@ -706,7 +706,6 @@ BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pFilterVersion) DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LPVOID pvNotification) { - TSRMLS_FETCH(); switch (notificationType) { case SF_NOTIFY_PREPROC_HEADERS: @@ -732,7 +731,7 @@ DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LP } -static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB TSRMLS_DC) +static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB) { DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE; char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE]; @@ -779,7 +778,7 @@ static void init_request_info(LPEXTENSION_CONTROL_BLOCK lpECB TSRMLS_DC) } -static void php_isapi_report_exception(char *message, int message_len TSRMLS_DC) +static void php_isapi_report_exception(char *message, int message_len) { if (!SG(headers_sent)) { HSE_SEND_HEADER_EX_INFO header_info; @@ -794,7 +793,7 @@ static void php_isapi_report_exception(char *message, int message_len TSRMLS_DC) lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); SG(headers_sent)=1; } - sapi_isapi_ub_write(message, message_len TSRMLS_CC); + sapi_isapi_ub_write(message, message_len); } @@ -838,16 +837,15 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) #ifdef PHP_ENABLE_SEH LPEXCEPTION_POINTERS e; #endif - TSRMLS_FETCH(); zend_first_try { #ifdef PHP_ENABLE_SEH __try { #endif - init_request_info(lpECB TSRMLS_CC); + init_request_info(lpECB); SG(server_context) = lpECB; - php_request_startup(TSRMLS_C); + php_request_startup(); file_handle.filename = SG(request_info).path_translated; file_handle.free_filename = 0; @@ -856,13 +854,13 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) /* open the script here so we can 404 if it fails */ if (file_handle.filename) - retval = php_fopen_primary_script(&file_handle TSRMLS_CC); + retval = php_fopen_primary_script(&file_handle); if (!file_handle.filename || retval == FAILURE) { SG(sapi_headers).http_response_code = 404; PUTS("No input file specified.\n"); } else { - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); } if (SG(request_info).cookie_data) { @@ -902,14 +900,14 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) CG(unclean_shutdown)=1; _snprintf(buf, sizeof(buf)-1,"PHP has encountered a Stack overflow"); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); + php_isapi_report_exception(buf, strlen(buf)); } else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) { _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Access Violation at %p", e->ExceptionRecord->ExceptionAddress); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); + php_isapi_report_exception(buf, strlen(buf)); my_endthread(); } else { _snprintf(buf, sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p", e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress); - php_isapi_report_exception(buf, strlen(buf) TSRMLS_CC); + php_isapi_report_exception(buf, strlen(buf)); my_endthread(); } } diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 54b7ef9166..05e8a52afe 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -126,7 +126,7 @@ static void sapi_lsapi_ini_defaults(HashTable *configuration_hash) /* {{{ sapi_lsapi_ub_write */ -static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC) +static int sapi_lsapi_ub_write(const char *str, uint str_length) { int ret; int remain; @@ -155,7 +155,7 @@ static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_lsapi_flush */ -static void sapi_lsapi_flush( void * server_context TSRMLS_DC ) +static void sapi_lsapi_flush( void * server_context ) { if ( lsapi_mode ) { if ( LSAPI_Flush() == -1) { @@ -168,7 +168,7 @@ static void sapi_lsapi_flush( void * server_context TSRMLS_DC ) /* {{{ sapi_lsapi_deactivate */ -static int sapi_lsapi_deactivate(TSRMLS_D) +static int sapi_lsapi_deactivate(void) { if ( SG(request_info).path_translated ) { @@ -184,7 +184,7 @@ static int sapi_lsapi_deactivate(TSRMLS_D) /* {{{ sapi_lsapi_getenv */ -static char *sapi_lsapi_getenv( char * name, size_t name_len TSRMLS_DC ) +static char *sapi_lsapi_getenv( char * name, size_t name_len ) { if ( lsapi_mode ) { return LSAPI_GetEnv( name ); @@ -209,7 +209,7 @@ static int add_variable( const char * pKey, int keyLen, const char * pValue, int char * new_val = (char *) pValue; unsigned int new_val_len; - if (sapi_module.input_filter(filter_arg, (char *)pKey, &new_val, valLen, &new_val_len TSRMLS_CC)) { + if (sapi_module.input_filter(filter_arg, (char *)pKey, &new_val, valLen, &new_val_len)) { php_register_variable_safe((char *)pKey, new_val, new_val_len, (zval *)arg ); } return 1; @@ -236,7 +236,7 @@ static int add_variable( const char * pKey, int keyLen, const char * pValue, int } */ -static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC) +static void litespeed_php_import_environment_variables(zval *array_ptr) { char buf[128]; char **env, *p, *t = buf; @@ -295,7 +295,7 @@ static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC } memcpy(t, *env, nlen); t[nlen] = '\0'; - add_variable(t, nlen, p + 1, strlen( p + 1 ), array_ptr TSRMLS_CC); + add_variable(t, nlen, p + 1, strlen( p + 1 ), array_ptr); } if (t != buf && t != NULL) { efree(t); @@ -327,14 +327,14 @@ static int add_variable_magic_quote( const char * pKey, int keyLen, const char * /* {{{ sapi_lsapi_register_variables */ -static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_lsapi_register_variables(zval *track_vars_array) { char * php_self = ""; if ( lsapi_mode ) { if ( (SG(request_info).request_uri ) ) php_self = (SG(request_info).request_uri ); - litespeed_php_import_environment_variables(track_vars_array TSRMLS_CC); + litespeed_php_import_environment_variables(track_vars_array); #if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5) if (!PG(magic_quotes_gpc)) { @@ -350,13 +350,13 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC) } #endif } else { - php_import_environment_variables(track_vars_array TSRMLS_CC); + php_import_environment_variables(track_vars_array); - php_register_variable("PHP_SELF", php_self, track_vars_array TSRMLS_CC); - php_register_variable("SCRIPT_NAME", php_self, track_vars_array TSRMLS_CC); - php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array TSRMLS_CC); - php_register_variable("DOCUMENT_ROOT", "", track_vars_array TSRMLS_CC); + php_register_variable("PHP_SELF", php_self, track_vars_array); + php_register_variable("SCRIPT_NAME", php_self, track_vars_array); + php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array); + php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array); + php_register_variable("DOCUMENT_ROOT", "", track_vars_array); } } @@ -365,7 +365,7 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ sapi_lsapi_read_post */ -static int sapi_lsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_lsapi_read_post(char *buffer, uint count_bytes) { if ( lsapi_mode ) { return LSAPI_ReadReqBody( buffer, (unsigned long long)count_bytes ); @@ -380,7 +380,7 @@ static int sapi_lsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) /* {{{ sapi_lsapi_read_cookies */ -static char *sapi_lsapi_read_cookies(TSRMLS_D) +static char *sapi_lsapi_read_cookies(void) { if ( lsapi_mode ) { return LSAPI_GetHeader( H_COOKIE ); @@ -393,7 +393,7 @@ static char *sapi_lsapi_read_cookies(TSRMLS_D) /* {{{ sapi_lsapi_send_headers */ -static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers) { sapi_header_struct *h; zend_llist_position pos; @@ -412,7 +412,7 @@ static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) int len; char headerBuf[SAPI_LSAPI_MAX_HEADER_LENGTH]; - hd = sapi_get_default_content_type(TSRMLS_C); + hd = sapi_get_default_content_type(); len = snprintf( headerBuf, SAPI_LSAPI_MAX_HEADER_LENGTH - 1, "Content-type: %s", hd ); efree(hd); @@ -430,7 +430,7 @@ static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ sapi_lsapi_send_headers */ -static void sapi_lsapi_log_message(char *message TSRMLS_DC) +static void sapi_lsapi_log_message(char *message) { char buf[8192]; int len = strlen( message ); @@ -489,7 +489,7 @@ static sapi_module_struct lsapi_sapi_module = }; /* }}} */ -static int init_request_info( TSRMLS_D ) +static int init_request_info( void ) { char * pContentType = LSAPI_GetHeader( H_CONTENT_TYPE ); char * pAuth; @@ -505,7 +505,7 @@ static int init_request_info( TSRMLS_D ) SG(sapi_headers).http_response_code = 200; pAuth = LSAPI_GetHeader( H_AUTHORIZATION ); - php_handle_auth_data(pAuth TSRMLS_CC); + php_handle_auth_data(pAuth); } static char s_cur_chdir[4096] = ""; @@ -564,7 +564,7 @@ static int lsapi_fopen_primary_script( zend_file_handle * file_handle ) return 0; } -static int lsapi_execute_script( zend_file_handle * file_handle TSRMLS_DC) +static int lsapi_execute_script( zend_file_handle * file_handle) { char *p; int len; @@ -583,26 +583,26 @@ static int lsapi_execute_script( zend_file_handle * file_handle TSRMLS_DC) len = 0; memccpy( p, SG(request_info).path_translated + len, 0, 46 ); - php_execute_script(file_handle TSRMLS_CC); + php_execute_script(file_handle); return 0; } -static int lsapi_module_main(int show_source TSRMLS_DC) +static int lsapi_module_main(int show_source) { zend_file_handle file_handle = {0}; - if (php_request_startup(TSRMLS_C) == FAILURE ) { + if (php_request_startup() == FAILURE ) { return -1; } if (show_source) { zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); - highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC); + highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini); } else { - lsapi_execute_script( &file_handle TSRMLS_CC); + lsapi_execute_script( &file_handle); } zend_try { php_request_shutdown(NULL); @@ -658,7 +658,7 @@ static void override_ini() } -static int processReq( TSRMLS_D ) +static int processReq( void ) { int ret = 0; zend_first_try { @@ -670,9 +670,9 @@ static int processReq( TSRMLS_D ) override_ini(); if ( engine ) { - init_request_info( TSRMLS_C ); + init_request_info( ); - if ( lsapi_module_main( source_highlight TSRMLS_CC ) == -1 ) { + if ( lsapi_module_main( source_highlight ) == -1 ) { ret = -1; } } else { @@ -684,7 +684,7 @@ static int processReq( TSRMLS_D ) return ret; } -static void cli_usage( TSRMLS_D ) +static void cli_usage( void ) { static const char * usage = "Usage: php\n" @@ -705,12 +705,12 @@ static void cli_usage( TSRMLS_D ) "\n" " args... Arguments passed to script.\n"; php_output_startup(); - php_output_activate(TSRMLS_C); + php_output_activate(); php_printf( "%s", usage ); #ifdef PHP_OUTPUT_NEWAPI - php_output_end_all(TSRMLS_C); + php_output_end_all(); #else - php_end_ob_buffers(1 TSRMLS_CC); + php_end_ob_buffers(1); #endif } @@ -826,28 +826,28 @@ static int cli_main( int argc, char * argv[] ) case 'q': break; case 'i': - if (php_request_startup(TSRMLS_C) != FAILURE) { - php_print_info(0xFFFFFFFF TSRMLS_CC); + if (php_request_startup() != FAILURE) { + php_print_info(0xFFFFFFFF); #ifdef PHP_OUTPUT_NEWAPI - php_output_end_all(TSRMLS_C); + php_output_end_all(); #else - php_end_ob_buffers(1 TSRMLS_CC); + php_end_ob_buffers(1); #endif php_request_shutdown( NULL ); ret = 0; } break; case 'v': - if (php_request_startup(TSRMLS_C) != FAILURE) { + if (php_request_startup() != FAILURE) { #if ZEND_DEBUG php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI - php_output_end_all(TSRMLS_C); + php_output_end_all(); #else - php_end_ob_buffers(1 TSRMLS_CC); + php_end_ob_buffers(1); #endif php_request_shutdown( NULL ); ret = 0; @@ -864,7 +864,7 @@ static int cli_main( int argc, char * argv[] ) case 'h': case '?': default: - cli_usage(TSRMLS_C); + cli_usage(); ret = 0; break; @@ -885,7 +885,7 @@ static int cli_main( int argc, char * argv[] ) SG(request_info).argc = argc - (p - argv); SG(request_info).argv = p; - if (php_request_startup(TSRMLS_C) == FAILURE ) { + if (php_request_startup() == FAILURE ) { fclose( file_handle.handle.fp ); ret = 2; } else { @@ -893,12 +893,12 @@ static int cli_main( int argc, char * argv[] ) zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); - highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC); + highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini); } else if (source_highlight == 2) { file_handle.filename = *p; file_handle.free_filename = 0; file_handle.opened_path = NULL; - ret = php_lint_script(&file_handle TSRMLS_CC); + ret = php_lint_script(&file_handle); if (ret==SUCCESS) { zend_printf("No syntax errors detected in %s\n", file_handle.filename); } else { @@ -910,7 +910,7 @@ static int cli_main( int argc, char * argv[] ) file_handle.free_filename = 0; file_handle.opened_path = NULL; - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); ret = EG(exit_status); } @@ -920,13 +920,13 @@ static int cli_main( int argc, char * argv[] ) php_printf("Could not open input file: %s.\n", *p); } } else { - cli_usage(TSRMLS_C); + cli_usage(); } } }zend_end_try(); - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); #ifdef ZTS tsrm_shutdown(); @@ -1115,7 +1115,7 @@ int main( int argc, char * argv[] ) if ( slow_script_msec ) { gettimeofday( &tv_req_begin, NULL ); } - ret = processReq(TSRMLS_C); + ret = processReq(); if ( slow_script_msec ) { gettimeofday( &tv_req_end, NULL ); n = ((long) tv_req_end.tv_sec - tv_req_begin.tv_sec ) * 1000 @@ -1135,7 +1135,7 @@ int main( int argc, char * argv[] ) break; } } - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); #ifdef ZTS tsrm_shutdown(); diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c index d82089ca1f..87df7898a1 100644 --- a/sapi/milter/php_milter.c +++ b/sapi/milter/php_milter.c @@ -113,10 +113,9 @@ static int mlfi_init() zend_file_handle file_handle; zval function_name, retval; int status; - TSRMLS_FETCH(); /* request startup */ - if (php_request_startup(TSRMLS_C)==FAILURE) { + if (php_request_startup()==FAILURE) { SG(headers_sent) = 1; SG(request_info).no_headers = 1; php_request_shutdown((void *) 0); @@ -143,7 +142,7 @@ static int mlfi_init() file_handle.free_filename = 0; file_handle.opened_path = NULL; - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); /* call userland */ INIT_ZVAL(function_name); @@ -153,7 +152,7 @@ static int mlfi_init() /* set the milter context for possible use in API functions */ MG(state) = MLFI_INIT; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL); MG(state) = MLFI_NONE; MG(initialized) = 1; @@ -179,10 +178,9 @@ static sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) zend_file_handle file_handle; zval function_name, retval, *param[1]; int status; - TSRMLS_FETCH(); /* request startup */ - if (php_request_startup(TSRMLS_C)==FAILURE) { + if (php_request_startup()==FAILURE) { SG(headers_sent) = 1; SG(request_info).no_headers = 1; php_request_shutdown((void *) 0); @@ -209,7 +207,7 @@ static sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) file_handle.free_filename = 0; file_handle.opened_path = NULL; - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); /* call userland */ INIT_ZVAL(function_name); @@ -224,7 +222,7 @@ static sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) MG(ctx) = ctx; MG(state) = MLFI_CONNECT; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param); MG(state) = MLFI_NONE; zval_ptr_dtor(param); @@ -243,7 +241,6 @@ static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost) { zval function_name, retval, *param[1]; int status; - TSRMLS_FETCH(); /* call userland */ INIT_ZVAL(function_name); @@ -258,7 +255,7 @@ static sfsistat mlfi_helo(SMFICTX *ctx, char *helohost) MG(ctx) = ctx; MG(state) = MLFI_HELO; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param); MG(state) = MLFI_NONE; zval_ptr_dtor(param); @@ -278,7 +275,6 @@ static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv) { zval function_name, retval, *param[1]; int status; - TSRMLS_FETCH(); /* call userland */ INIT_ZVAL(function_name); @@ -298,7 +294,7 @@ static sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv) MG(ctx) = ctx; MG(state) = MLFI_ENVFROM; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param); MG(state) = MLFI_NONE; zval_ptr_dtor(param); @@ -318,7 +314,6 @@ static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv) { zval function_name, retval, *param[1]; int status; - TSRMLS_FETCH(); /* call userland */ INIT_ZVAL(function_name); @@ -338,7 +333,7 @@ static sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv) MG(ctx) = ctx; MG(state) = MLFI_ENVRCPT; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param); MG(state) = MLFI_NONE; @@ -359,7 +354,6 @@ static sfsistat mlfi_header(SMFICTX *ctx, char *headerf, char *headerv) { zval function_name, retval, *param[2]; int status; - TSRMLS_FETCH(); /* call userland */ INIT_ZVAL(function_name); @@ -377,7 +371,7 @@ static sfsistat mlfi_header(SMFICTX *ctx, char *headerf, char *headerv) MG(ctx) = ctx; MG(state) = MLFI_HEADER; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 2, param TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 2, param); MG(state) = MLFI_NONE; @@ -399,7 +393,6 @@ static sfsistat mlfi_eoh(SMFICTX *ctx) { zval function_name, retval; int status; - TSRMLS_FETCH(); /* call userland */ INIT_ZVAL(function_name); @@ -409,7 +402,7 @@ static sfsistat mlfi_eoh(SMFICTX *ctx) MG(ctx) = ctx; MG(state) = MLFI_EOH; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL); MG(state) = MLFI_NONE; @@ -428,7 +421,6 @@ static sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t len) { zval function_name, retval, *param[1]; int status; - TSRMLS_FETCH(); /* call userland */ INIT_ZVAL(function_name); @@ -443,7 +435,7 @@ static sfsistat mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t len) MG(ctx) = ctx; MG(state) = MLFI_BODY; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 1, param); MG(state) = MLFI_NONE; @@ -464,7 +456,6 @@ static sfsistat mlfi_eom(SMFICTX *ctx) { zval function_name, retval; int status; - TSRMLS_FETCH(); /* call userland */ INIT_ZVAL(function_name); @@ -474,7 +465,7 @@ static sfsistat mlfi_eom(SMFICTX *ctx) MG(ctx) = ctx; MG(state) = MLFI_EOM; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL); MG(state) = MLFI_NONE; @@ -493,7 +484,6 @@ static sfsistat mlfi_abort(SMFICTX *ctx) { zval function_name, retval; int status; - TSRMLS_FETCH(); /* call userland */ INIT_ZVAL(function_name); @@ -503,7 +493,7 @@ static sfsistat mlfi_abort(SMFICTX *ctx) MG(ctx) = ctx; MG(state) = MLFI_ABORT; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL); MG(state) = MLFI_NONE; @@ -523,9 +513,8 @@ static sfsistat mlfi_close(SMFICTX *ctx) int ret = SMFIS_CONTINUE; zval function_name, retval; int status; - TSRMLS_FETCH(); - if (!SG(sapi_started) && SUCCESS != php_request_startup(TSRMLS_C)) { + if (!SG(sapi_started) && SUCCESS != php_request_startup()) { return ret; } @@ -537,7 +526,7 @@ static sfsistat mlfi_close(SMFICTX *ctx) MG(ctx) = ctx; MG(state) = MLFI_CLOSE; - status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL TSRMLS_CC); + status = call_user_function(CG(function_table), NULL, &function_name, &retval, 0, NULL); MG(state) = MLFI_NONE; @@ -582,8 +571,8 @@ PHP_FUNCTION(smfi_setflags) /* valid only in the init callback */ if (MG(state) != MLFI_INIT) { - php_error(E_WARNING, NOT_INIT, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "l", &flags) == SUCCESS) { + php_error(E_WARNING, NOT_INIT, get_active_function_name()); + } else if (zend_parse_parameters(1, "l", &flags) == SUCCESS) { flags = flags & (SMFIF_ADDHDRS|SMFIF_CHGHDRS|SMFIF_CHGBODY|SMFIF_ADDRCPT|SMFIF_DELRCPT); smfilter.xxfi_flags = flags; } @@ -598,8 +587,8 @@ PHP_FUNCTION(smfi_settimeout) /* valid only in the init callback */ if (MG(state) != MLFI_INIT) { - php_error(E_WARNING, NOT_INIT, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "l", &timeout) == SUCCESS) { + php_error(E_WARNING, NOT_INIT, get_active_function_name()); + } else if (zend_parse_parameters(1, "l", &timeout) == SUCCESS) { smfi_settimeout(timeout); } } @@ -614,8 +603,8 @@ PHP_FUNCTION(smfi_getsymval) /* valid in any callback */ if (MG(state) == MLFI_NONE) { - php_error(E_WARNING, IS_NONE, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &symname, &len) == SUCCESS) { + php_error(E_WARNING, IS_NONE, get_active_function_name()); + } else if (zend_parse_parameters(1, "s", &symname, &len) == SUCCESS) { if ((ret = smfi_getsymval(MG(ctx), symname)) != NULL) { RETURN_STRING(ret, 1); } @@ -635,8 +624,8 @@ PHP_FUNCTION(smfi_setreply) /* valid in any callback */ if (MG(state) == MLFI_NONE) { - php_error(E_WARNING, IS_NONE, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(3 TSRMLS_CC, "sss", &rcode, &len, &xcode, &len, &message, &len) == SUCCESS) { + php_error(E_WARNING, IS_NONE, get_active_function_name()); + } else if (zend_parse_parameters(3, "sss", &rcode, &len, &xcode, &len, &message, &len) == SUCCESS) { if (smfi_setreply(MG(ctx), rcode, xcode, message) == MI_SUCCESS) { RETURN_TRUE; } @@ -655,8 +644,8 @@ PHP_FUNCTION(smfi_addheader) /* valid only in milter_eom */ if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(2 TSRMLS_CC, "ss", &f, &len, &v, &len) == SUCCESS) { + php_error(E_WARNING, NOT_EOM, get_active_function_name()); + } else if (zend_parse_parameters(2, "ss", &f, &len, &v, &len) == SUCCESS) { if (smfi_addheader(MG(ctx), f, v) == MI_SUCCESS) { RETURN_TRUE; } @@ -676,8 +665,8 @@ PHP_FUNCTION(smfi_chgheader) /* valid only in milter_eom */ if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(3 TSRMLS_CC, "sls", &f, &len, &idx, &v, &len) == SUCCESS) { + php_error(E_WARNING, NOT_EOM, get_active_function_name()); + } else if (zend_parse_parameters(3, "sls", &f, &len, &idx, &v, &len) == SUCCESS) { if (smfi_chgheader(MG(ctx), f, idx, v) == MI_SUCCESS) { RETURN_TRUE; } @@ -696,8 +685,8 @@ PHP_FUNCTION(smfi_addrcpt) /* valid only in milter_eom */ if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &rcpt, &len) == SUCCESS) { + php_error(E_WARNING, NOT_EOM, get_active_function_name()); + } else if (zend_parse_parameters(1, "s", &rcpt, &len) == SUCCESS) { if (smfi_addrcpt(MG(ctx), rcpt) == MI_SUCCESS) { RETURN_TRUE; } @@ -716,8 +705,8 @@ PHP_FUNCTION(smfi_delrcpt) /* valid only in milter_eom */ if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &rcpt, &len) == SUCCESS) { + php_error(E_WARNING, NOT_EOM, get_active_function_name()); + } else if (zend_parse_parameters(1, "s", &rcpt, &len) == SUCCESS) { if (smfi_delrcpt(MG(ctx), rcpt) == MI_SUCCESS) { RETURN_TRUE; } @@ -737,8 +726,8 @@ PHP_FUNCTION(smfi_replacebody) /* valid only in milter_eom */ if (MG(state) != MLFI_EOM) { - php_error(E_WARNING, NOT_EOM, get_active_function_name(TSRMLS_C)); - } else if (zend_parse_parameters(1 TSRMLS_CC, "s", &body, &len) == SUCCESS) { + php_error(E_WARNING, NOT_EOM, get_active_function_name()); + } else if (zend_parse_parameters(1, "s", &body, &len) == SUCCESS) { if (smfi_replacebody(MG(ctx), (u_char*)body, len) == MI_SUCCESS) { RETURN_TRUE; } @@ -859,27 +848,27 @@ static zend_module_entry php_milter_module = { /* {{{ Milter SAPI */ -static int sapi_milter_ub_write(const char *str, uint str_length TSRMLS_DC) +static int sapi_milter_ub_write(const char *str, uint str_length) { return str_length; } -static void sapi_milter_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_milter_register_variables(zval *track_vars_array) { - php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array TSRMLS_CC); + php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array); } -static int sapi_milter_post_read(char *buf, uint count_bytes TSRMLS_DC) +static int sapi_milter_post_read(char *buf, uint count_bytes) { return 0; } -static char* sapi_milter_read_cookies(TSRMLS_D) +static char* sapi_milter_read_cookies(void) { return NULL; } -static int sapi_milter_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_milter_send_headers(sapi_headers_struct *sapi_headers) { return SAPI_HEADER_SENT_SUCCESSFULLY; } @@ -1099,9 +1088,9 @@ int main(int argc, char *argv[]) break; case 'v': /* show php version & quit */ - if (php_request_startup(TSRMLS_C)==FAILURE) { - zend_ini_deactivate(TSRMLS_C); - php_module_shutdown(TSRMLS_C); + if (php_request_startup()==FAILURE) { + zend_ini_deactivate(); + php_module_shutdown(); sapi_shutdown(); tsrm_shutdown(); @@ -1119,7 +1108,7 @@ int main(int argc, char *argv[]) break; case 'z': /* load extension file */ - zend_load_extension(ap_php_optarg TSRMLS_CC); + zend_load_extension(ap_php_optarg); break; default: @@ -1189,7 +1178,7 @@ int main(int argc, char *argv[]) } zend_end_try(); err: - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); sapi_shutdown(); tsrm_shutdown(); diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index bb99c31652..c89d581a33 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -336,24 +336,24 @@ PHP_FUNCTION(nsapi_virtual) Request *rq; nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &uri, &uri_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &uri, &uri_len) == FAILURE) { return; } if (!nsapi_servact_service) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Sub-requests not supported on this platform", uri); + php_error_docref(NULL, E_WARNING, "Unable to include uri '%s' - Sub-requests not supported on this platform", uri); RETURN_FALSE; } else if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Sub-requests do not work with zlib.output_compression", uri); + php_error_docref(NULL, E_WARNING, "Unable to include uri '%s' - Sub-requests do not work with zlib.output_compression", uri); RETURN_FALSE; } else { - php_output_end_all(TSRMLS_C); - php_header(TSRMLS_C); + php_output_end_all(); + php_header(); /* do the sub-request */ /* thanks to Chris Elving from Sun for this code sniplet */ if ((rq = request_restart_internal(uri, NULL)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - Internal request creation failed", uri); + php_error_docref(NULL, E_WARNING, "Unable to include uri '%s' - Internal request creation failed", uri); RETURN_FALSE; } @@ -385,7 +385,7 @@ PHP_FUNCTION(nsapi_virtual) } while (rv == REQ_RESTART); if (rq->status_num != 200) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include uri '%s' - HTTP status code %d during subrequest", uri, rq->status_num); + php_error_docref(NULL, E_WARNING, "Unable to include uri '%s' - HTTP status code %d during subrequest", uri, rq->status_num); request_free(rq); RETURN_FALSE; } @@ -450,13 +450,13 @@ PHP_FUNCTION(nsapi_response_headers) /* SAPI part */ /*************/ -static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_DC) +static int sapi_nsapi_ub_write(const char *str, unsigned int str_length) { int retval; nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); if (!SG(headers_sent)) { - sapi_send_headers(TSRMLS_C); + sapi_send_headers(); } retval = net_write(rc->sn->csd, (char *)str, str_length); @@ -467,7 +467,7 @@ static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_D } /* modified version of apache2 */ -static void sapi_nsapi_flush(void *server_context TSRMLS_DC) +static void sapi_nsapi_flush(void *server_context) { nsapi_request_context *rc = (nsapi_request_context *)server_context; @@ -477,7 +477,7 @@ static void sapi_nsapi_flush(void *server_context TSRMLS_DC) } if (!SG(headers_sent)) { - sapi_send_headers(TSRMLS_C); + sapi_send_headers(); } /* flushing is only supported in iPlanet servers from version 6.1 on, make it conditional */ @@ -489,7 +489,7 @@ static void sapi_nsapi_flush(void *server_context TSRMLS_DC) } /* callback for zend_llist_apply on SAPI_HEADER_DELETE_ALL operation */ -static int php_nsapi_remove_header(sapi_header_struct *sapi_header TSRMLS_DC) +static int php_nsapi_remove_header(sapi_header_struct *sapi_header) { char *header_name, *p; nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); @@ -514,7 +514,7 @@ static int php_nsapi_remove_header(sapi_header_struct *sapi_header TSRMLS_DC) return ZEND_HASH_APPLY_KEEP; } -static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers) { char *header_name, *header_content, *p; nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); @@ -522,12 +522,12 @@ static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_heade switch(op) { case SAPI_HEADER_DELETE_ALL: /* this only deletes headers set or overwritten by PHP, headers previously set by NSAPI are left intact */ - zend_llist_apply(&sapi_headers->headers, (llist_apply_func_t) php_nsapi_remove_header TSRMLS_CC); + zend_llist_apply(&sapi_headers->headers, (llist_apply_func_t) php_nsapi_remove_header); return 0; case SAPI_HEADER_DELETE: /* reuse the zend_llist_apply callback function for this, too */ - php_nsapi_remove_header(sapi_header TSRMLS_CC); + php_nsapi_remove_header(sapi_header); return 0; case SAPI_HEADER_ADD: @@ -564,7 +564,7 @@ static int sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_heade } } -static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers) { int retval; nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); @@ -572,7 +572,7 @@ static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) if (SG(sapi_headers).send_default_content_type) { char *hd; param_free(pblock_remove("content-type", rc->rq->srvhdrs)); - hd = sapi_get_default_content_type(TSRMLS_C); + hd = sapi_get_default_content_type(); pblock_nvinsert("content-type", hd, rc->rq->srvhdrs); efree(hd); } @@ -587,7 +587,7 @@ static int sapi_nsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) } } -static int sapi_nsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_nsapi_read_post(char *buffer, uint count_bytes) { nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); char *read_ptr = buffer, *content_length_str = NULL; @@ -645,7 +645,7 @@ static int sapi_nsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) return bytes_read; } -static char *sapi_nsapi_read_cookies(TSRMLS_D) +static char *sapi_nsapi_read_cookies(void) { char *cookie_string; nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); @@ -654,7 +654,7 @@ static char *sapi_nsapi_read_cookies(TSRMLS_D) return cookie_string; } -static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_nsapi_register_server_variables(zval *track_vars_array) { nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); register size_t i; @@ -666,7 +666,7 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D for (i = 0; i < nsapi_reqpb_size; i++) { value = pblock_findval(nsapi_reqpb[i].nsapi_eq, rc->rq->reqpb); if (value) { - php_register_variable((char *)nsapi_reqpb[i].env_var, value, track_vars_array TSRMLS_CC); + php_register_variable((char *)nsapi_reqpb[i].env_var, value, track_vars_array); } } @@ -687,7 +687,7 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D *p = '_'; } } - php_register_variable(value, entry->param->value, track_vars_array TSRMLS_CC); + php_register_variable(value, entry->param->value, track_vars_array); efree(value); } entry=entry->next; @@ -697,50 +697,50 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D for (i = 0; i < nsapi_vars_size; i++) { value = pblock_findval(nsapi_vars[i].nsapi_eq, rc->rq->vars); if (value) { - php_register_variable((char *)nsapi_vars[i].env_var, value, track_vars_array TSRMLS_CC); + php_register_variable((char *)nsapi_vars[i].env_var, value, track_vars_array); } } for (i = 0; i < nsapi_client_size; i++) { value = pblock_findval(nsapi_client[i].nsapi_eq, rc->sn->client); if (value) { - php_register_variable((char *)nsapi_client[i].env_var, value, track_vars_array TSRMLS_CC); + php_register_variable((char *)nsapi_client[i].env_var, value, track_vars_array); } } if (value = session_dns(rc->sn)) { - php_register_variable("REMOTE_HOST", value, track_vars_array TSRMLS_CC); + php_register_variable("REMOTE_HOST", value, track_vars_array); nsapi_free(value); } slprintf(buf, sizeof(buf), "%d", conf_getglobals()->Vport); - php_register_variable("SERVER_PORT", buf, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_NAME", conf_getglobals()->Vserver_hostname, track_vars_array TSRMLS_CC); + php_register_variable("SERVER_PORT", buf, track_vars_array); + php_register_variable("SERVER_NAME", conf_getglobals()->Vserver_hostname, track_vars_array); value = http_uri2url_dynamic("", "", rc->sn, rc->rq); - php_register_variable("SERVER_URL", value, track_vars_array TSRMLS_CC); + php_register_variable("SERVER_URL", value, track_vars_array); nsapi_free(value); - php_register_variable("SERVER_SOFTWARE", system_version(), track_vars_array TSRMLS_CC); + php_register_variable("SERVER_SOFTWARE", system_version(), track_vars_array); if (security_active) { - php_register_variable("HTTPS", "ON", track_vars_array TSRMLS_CC); + php_register_variable("HTTPS", "ON", track_vars_array); } - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); + php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array); /* DOCUMENT_ROOT */ if (value = request_translate_uri("/", rc->sn)) { pos = strlen(value); - php_register_variable_safe("DOCUMENT_ROOT", value, pos-1, track_vars_array TSRMLS_CC); + php_register_variable_safe("DOCUMENT_ROOT", value, pos-1, track_vars_array); nsapi_free(value); } /* PATH_INFO / PATH_TRANSLATED */ if (rc->path_info) { if (value = request_translate_uri(rc->path_info, rc->sn)) { - php_register_variable("PATH_TRANSLATED", value, track_vars_array TSRMLS_CC); + php_register_variable("PATH_TRANSLATED", value, track_vars_array); nsapi_free(value); } - php_register_variable("PATH_INFO", rc->path_info, track_vars_array TSRMLS_CC); + php_register_variable("PATH_INFO", rc->path_info, track_vars_array); } /* Create full Request-URI & Script-Name */ @@ -750,11 +750,11 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D if (SG(request_info).query_string) { spprintf(&value, 0, "%s?%s", SG(request_info).request_uri, SG(request_info).query_string); if (value) { - php_register_variable("REQUEST_URI", value, track_vars_array TSRMLS_CC); + php_register_variable("REQUEST_URI", value, track_vars_array); efree(value); } } else { - php_register_variable_safe("REQUEST_URI", SG(request_info).request_uri, pos, track_vars_array TSRMLS_CC); + php_register_variable_safe("REQUEST_URI", SG(request_info).request_uri, pos, track_vars_array); } if (rc->path_info) { @@ -763,18 +763,18 @@ static void sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_D pos = 0; } } - php_register_variable_safe("SCRIPT_NAME", SG(request_info).request_uri, pos, track_vars_array TSRMLS_CC); + php_register_variable_safe("SCRIPT_NAME", SG(request_info).request_uri, pos, track_vars_array); } - php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array TSRMLS_CC); + php_register_variable("SCRIPT_FILENAME", SG(request_info).path_translated, track_vars_array); /* special variables in error mode */ if (rc->http_error) { slprintf(buf, sizeof(buf), "%d", rc->http_error); - php_register_variable("ERROR_TYPE", buf, track_vars_array TSRMLS_CC); + php_register_variable("ERROR_TYPE", buf, track_vars_array); } } -static void nsapi_log_message(char *message TSRMLS_DC) +static void nsapi_log_message(char *message) { nsapi_request_context *rc = (nsapi_request_context *)SG(server_context); @@ -785,7 +785,7 @@ static void nsapi_log_message(char *message TSRMLS_DC) } } -static double sapi_nsapi_get_request_time(TSRMLS_D) +static double sapi_nsapi_get_request_time(void) { return REQ_TIME( ((nsapi_request_context *)SG(server_context))->rq ); } @@ -798,7 +798,7 @@ static int php_nsapi_startup(sapi_module_struct *sapi_module) return SUCCESS; } -static struct stat* sapi_nsapi_get_stat(TSRMLS_D) +static struct stat* sapi_nsapi_get_stat(void) { return request_stat_path( SG(request_info).path_translated, @@ -841,7 +841,7 @@ static sapi_module_struct nsapi_sapi_module = { STANDARD_SAPI_MODULE_PROPERTIES }; -static void nsapi_php_ini_entries(NSLS_D TSRMLS_DC) +static void nsapi_php_ini_entries(NSLS_D) { struct pb_entry *entry; register int i,j,ok; @@ -975,7 +975,6 @@ int NSAPI_PUBLIC php7_execute(pblock *pb, Session *sn, Request *rq) /* try to use script parameter -> Error or Service for directory listing */ char *path_translated = pblock_findval("script", pb); - TSRMLS_FETCH(); /* if script parameter is missing: normal use as Service SAF */ if (!path_translated) { @@ -1027,9 +1026,9 @@ int NSAPI_PUBLIC php7_execute(pblock *pb, Session *sn, Request *rq) SG(request_info).content_length = (content_length == NULL) ? 0 : strtoul(content_length, 0, 0); SG(sapi_headers).http_response_code = (error_directive) ? rq->status_num : 200; - nsapi_php_ini_entries(NSLS_C TSRMLS_CC); + nsapi_php_ini_entries(NSLS_C); - php_handle_auth_data(pblock_findval("authorization", rq->headers) TSRMLS_CC); + php_handle_auth_data(pblock_findval("authorization", rq->headers)); file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = SG(request_info).path_translated; @@ -1038,8 +1037,8 @@ int NSAPI_PUBLIC php7_execute(pblock *pb, Session *sn, Request *rq) fst = request_stat_path(SG(request_info).path_translated, rq); if (fst && S_ISREG(fst->st_mode)) { - if (php_request_startup(TSRMLS_C) == SUCCESS) { - php_execute_script(&file_handle TSRMLS_CC); + if (php_request_startup() == SUCCESS) { + php_execute_script(&file_handle); php_request_shutdown(NULL); retval=REQ_PROCEED; } else { diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index c624669785..70b3371341 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -53,7 +53,7 @@ static PHP_INI_MH(OnUpdateEol) return FAILURE; } - return phpdbg_eol_global_update(new_value->val TSRMLS_CC); + return phpdbg_eol_global_update(new_value->val); } PHP_INI_BEGIN() @@ -64,9 +64,9 @@ PHP_INI_END() static zend_bool phpdbg_booted = 0; #if PHP_VERSION_ID >= 50500 -void (*zend_execute_old)(zend_execute_data *execute_data TSRMLS_DC); +void (*zend_execute_old)(zend_execute_data *execute_data); #else -void (*zend_execute_old)(zend_op_array *op_array TSRMLS_DC); +void (*zend_execute_old)(zend_op_array *op_array); #endif static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */ @@ -164,9 +164,8 @@ static void php_phpdbg_destroy_bp_condition(zval *data) /* {{{ */ if (brake) { if (brake->ops) { - TSRMLS_FETCH(); - - destroy_op_array(brake->ops TSRMLS_CC); + + destroy_op_array(brake->ops); efree(brake->ops); } efree((char*) brake->code); @@ -177,9 +176,8 @@ static void php_phpdbg_destroy_registered(zval *data) /* {{{ */ { zend_function *function = (zend_function *) Z_PTR_P(data); - TSRMLS_FETCH(); - destroy_zend_function(function TSRMLS_CC); + destroy_zend_function(function); } /* }}} */ @@ -248,7 +246,7 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ } if (PHPDBG_G(ops)) { - destroy_op_array(PHPDBG_G(ops) TSRMLS_CC); + destroy_op_array(PHPDBG_G(ops)); efree(PHPDBG_G(ops)); PHPDBG_G(ops) = NULL; } @@ -265,7 +263,7 @@ static PHP_FUNCTION(phpdbg_exec) { zend_string *exec; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &exec) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &exec) == FAILURE) { return; } @@ -307,7 +305,7 @@ static PHP_FUNCTION(phpdbg_break_next) return; } - phpdbg_set_breakpoint_opline_ex((phpdbg_opline_ptr_t) EG(current_execute_data)->opline + 1 TSRMLS_CC); + phpdbg_set_breakpoint_opline_ex((phpdbg_opline_ptr_t) EG(current_execute_data)->opline + 1); } /* }}} */ /* {{{ proto void phpdbg_break_file(string file, integer line) */ @@ -317,11 +315,11 @@ static PHP_FUNCTION(phpdbg_break_file) size_t flen = 0; long line; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &file, &flen, &line) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &file, &flen, &line) == FAILURE) { return; } - phpdbg_set_breakpoint_file(file, line TSRMLS_CC); + phpdbg_set_breakpoint_file(file, line); } /* }}} */ /* {{{ proto void phpdbg_break_method(string class, string method) */ @@ -330,11 +328,11 @@ static PHP_FUNCTION(phpdbg_break_method) char *class = NULL, *method = NULL; size_t clen = 0, mlen = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &class, &clen, &method, &mlen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &class, &clen, &method, &mlen) == FAILURE) { return; } - phpdbg_set_breakpoint_method(class, method TSRMLS_CC); + phpdbg_set_breakpoint_method(class, method); } /* }}} */ /* {{{ proto void phpdbg_break_function(string function) */ @@ -343,11 +341,11 @@ static PHP_FUNCTION(phpdbg_break_function) char *function = NULL; size_t function_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &function, &function_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &function, &function_len) == FAILURE) { return; } - phpdbg_set_breakpoint_symbol(function, function_len TSRMLS_CC); + phpdbg_set_breakpoint_symbol(function, function_len); } /* }}} */ /* {{{ proto void phpdbg_clear(void) @@ -372,7 +370,7 @@ static PHP_FUNCTION(phpdbg_color) char *color = NULL; size_t color_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element, &color, &color_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &element, &color, &color_len) == FAILURE) { return; } @@ -380,7 +378,7 @@ static PHP_FUNCTION(phpdbg_color) case PHPDBG_COLOR_NOTICE: case PHPDBG_COLOR_ERROR: case PHPDBG_COLOR_PROMPT: - phpdbg_set_color_ex(element, color, color_len TSRMLS_CC); + phpdbg_set_color_ex(element, color, color_len); break; default: zend_error(E_ERROR, "phpdbg detected an incorrect color constant"); @@ -393,11 +391,11 @@ static PHP_FUNCTION(phpdbg_prompt) char *prompt = NULL; size_t prompt_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &prompt, &prompt_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &prompt, &prompt_len) == FAILURE) { return; } - phpdbg_set_prompt(prompt TSRMLS_CC); + phpdbg_set_prompt(prompt); } /* }}} */ ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_next_arginfo, 0, 0, 0) @@ -473,18 +471,18 @@ static inline int php_sapi_phpdbg_module_startup(sapi_module_struct *module) /* return SUCCESS; } /* }}} */ -static char* php_sapi_phpdbg_read_cookies(TSRMLS_D) /* {{{ */ +static char* php_sapi_phpdbg_read_cookies(void) /* {{{ */ { return NULL; } /* }}} */ -static int php_sapi_phpdbg_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s TSRMLS_DC) /* {{{ */ +static int php_sapi_phpdbg_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s) /* {{{ */ { return 0; } /* }}} */ -static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */ +static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers) /* {{{ */ { /* We do nothing here, this function is needed to prevent that the fallback * header handling is called. */ @@ -492,12 +490,12 @@ static int php_sapi_phpdbg_send_headers(sapi_headers_struct *sapi_headers TSRMLS } /* }}} */ -static void php_sapi_phpdbg_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) /* {{{ */ +static void php_sapi_phpdbg_send_header(sapi_header_struct *sapi_header, void *server_context) /* {{{ */ { } /* }}} */ -static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ +static void php_sapi_phpdbg_log_message(char *message) /* {{{ */ { /* * We must not request TSRM before being boot @@ -517,13 +515,13 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ case E_USER_ERROR: case E_PARSE: case E_RECOVERABLE_ERROR: { - const char *file_char = zend_get_executed_filename(TSRMLS_C); + const char *file_char = zend_get_executed_filename(); zend_string *file = zend_string_init(file_char, strlen(file_char), 0); - phpdbg_list_file(file, 3, zend_get_executed_lineno(TSRMLS_C) - 1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); + phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); efree(file); do { - switch (phpdbg_interactive(1 TSRMLS_CC)) { + switch (phpdbg_interactive(1)) { case PHPDBG_LEAVE: case PHPDBG_FINISH: case PHPDBG_UNTIL: @@ -539,7 +537,7 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ } /* }}} */ -static int php_sapi_phpdbg_deactivate(TSRMLS_D) /* {{{ */ +static int php_sapi_phpdbg_deactivate(void) /* {{{ */ { if ((PHPDBG_G(flags) & PHPDBG_IS_STOPPING) == PHPDBG_IS_CLEANING) { zend_phpdbg_globals *pg = PHPDBG_G(backup) = calloc(1, sizeof(zend_phpdbg_globals)); @@ -566,41 +564,41 @@ static int php_sapi_phpdbg_deactivate(TSRMLS_D) /* {{{ */ } /* }}} */ -static void php_sapi_phpdbg_register_vars(zval *track_vars_array TSRMLS_DC) /* {{{ */ +static void php_sapi_phpdbg_register_vars(zval *track_vars_array) /* {{{ */ { size_t len; char *docroot = ""; /* In phpdbg mode, we consider the environment to be a part of the server variables */ - php_import_environment_variables(track_vars_array TSRMLS_CC); + php_import_environment_variables(track_vars_array); if (PHPDBG_G(exec)) { len = PHPDBG_G(exec_len); - if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) { - php_register_variable("PHP_SELF", PHPDBG_G(exec), track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) { + php_register_variable("PHP_SELF", PHPDBG_G(exec), track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) { - php_register_variable("SCRIPT_NAME", PHPDBG_G(exec), track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) { + php_register_variable("SCRIPT_NAME", PHPDBG_G(exec), track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) { - php_register_variable("SCRIPT_FILENAME", PHPDBG_G(exec), track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) { + php_register_variable("SCRIPT_FILENAME", PHPDBG_G(exec), track_vars_array); } - if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len TSRMLS_CC)) { - php_register_variable("PATH_TRANSLATED", PHPDBG_G(exec), track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &PHPDBG_G(exec), PHPDBG_G(exec_len), &len)) { + php_register_variable("PATH_TRANSLATED", PHPDBG_G(exec), track_vars_array); } } /* any old docroot will do */ len = 0; - if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len TSRMLS_CC)) { - php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array TSRMLS_CC); + if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len)) { + php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array); } } /* }}} */ -static inline size_t php_sapi_phpdbg_ub_write(const char *message, size_t length TSRMLS_DC) /* {{{ */ +static inline size_t php_sapi_phpdbg_ub_write(const char *message, size_t length) /* {{{ */ { if (PHPDBG_G(socket_fd) != -1 && !(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) { send(PHPDBG_G(socket_fd), message, length, 0); @@ -614,7 +612,7 @@ typedef struct { int fd; } php_stdio_stream_data; -static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) { +static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t count) { php_stdio_stream_data *data = (php_stdio_stream_data*)stream->abstract; while (data->fd >= 0) { @@ -635,25 +633,24 @@ static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t co break; } - return PHPDBG_G(php_stdiop_write)(stream, buf, count TSRMLS_CC); + return PHPDBG_G(php_stdiop_write)(stream, buf, count); } #if PHP_VERSION_ID >= 50700 -static inline void php_sapi_phpdbg_flush(void *context TSRMLS_DC) /* {{{ */ +static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */ { #else static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */ { - TSRMLS_FETCH(); #endif - if (!phpdbg_active_sigsafe_mem(TSRMLS_C)) { + if (!phpdbg_active_sigsafe_mem()) { fflush(PHPDBG_G(io)[PHPDBG_STDOUT].ptr); } } /* }}} */ /* copied from sapi/cli/php_cli.c cli_register_file_handles */ -static void phpdbg_register_file_handles(TSRMLS_D) /* {{{ */ +static void phpdbg_register_file_handles(void) /* {{{ */ { zval zin, zout, zerr; php_stream *s_in, *s_out, *s_err; @@ -685,19 +682,19 @@ static void phpdbg_register_file_handles(TSRMLS_D) /* {{{ */ ic.flags = CONST_CS; ic.name = zend_string_init(ZEND_STRL("STDIN"), 0); ic.module_number = 0; - zend_register_constant(&ic TSRMLS_CC); + zend_register_constant(&ic); oc.value = zout; oc.flags = CONST_CS; oc.name = zend_string_init(ZEND_STRL("STDOUT"), 0); oc.module_number = 0; - zend_register_constant(&oc TSRMLS_CC); + zend_register_constant(&oc); ec.value = zerr; ec.flags = CONST_CS; ec.name = zend_string_init(ZEND_STRL("STDERR"), 0); ec.module_number = 0; - zend_register_constant(&ec TSRMLS_CC); + zend_register_constant(&ec); } /* }}} */ @@ -783,7 +780,7 @@ void phpdbg_ini_defaults(HashTable *configuration_hash) /* {{{ */ INI_DEFAULT("report_zend_debug", "0"); } /* }}} */ -static void phpdbg_welcome(zend_bool cleaning TSRMLS_DC) /* {{{ */ +static void phpdbg_welcome(zend_bool cleaning) /* {{{ */ { /* print blurb */ if (!cleaning) { @@ -811,7 +808,6 @@ static void phpdbg_welcome(zend_bool cleaning TSRMLS_DC) /* {{{ */ static inline void phpdbg_sigint_handler(int signo) /* {{{ */ { - TSRMLS_FETCH(); if (PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE) { /* we quit remote consoles on recv SIGINT */ @@ -825,11 +821,11 @@ static inline void phpdbg_sigint_handler(int signo) /* {{{ */ if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) { char mem[PHPDBG_SIGSAFE_MEM_SIZE + 1]; - phpdbg_set_sigsafe_mem(mem TSRMLS_CC); + phpdbg_set_sigsafe_mem(mem); zend_try { - phpdbg_force_interruption(TSRMLS_C); + phpdbg_force_interruption(); } zend_end_try() - phpdbg_clear_sigsafe_mem(TSRMLS_C); + phpdbg_clear_sigsafe_mem(); return; } PHPDBG_G(flags) |= PHPDBG_IS_SIGNALED; @@ -848,7 +844,7 @@ static void phpdbg_remote_close(int socket, FILE *stream) { } /* don't inline this, want to debug it easily, will inline when done */ -static int phpdbg_remote_init(const char* address, unsigned short port, int server, int *socket, FILE **stream TSRMLS_DC) { +static int phpdbg_remote_init(const char* address, unsigned short port, int server, int *socket, FILE **stream) { phpdbg_remote_close(*socket, *stream); if (server < 0) { @@ -890,7 +886,6 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */ int flags; size_t newlen; size_t i/*, last_nl*/; - TSRMLS_FETCH(); // if (!(info->si_band & POLLIN)) { // return; /* Not interested in writeablility etc., just interested in incoming data */ @@ -914,11 +909,11 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */ break; /* or quit ??? */ } if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) { - phpdbg_set_sigsafe_mem(mem TSRMLS_CC); + phpdbg_set_sigsafe_mem(mem); zend_try { - phpdbg_force_interruption(TSRMLS_C); + phpdbg_force_interruption(); } zend_end_try(); - phpdbg_clear_sigsafe_mem(TSRMLS_C); + phpdbg_clear_sigsafe_mem(); break; } if (!(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) { @@ -941,7 +936,6 @@ void phpdbg_sigio_handler(int sig, siginfo_t *info, void *context) /* {{{ */ void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) /* {{{ */ { int is_handled = FAILURE; - TSRMLS_FETCH(); switch (sig) { case SIGBUS: @@ -949,10 +943,10 @@ void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) /* {{{ */ if (PHPDBG_G(sigsegv_bailout)) { LONGJMP(*PHPDBG_G(sigsegv_bailout), FAILURE); } - is_handled = phpdbg_watchpoint_segfault_handler(info, context TSRMLS_CC); + is_handled = phpdbg_watchpoint_segfault_handler(info, context); if (is_handled == FAILURE) { #ifdef ZEND_SIGNALS - zend_sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL TSRMLS_CC); + zend_sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL); #else sigaction(sig, &PHPDBG_G(old_sigsegv_signal), NULL); #endif @@ -967,10 +961,9 @@ static inline zend_mm_heap *phpdbg_mm_get_heap() /* {{{ */ { zend_mm_heap *mm_heap; - TSRMLS_FETCH(); - mm_heap = zend_mm_set_heap(NULL TSRMLS_CC); - zend_mm_set_heap(mm_heap TSRMLS_CC); + mm_heap = zend_mm_set_heap(NULL); + zend_mm_set_heap(mm_heap); return mm_heap; } /* }}} */ @@ -1205,7 +1198,7 @@ phpdbg_main: PHP_VERSION, get_zend_version() ); - sapi_deactivate(TSRMLS_C); + sapi_deactivate(); sapi_shutdown(); return 0; } break; @@ -1295,8 +1288,8 @@ phpdbg_main: /* setup remote server if necessary */ if (cleaning <= 0 && listen > 0) { - server = phpdbg_open_socket(address, listen TSRMLS_CC); - if (-1 > server || phpdbg_remote_init(address, listen, server, &socket, &stream TSRMLS_CC) == FAILURE) { + server = phpdbg_open_socket(address, listen); + if (-1 > server || phpdbg_remote_init(address, listen, server, &socket, &stream) == FAILURE) { exit(0); } @@ -1321,26 +1314,26 @@ phpdbg_main: _free = phpdbg_free_wrapper; } - zend_activate(TSRMLS_C); + zend_activate(); - phpdbg_init_list(TSRMLS_C); + phpdbg_init_list(); PHPDBG_G(original_free_function) = _free; _free = phpdbg_watch_efree; zend_mm_set_custom_handlers(mm_heap, _malloc, _free, _realloc); - phpdbg_setup_watchpoints(TSRMLS_C); + phpdbg_setup_watchpoints(); #if defined(ZEND_SIGNALS) && !defined(_WIN32) zend_try { - zend_signal_activate(TSRMLS_C); + zend_signal_activate(); } zend_end_try(); #endif #if defined(ZEND_SIGNALS) && !defined(_WIN32) - zend_try { zend_sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal) TSRMLS_CC); } zend_end_try(); - zend_try { zend_sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal) TSRMLS_CC); } zend_end_try(); + zend_try { zend_sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try(); + zend_try { zend_sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); } zend_end_try(); #elif !defined(_WIN32) sigaction(SIGSEGV, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); sigaction(SIGBUS, &signal_struct, &PHPDBG_G(old_sigsegv_signal)); @@ -1348,12 +1341,12 @@ phpdbg_main: PHPDBG_G(sapi_name_ptr) = sapi_name; - php_output_activate(TSRMLS_C); - php_output_deactivate(TSRMLS_C); + php_output_activate(); + php_output_deactivate(); - php_output_activate(TSRMLS_C); + php_output_activate(); - if (php_request_startup(TSRMLS_C) == SUCCESS) { + if (php_request_startup() == SUCCESS) { int i; SG(request_info).argc = argc - php_optind + 1; @@ -1363,7 +1356,7 @@ phpdbg_main: } SG(request_info).argv[i] = exec ? estrdup(exec) : estrdup(""); - php_hash_environment(TSRMLS_C); + php_hash_environment(); } /* do not install sigint handlers for remote consoles */ @@ -1372,7 +1365,7 @@ phpdbg_main: if (listen < 0) { #endif #if defined(ZEND_SIGNALS) && !defined(_WIN32) - zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try(); + zend_try { zend_signal(SIGINT, phpdbg_sigint_handler); } zend_end_try(); #else signal(SIGINT, phpdbg_sigint_handler); #endif @@ -1423,7 +1416,7 @@ phpdbg_main: #endif if (exec) { /* set execution context */ - PHPDBG_G(exec) = phpdbg_resolve_path(exec TSRMLS_CC); + PHPDBG_G(exec) = phpdbg_resolve_path(exec); PHPDBG_G(exec_len) = PHPDBG_G(exec) ? strlen(PHPDBG_G(exec)) : 0; free(exec); @@ -1439,19 +1432,19 @@ phpdbg_main: } /* set default colors */ - phpdbg_set_color_ex(PHPDBG_COLOR_PROMPT, PHPDBG_STRL("white-bold") TSRMLS_CC); - phpdbg_set_color_ex(PHPDBG_COLOR_ERROR, PHPDBG_STRL("red-bold") TSRMLS_CC); - phpdbg_set_color_ex(PHPDBG_COLOR_NOTICE, PHPDBG_STRL("green") TSRMLS_CC); + phpdbg_set_color_ex(PHPDBG_COLOR_PROMPT, PHPDBG_STRL("white-bold")); + phpdbg_set_color_ex(PHPDBG_COLOR_ERROR, PHPDBG_STRL("red-bold")); + phpdbg_set_color_ex(PHPDBG_COLOR_NOTICE, PHPDBG_STRL("green")); /* set default prompt */ - phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT TSRMLS_CC); + phpdbg_set_prompt(PHPDBG_DEFAULT_PROMPT); /* Make stdin, stdout and stderr accessible from PHP scripts */ - phpdbg_register_file_handles(TSRMLS_C); + phpdbg_register_file_handles(); if (show_banner && cleaning < 2) { /* print blurb */ - phpdbg_welcome(cleaning == 1 TSRMLS_CC); + phpdbg_welcome(cleaning == 1); } cleaning = -1; @@ -1459,10 +1452,10 @@ phpdbg_main: /* initialize from file */ PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING; zend_try { - phpdbg_init(init_file, init_file_len, init_file_default TSRMLS_CC); + phpdbg_init(init_file, init_file_len, init_file_default); if (bp_tmp) { PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; - phpdbg_string_init(bp_tmp TSRMLS_CC); + phpdbg_string_init(bp_tmp); free(bp_tmp); bp_tmp = NULL; PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT; @@ -1480,7 +1473,7 @@ phpdbg_main: if (settings) { PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; } - phpdbg_compile(TSRMLS_C); + phpdbg_compile(); PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT; } @@ -1500,7 +1493,7 @@ phpdbg_interact: if (phpdbg_startup_run) { zend_bool quit_immediately = phpdbg_startup_run > 1; phpdbg_startup_run = 0; - PHPDBG_COMMAND_HANDLER(run)(NULL TSRMLS_CC); + PHPDBG_COMMAND_HANDLER(run)(NULL); if (quit_immediately) { /* if -r is on the command line more than once just quit */ EG(bailout) = __orig_bailout; /* reset zend_try */ @@ -1508,12 +1501,12 @@ phpdbg_interact: } } - phpdbg_interactive(1 TSRMLS_CC); + phpdbg_interactive(1); } zend_catch { if ((PHPDBG_G(flags) & PHPDBG_IS_CLEANING)) { char *bp_tmp_str; PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; - phpdbg_export_breakpoints_to_string(&bp_tmp_str TSRMLS_CC); + phpdbg_export_breakpoints_to_string(&bp_tmp_str); PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT; if (bp_tmp_str) { bp_tmp = strdup(bp_tmp_str); @@ -1531,7 +1524,7 @@ phpdbg_interact: if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { /* renegociate connections */ - phpdbg_remote_init(address, listen, server, &socket, &stream TSRMLS_CC); + phpdbg_remote_init(address, listen, server, &socket, &stream); /* set streams */ if (stream) { @@ -1615,8 +1608,8 @@ phpdbg_out: PG(report_memleaks) = 0; if ((PHPDBG_G(flags) & (PHPDBG_IS_CLEANING | PHPDBG_IS_RUNNING)) == PHPDBG_IS_CLEANING) { - php_free_shutdown_functions(TSRMLS_C); - zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC); + php_free_shutdown_functions(); + zend_objects_store_mark_destructed(&EG(objects_store)); } /* sapi_module.deactivate is where to backup things, last chance before mm_shutdown... */ @@ -1634,10 +1627,10 @@ phpdbg_out: settings = PHPDBG_G(backup); } - php_output_deactivate(TSRMLS_C); + php_output_deactivate(); zend_try { - php_module_shutdown(TSRMLS_C); + php_module_shutdown(); } zend_end_try(); sapi_shutdown(); diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h index 60d1239a27..bcf4981edc 100644 --- a/sapi/phpdbg/phpdbg.h +++ b/sapi/phpdbg/phpdbg.h @@ -129,7 +129,7 @@ # include "phpdbg_sigio_win32.h" #endif -int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC); +int phpdbg_do_parse(phpdbg_param_t *stack, char *input); #define PHPDBG_NEXT 2 #define PHPDBG_UNTIL 3 @@ -252,7 +252,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg) int vmret; /* return from last opcode handler execution */ zend_bool in_execution; /* in execution? */ - zend_op_array *(*compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); + zend_op_array *(*compile_file)(zend_file_handle *file_handle, int type); HashTable file_sources; FILE *oplog; /* opline log */ @@ -261,7 +261,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg) int fd; } io[PHPDBG_IO_FDS]; /* io */ int eol; /* type of line ending to use */ - size_t (*php_stdiop_write)(php_stream *, const char *, size_t TSRMLS_DC); + size_t (*php_stdiop_write)(php_stream *, const char *, size_t); int in_script_xml; /* in <stream> output mode */ struct { zend_bool active; diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index cd40510c79..ac5ba34714 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -29,24 +29,24 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); /* {{{ private api functions */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array* TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function* TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array* TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar TSRMLS_DC); -static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data TSRMLS_DC); /* }}} */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array*); +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function*); +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array*); +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t); +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar); +static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data); /* }}} */ /* * Note: * A break point must always set the correct id and type * A set breakpoint function must always map new points */ -static inline void _phpdbg_break_mapping(int id, HashTable *table TSRMLS_DC) +static inline void _phpdbg_break_mapping(int id, HashTable *table) { zend_hash_index_update_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], id, table); } -#define PHPDBG_BREAK_MAPPING(id, table) _phpdbg_break_mapping(id, table TSRMLS_CC) +#define PHPDBG_BREAK_MAPPING(id, table) _phpdbg_break_mapping(id, table) #define PHPDBG_BREAK_UNMAPPING(id) \ zend_hash_index_del(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], (id)) @@ -89,7 +89,7 @@ static void phpdbg_opline_breaks_dtor(zval *data) /* {{{ */ } } /* }}} */ -PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D) /* {{{ */ +PHPDBG_API void phpdbg_reset_breakpoints(void) /* {{{ */ { HashTable *table; @@ -102,14 +102,14 @@ PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D) /* {{{ */ } ZEND_HASH_FOREACH_END(); } /* }}} */ -PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_export_breakpoints(FILE *handle) /* {{{ */ { char *string; - phpdbg_export_breakpoints_to_string(&string TSRMLS_CC); + phpdbg_export_breakpoints_to_string(&string); fputs(string, handle); } -PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str) /* {{{ */ { HashTable *table; zend_ulong id = 0L; @@ -222,7 +222,7 @@ PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC) /* {{{ } } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num) /* {{{ */ { php_stream_statbuf ssb; char realpath[MAXPATHLEN]; @@ -282,7 +282,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRML phpdbg_debug("Compare against loaded %s\n", file); - if (!(pending = ((fileht = phpdbg_resolve_pending_file_break_ex(file->val, file->len, path_str, broken TSRMLS_CC)) == NULL))) { + if (!(pending = ((fileht = phpdbg_resolve_pending_file_break_ex(file->val, file->len, path_str, broken)) == NULL))) { new_break = *(phpdbg_breakfile_t *) zend_hash_index_find_ptr(broken, line_num); break; } @@ -304,7 +304,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRML } } /* }}} */ -PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht TSRMLS_DC) /* {{{ */ +PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht) /* {{{ */ { phpdbg_debug("file: %s, filelen: %u, cur: %s, curlen %u, pos: %c, memcmp: %d\n", file, filelen, cur, curlen, filelen > curlen ? file[filelen - curlen - 1] : '?', filelen > curlen ? memcmp(file + filelen - curlen, cur, curlen) : 0); @@ -345,7 +345,7 @@ PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uin return NULL; } /* }}} */ -PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file) /* {{{ */ { HashTable *fileht; uint filelen = strlen(file); @@ -356,11 +356,11 @@ PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC) /* ZEND_HASH_FOREACH_STR_KEY_PTR(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING], cur, fileht) { phpdbg_debug("check bp: %s\n", cur); - phpdbg_resolve_pending_file_break_ex(file, filelen, cur, fileht TSRMLS_CC); + phpdbg_resolve_pending_file_break_ex(file, filelen, cur, fileht); } ZEND_HASH_FOREACH_END(); } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len) /* {{{ */ { if (!zend_hash_str_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], name, name_len)) { phpdbg_breaksymbol_t new_break; @@ -380,7 +380,7 @@ PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len T } } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char *func_name TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char *func_name) /* {{{ */ { HashTable class_breaks, *class_table; size_t class_len = strlen(class_name); @@ -415,7 +415,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char *class_name, const char efree(lcname); } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline) /* {{{ */ { if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], opline)) { phpdbg_breakline_t new_break; @@ -436,7 +436,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ } } /* }}} */ -PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC) /* {{{ */ +PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array) /* {{{ */ { phpdbg_breakline_t opline_break; if (op_array->last <= brake->opline_num) { @@ -472,7 +472,7 @@ PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_o return SUCCESS; } /* }}} */ -PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array) /* {{{ */ { HashTable *func_table = &PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE]; HashTable *oplines_table; @@ -491,7 +491,7 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC } ZEND_HASH_FOREACH_PTR(oplines_table, brake) { - if (phpdbg_resolve_op_array_break(brake, op_array TSRMLS_CC) == SUCCESS) { + if (phpdbg_resolve_op_array_break(brake, op_array) == SUCCESS) { phpdbg_breakline_t *opline_break; zend_hash_internal_pointer_end(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]); @@ -508,7 +508,7 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC } ZEND_HASH_FOREACH_END(); } /* }}} */ -PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRMLS_DC) /* {{{ */ +PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break) /* {{{ */ { HashTable *func_table = EG(function_table); zend_function *func; @@ -516,7 +516,7 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML if (new_break->func_name == NULL) { if (EG(current_execute_data) == NULL) { if (PHPDBG_G(ops) != NULL && !memcmp(PHPDBG_G(ops)->filename, new_break->class_name, new_break->class_len)) { - if (phpdbg_resolve_op_array_break(new_break, PHPDBG_G(ops) TSRMLS_CC) == SUCCESS) { + if (phpdbg_resolve_op_array_break(new_break, PHPDBG_G(ops)) == SUCCESS) { return SUCCESS; } else { return 2; @@ -528,7 +528,7 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML do { zend_op_array *op_array = &execute_data->func->op_array; if (op_array->function_name == NULL && op_array->scope == NULL && new_break->class_len == op_array->filename->len && !memcmp(op_array->filename->val, new_break->class_name, new_break->class_len)) { - if (phpdbg_resolve_op_array_break(new_break, op_array TSRMLS_CC) == SUCCESS) { + if (phpdbg_resolve_op_array_break(new_break, op_array) == SUCCESS) { return SUCCESS; } else { return 2; @@ -564,14 +564,14 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML return 2; } - if (phpdbg_resolve_op_array_break(new_break, &func->op_array TSRMLS_CC) == FAILURE) { + if (phpdbg_resolve_op_array_break(new_break, &func->op_array) == FAILURE) { return 2; } return SUCCESS; } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline) /* {{{ */ { phpdbg_breakopline_t new_break; HashTable class_breaks, *class_table; @@ -585,7 +585,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const cha new_break.opline_num = opline; new_break.opline = 0; - switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) { + switch (phpdbg_resolve_opline_break(&new_break)) { case FAILURE: phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" method=\"%::%s\" num=\"%ld\"", "Pending breakpoint #%d at %s::%s#%ld", new_break.id, new_break.class_name, new_break.func_name, opline); break; @@ -623,7 +623,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const cha zend_hash_index_update_mem(method_table, opline, &new_break, sizeof(phpdbg_breakopline_t)); } -PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline) /* {{{ */ { phpdbg_breakopline_t new_break; HashTable func_breaks, *func_table; @@ -636,7 +636,7 @@ PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend new_break.opline_num = opline; new_break.opline = 0; - switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) { + switch (phpdbg_resolve_opline_break(&new_break)) { case FAILURE: phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" function=\"%s\" num=\"%ld\"", "Pending breakpoint #%d at %s#%ld", new_break.id, new_break.func_name, opline); break; @@ -668,7 +668,7 @@ PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend zend_hash_index_update_mem(func_table, opline, &new_break, sizeof(phpdbg_breakopline_t)); } -PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline) /* {{{ */ { phpdbg_breakopline_t new_break; HashTable file_breaks, *file_table; @@ -681,7 +681,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong o new_break.opline_num = opline; new_break.opline = 0; - switch (phpdbg_resolve_opline_break(&new_break TSRMLS_CC)) { + switch (phpdbg_resolve_opline_break(&new_break)) { case FAILURE: phpdbg_notice("breakpoint", "pending=\"pending\" id=\"%d\" file=\"%s\" num=\"%ld\"", "Pending breakpoint #%d at %s:%ld", new_break.id, new_break.class_name, opline); break; @@ -713,7 +713,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong o zend_hash_index_update_mem(file_table, opline, &new_break, sizeof(phpdbg_breakopline_t)); } -PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len) /* {{{ */ { phpdbg_breakop_t new_break; zend_ulong hash = zend_hash_func(name, name_len); @@ -735,7 +735,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len T PHPDBG_BREAK_MAPPING(new_break.id, &PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE]); } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline) /* {{{ */ { if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline)) { phpdbg_breakline_t new_break; @@ -754,7 +754,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRML } } /* }}} */ -static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, const phpdbg_param_t *param, const char *expr, size_t expr_len, zend_ulong hash TSRMLS_DC) /* {{{ */ +static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, const phpdbg_param_t *param, const char *expr, size_t expr_len, zend_ulong hash) /* {{{ */ { phpdbg_breakcond_t new_break; uint32_t cops = CG(compiler_options); @@ -766,7 +766,7 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co if (param) { new_break.paramed = 1; phpdbg_copy_param( - param, &new_break.param TSRMLS_CC); + param, &new_break.param); } else { new_break.paramed = 0; } @@ -785,7 +785,7 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0'; Z_TYPE_INFO(pv) = IS_STRING; - new_break.ops = zend_compile_string(&pv, "Conditional Breakpoint Code" TSRMLS_CC); + new_break.ops = zend_compile_string(&pv, "Conditional Breakpoint Code"); zval_dtor(&pv); @@ -805,20 +805,20 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co CG(compiler_options) = cops; } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_expression(const char *expr, size_t expr_len TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_expression(const char *expr, size_t expr_len) /* {{{ */ { zend_ulong expr_hash = zend_inline_hash_func(expr, expr_len); phpdbg_breakcond_t new_break; if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], expr_hash)) { phpdbg_create_conditional_break( - &new_break, NULL, expr, expr_len, expr_hash TSRMLS_CC); + &new_break, NULL, expr, expr_len, expr_hash); } else { phpdbg_error("breakpoint", "type=\"exists\" expression=\"%s\"", "Conditional break %s exists", expr); } } /* }}} */ -PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param) /* {{{ */ { phpdbg_breakcond_t new_break; phpdbg_param_t *condition; @@ -829,7 +829,7 @@ PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC) hash = zend_inline_hash_func(condition->str, condition->len); if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], hash)) { - phpdbg_create_conditional_break(&new_break, param, condition->str, condition->len, hash TSRMLS_CC); + phpdbg_create_conditional_break(&new_break, param, condition->str, condition->len, hash); } else { phpdbg_notice("breakpoint", "type=\"exists\" arg=\"%s\"", "Conditional break %s exists at the specified location", condition->str); } @@ -837,7 +837,7 @@ PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC) } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_array TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_array) /* {{{ */ { HashTable *breaks; phpdbg_breakbase_t *brake; @@ -866,7 +866,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array *op_ return NULL; } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *fbc TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *fbc) /* {{{ */ { const char *fname; size_t flen; @@ -880,7 +880,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *f if (ops->scope) { /* find method breaks here */ - return phpdbg_find_breakpoint_method(ops TSRMLS_CC); + return phpdbg_find_breakpoint_method(ops); } if (ops->function_name) { @@ -894,7 +894,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_symbol(zend_function *f return zend_hash_str_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], fname, flen); } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *ops TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *ops) /* {{{ */ { HashTable *class_table; phpdbg_breakbase_t *brake = NULL; @@ -911,7 +911,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_method(zend_op_array *o return brake; } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t opline) /* {{{ */ { phpdbg_breakline_t *brake; @@ -922,7 +922,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_pt return (phpdbg_breakbase_t *) brake; } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcode TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcode) /* {{{ */ { const char *opname = phpdbg_decode_opcode(opcode); @@ -933,7 +933,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcod return zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], zend_hash_func(opname, strlen(opname))); } /* }}} */ -static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ +static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_execute_data *execute_data) /* {{{ */ { zend_function *function = execute_data->func; @@ -960,8 +960,8 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend } break; case FILE_PARAM: { - if (param->file.line == zend_get_executed_lineno(TSRMLS_C)) { - const char *str = zend_get_executed_filename(TSRMLS_C); + if (param->file.line == zend_get_executed_lineno()) { + const char *str = zend_get_executed_filename(); size_t lengths[2] = {strlen(param->file.name), strlen(str)}; if (lengths[0] == lengths[1]) { @@ -1005,7 +1005,7 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend return 0; } /* }}} */ -static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ +static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execute_data *execute_data) /* {{{ */ { phpdbg_breakcond_t *bp; int breakpoint = FAILURE; @@ -1021,20 +1021,20 @@ static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execut } if (bp->paramed) { - if (!phpdbg_find_breakpoint_param(&bp->param, execute_data TSRMLS_CC)) { + if (!phpdbg_find_breakpoint_param(&bp->param, execute_data)) { continue; } } EG(no_extensions) = 1; - zend_rebuild_symbol_table(TSRMLS_C); + zend_rebuild_symbol_table(); zend_try { PHPDBG_G(flags) |= PHPDBG_IN_COND_BP; - zend_execute(bp->ops, &retval TSRMLS_CC); + zend_execute(bp->ops, &retval); #if PHP_VERSION_ID >= 50700 - if (zend_is_true(&retval TSRMLS_CC)) { + if (zend_is_true(&retval)) { #else if (zend_is_true(&retval)) { #endif @@ -1056,7 +1056,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execut return (breakpoint == SUCCESS) ? ((phpdbg_breakbase_t *) bp) : NULL; } /* }}} */ -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute_data) /* {{{ */ { phpdbg_breakbase_t *base = NULL; @@ -1067,28 +1067,28 @@ PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakpoint(zend_execute_data *execute /* conditions cannot be executed by eval()'d code */ if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL) && (PHPDBG_G(flags) & PHPDBG_HAS_COND_BP) && - (base = phpdbg_find_conditional_breakpoint(execute_data TSRMLS_CC))) { + (base = phpdbg_find_conditional_breakpoint(execute_data))) { goto result; } - if ((PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP) && (base = phpdbg_find_breakpoint_file(&execute_data->func->op_array TSRMLS_CC))) { + if ((PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP) && (base = phpdbg_find_breakpoint_file(&execute_data->func->op_array))) { goto result; } if (PHPDBG_G(flags) & (PHPDBG_HAS_METHOD_BP|PHPDBG_HAS_SYM_BP)) { /* check we are at the beginning of the stack */ if (execute_data->opline == execute_data->func->op_array.opcodes) { - if ((base = phpdbg_find_breakpoint_symbol(execute_data->func TSRMLS_CC))) { + if ((base = phpdbg_find_breakpoint_symbol(execute_data->func))) { goto result; } } } - if ((PHPDBG_G(flags) & PHPDBG_HAS_OPLINE_BP) && (base = phpdbg_find_breakpoint_opline((phpdbg_opline_ptr_t) execute_data->opline TSRMLS_CC))) { + if ((PHPDBG_G(flags) & PHPDBG_HAS_OPLINE_BP) && (base = phpdbg_find_breakpoint_opline((phpdbg_opline_ptr_t) execute_data->opline))) { goto result; } - if ((PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) && (base = phpdbg_find_breakpoint_opcode(execute_data->opline->opcode TSRMLS_CC))) { + if ((PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) && (base = phpdbg_find_breakpoint_opcode(execute_data->opline->opcode))) { goto result; } @@ -1103,14 +1103,14 @@ result: return base; } /* }}} */ -PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num) /* {{{ */ { HashTable *table; phpdbg_breakbase_t *brake; zend_string *strkey; zend_ulong numkey; - if ((brake = phpdbg_find_breakbase_ex(num, &table, &numkey, &strkey TSRMLS_CC))) { + if ((brake = phpdbg_find_breakbase_ex(num, &table, &numkey, &strkey))) { int type = brake->type; char *name = NULL; size_t name_len = 0L; @@ -1167,7 +1167,7 @@ PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */ } } /* }}} */ -PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */ +PHPDBG_API void phpdbg_clear_breakpoints(void) /* {{{ */ { zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]); zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING]); @@ -1186,16 +1186,16 @@ PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */ PHPDBG_G(bp_count) = 0; } /* }}} */ -PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t *brake, zend_bool output TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t *brake, zend_bool output) /* {{{ */ { brake->hits++; if (output) { - phpdbg_print_breakpoint(brake TSRMLS_CC); + phpdbg_print_breakpoint(brake); } } /* }}} */ -PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake) /* {{{ */ { if (!brake) goto unknown; @@ -1213,8 +1213,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" function=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %s() at %s:%u, hits: %lu", ((phpdbg_breaksymbol_t*)brake)->id, ((phpdbg_breaksymbol_t*)brake)->symbol, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakfile_t*)brake)->hits); } break; @@ -1222,8 +1222,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" opline=\"%#lx\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %#lx at %s:%u, hits: %lu", ((phpdbg_breakline_t*)brake)->id, ((phpdbg_breakline_t*)brake)->opline, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakline_t*)brake)->hits); } break; @@ -1233,8 +1233,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* ((phpdbg_breakopline_t*)brake)->class_name, ((phpdbg_breakopline_t*)brake)->func_name, ((phpdbg_breakopline_t*)brake)->opline_num, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakopline_t*)brake)->hits); } break; @@ -1243,8 +1243,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* ((phpdbg_breakopline_t*)brake)->id, ((phpdbg_breakopline_t*)brake)->func_name, ((phpdbg_breakopline_t*)brake)->opline_num, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakopline_t*)brake)->hits); } break; @@ -1252,8 +1252,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" num=\"%lu\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in #%lu at %s:%u, hits: %lu", ((phpdbg_breakopline_t*)brake)->id, ((phpdbg_breakopline_t*)brake)->opline_num, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakopline_t*)brake)->hits); } break; @@ -1261,8 +1261,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" opcode=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Breakpoint #%d in %s at %s:%u, hits: %lu", ((phpdbg_breakop_t*)brake)->id, ((phpdbg_breakop_t*)brake)->name, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakop_t*)brake)->hits); } break; @@ -1271,8 +1271,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* ((phpdbg_breakmethod_t*)brake)->id, ((phpdbg_breakmethod_t*)brake)->class_name, ((phpdbg_breakmethod_t*)brake)->func_name, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakmethod_t*)brake)->hits); } break; @@ -1281,10 +1281,10 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* char *param; phpdbg_notice("breakpoint", "id=\"%d\" location=\"%s\" eval=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Conditional breakpoint #%d: at %s if %s at %s:%u, hits: %lu", ((phpdbg_breakcond_t*)brake)->id, - phpdbg_param_tostring(&((phpdbg_breakcond_t*)brake)->param, ¶m TSRMLS_CC), + phpdbg_param_tostring(&((phpdbg_breakcond_t*)brake)->param, ¶m), ((phpdbg_breakcond_t*)brake)->code, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakcond_t*)brake)->hits); if (param) free(param); @@ -1292,8 +1292,8 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* phpdbg_notice("breakpoint", "id=\"%d\" eval=\"%s\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Conditional breakpoint #%d: on %s == true at %s:%u, hits: %lu", ((phpdbg_breakcond_t*)brake)->id, ((phpdbg_breakcond_t*)brake)->code, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C), + zend_get_executed_filename(), + zend_get_executed_lineno(), ((phpdbg_breakcond_t*)brake)->hits); } @@ -1302,49 +1302,49 @@ PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t *brake TSRMLS_DC) /* default: { unknown: phpdbg_notice("breakpoint", "id=\"\" file=\"%s\" line=\"%ld\" hits=\"%lu\"", "Unknown breakpoint at %s:%u", - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C)); + zend_get_executed_filename(), + zend_get_executed_lineno()); } } } /* }}} */ -PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id) /* {{{ */ { - phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id TSRMLS_CC); + phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id); if (brake) { brake->disabled = 0; } } /* }}} */ -PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id) /* {{{ */ { - phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id TSRMLS_CC); + phpdbg_breakbase_t *brake = phpdbg_find_breakbase(id); if (brake) { brake->disabled = 1; } } /* }}} */ -PHPDBG_API void phpdbg_enable_breakpoints(TSRMLS_D) /* {{{ */ +PHPDBG_API void phpdbg_enable_breakpoints(void) /* {{{ */ { PHPDBG_G(flags) |= PHPDBG_IS_BP_ENABLED; } /* }}} */ -PHPDBG_API void phpdbg_disable_breakpoints(TSRMLS_D) { /* {{{ */ +PHPDBG_API void phpdbg_disable_breakpoints(void) { /* {{{ */ PHPDBG_G(flags) &= ~PHPDBG_IS_BP_ENABLED; } /* }}} */ -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id TSRMLS_DC) /* {{{ */ +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id) /* {{{ */ { HashTable *table; zend_string *strkey; zend_ulong numkey; - return phpdbg_find_breakbase_ex(id, &table, &numkey, &strkey TSRMLS_CC); + return phpdbg_find_breakbase_ex(id, &table, &numkey, &strkey); } /* }}} */ -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey TSRMLS_DC) /* {{{ */ +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey) /* {{{ */ { if ((*table = zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], id))) { phpdbg_breakbase_t *brake; @@ -1359,7 +1359,7 @@ PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable return NULL; } /* }}} */ -PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type) /* {{{ */ { phpdbg_xml("<breakpoints %r>"); diff --git a/sapi/phpdbg/phpdbg_bp.h b/sapi/phpdbg/phpdbg_bp.h index 99c4eb6011..a1fafbab7b 100644 --- a/sapi/phpdbg/phpdbg_bp.h +++ b/sapi/phpdbg/phpdbg_bp.h @@ -118,46 +118,46 @@ typedef struct _phpdbg_breakcond_t { } phpdbg_breakcond_t; /* {{{ Resolving breaks API */ -PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC); -PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC); -PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRMLS_DC); -PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht TSRMLS_DC); -PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file TSRMLS_DC); /* }}} */ +PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array); +PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array); +PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break); +PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht); +PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file); /* }}} */ /* {{{ Breakpoint Creation API */ -PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, long lineno TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_symbol(const char* func_name, size_t func_name_len TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_opcode(const char* opname, size_t opname_len TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_expression(const char* expression, size_t expression_len TSRMLS_DC); -PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param TSRMLS_DC); /* }}} */ +PHPDBG_API void phpdbg_set_breakpoint_file(const char* filename, long lineno); +PHPDBG_API void phpdbg_set_breakpoint_symbol(const char* func_name, size_t func_name_len); +PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name); +PHPDBG_API void phpdbg_set_breakpoint_opcode(const char* opname, size_t opname_len); +PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline); +PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline); +PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const char *method, zend_ulong opline); +PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, zend_ulong opline); +PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, zend_ulong opline); +PHPDBG_API void phpdbg_set_breakpoint_expression(const char* expression, size_t expression_len); +PHPDBG_API void phpdbg_set_breakpoint_at(const phpdbg_param_t *param); /* }}} */ /* {{{ Breakpoint Detection API */ -PHPDBG_API phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data* TSRMLS_DC); /* }}} */ +PHPDBG_API phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data*); /* }}} */ /* {{{ Misc Breakpoint API */ -PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output TSRMLS_DC); -PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC); -PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake TSRMLS_DC); -PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D); -PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D); -PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC); -PHPDBG_API void phpdbg_enable_breakpoints(TSRMLS_D); -PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id TSRMLS_DC); -PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id TSRMLS_DC); -PHPDBG_API void phpdbg_disable_breakpoints(TSRMLS_D); /* }}} */ +PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output); +PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type); +PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake); +PHPDBG_API void phpdbg_reset_breakpoints(void); +PHPDBG_API void phpdbg_clear_breakpoints(void); +PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num); +PHPDBG_API void phpdbg_enable_breakpoints(void); +PHPDBG_API void phpdbg_enable_breakpoint(zend_ulong id); +PHPDBG_API void phpdbg_disable_breakpoint(zend_ulong id); +PHPDBG_API void phpdbg_disable_breakpoints(void); /* }}} */ /* {{{ Breakbase API */ -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id TSRMLS_DC); -PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey TSRMLS_DC); /* }}} */ +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase(zend_ulong id); +PHPDBG_API phpdbg_breakbase_t *phpdbg_find_breakbase_ex(zend_ulong id, HashTable **table, zend_ulong *numkey, zend_string **strkey); /* }}} */ /* {{{ Breakpoint Exportation API */ -PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC); -PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str TSRMLS_DC); /* }}} */ +PHPDBG_API void phpdbg_export_breakpoints(FILE *handle); +PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str); /* }}} */ #endif /* PHPDBG_BP_H */ diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c index 386d4d9562..258c492155 100644 --- a/sapi/phpdbg/phpdbg_break.c +++ b/sapi/phpdbg/phpdbg_break.c @@ -42,14 +42,14 @@ const phpdbg_command_t phpdbg_break_commands[] = { PHPDBG_BREAK(at) /* {{{ */ { - phpdbg_set_breakpoint_at(param TSRMLS_CC); + phpdbg_set_breakpoint_at(param); return SUCCESS; } /* }}} */ PHPDBG_BREAK(del) /* {{{ */ { - phpdbg_delete_breakpoint(param->num TSRMLS_CC); + phpdbg_delete_breakpoint(param->num); return SUCCESS; } /* }}} */ diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c index 5c74adfdcd..d2196040db 100644 --- a/sapi/phpdbg/phpdbg_cmd.c +++ b/sapi/phpdbg/phpdbg_cmd.c @@ -44,7 +44,7 @@ static inline const char *phpdbg_command_name(const phpdbg_command_t *command, c return buffer; } -PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */ +PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param) /* {{{ */ { switch (param->type) { case STACK_PARAM: @@ -70,7 +70,7 @@ PHPDBG_API const char *phpdbg_get_param_type(const phpdbg_param_t *param TSRMLS_ } } -PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param) /* {{{ */ { if (param) { switch (param->type) { @@ -91,7 +91,7 @@ PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param TSRMLS_DC) /* {{{ */ } /* }}} */ -PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer TSRMLS_DC) /* {{{ */ +PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer) /* {{{ */ { switch (param->type) { case STR_PARAM: @@ -133,7 +133,7 @@ PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **point return *pointer; } /* }}} */ -PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* dest TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* dest) /* {{{ */ { switch ((dest->type = src->type)) { case STACK_PARAM: @@ -191,7 +191,7 @@ PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t* src, phpdbg_param_t* des } } /* }}} */ -PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param TSRMLS_DC) /* {{{ */ +PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param) /* {{{ */ { zend_ulong hash = param->type; @@ -246,7 +246,7 @@ PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param TSRMLS_DC) / return hash; } /* }}} */ -PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r TSRMLS_DC) /* {{{ */ +PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r) /* {{{ */ { if (l && r) { if (l->type == r->type) { @@ -446,7 +446,7 @@ PHPDBG_API void phpdbg_stack_push(phpdbg_param_t *stack, phpdbg_param_t *param) stack->len++; } /* }}} */ -PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack TSRMLS_DC) { +PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack) { if (command) { char buffer[128] = {0,}; const phpdbg_param_t *top = (stack != NULL) ? *stack : NULL; @@ -492,7 +492,7 @@ PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param phpdbg_error("command", "type=\"wrongarg\" command=\"%s\" expected=\"%s\" got=\"%s\" num=\"%lu\"", "The command \"%s\" expected %s and got %s at parameter %lu", \ phpdbg_command_name(command, buffer), \ (e),\ - phpdbg_get_param_type((a) TSRMLS_CC), \ + phpdbg_get_param_type((a)), \ current); \ return FAILURE; \ } @@ -544,7 +544,7 @@ PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param } /* {{{ */ -PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top TSRMLS_DC) { +PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top) { const phpdbg_command_t *command = commands; phpdbg_param_t *name = *top; const phpdbg_command_t *matched[3] = {NULL, NULL, NULL}; @@ -628,7 +628,7 @@ PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t * } if (command->subs && (*top) && ((*top)->type == STR_PARAM)) { - return phpdbg_stack_resolve(command->subs, command, top TSRMLS_CC); + return phpdbg_stack_resolve(command->subs, command, top); } else { return command; } @@ -637,7 +637,7 @@ PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t * } /* }}} */ /* {{{ */ -PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe TSRMLS_DC) { +PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe) { phpdbg_param_t *top = NULL; const phpdbg_command_t *handler = NULL; @@ -655,29 +655,29 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async switch (top->type) { case EVAL_PARAM: - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); - return PHPDBG_COMMAND_HANDLER(ev)(top TSRMLS_CC); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); + return PHPDBG_COMMAND_HANDLER(ev)(top); case RUN_PARAM: if (!allow_async_unsafe) { phpdbg_error("signalsegv", "command=\"run\"", "run command is disallowed during hard interrupt"); } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); - return PHPDBG_COMMAND_HANDLER(run)(top TSRMLS_CC); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); + return PHPDBG_COMMAND_HANDLER(run)(top); case SHELL_PARAM: if (!allow_async_unsafe) { phpdbg_error("signalsegv", "command=\"sh\"", "sh command is disallowed during hard interrupt"); return FAILURE; } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); - return PHPDBG_COMMAND_HANDLER(sh)(top TSRMLS_CC); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); + return PHPDBG_COMMAND_HANDLER(sh)(top); case STR_PARAM: { - handler = phpdbg_stack_resolve(phpdbg_prompt_commands, NULL, &top TSRMLS_CC); + handler = phpdbg_stack_resolve(phpdbg_prompt_commands, NULL, &top); if (handler) { if (!allow_async_unsafe && !(handler->flags & PHPDBG_ASYNC_SAFE)) { @@ -685,10 +685,10 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async return FAILURE; } - if (phpdbg_stack_verify(handler, &top TSRMLS_CC) == SUCCESS) { - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); - return handler->handler(top TSRMLS_CC); + if (phpdbg_stack_verify(handler, &top) == SUCCESS) { + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); + return handler->handler(top); } } } return FAILURE; @@ -701,14 +701,14 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async return SUCCESS; } /* }}} */ -PHPDBG_API char *phpdbg_read_input(char *buffered TSRMLS_DC) /* {{{ */ +PHPDBG_API char *phpdbg_read_input(char *buffered) /* {{{ */ { char buf[PHPDBG_MAX_CMD]; char *cmd = NULL; char *buffer = NULL; if ((PHPDBG_G(flags) & (PHPDBG_IS_STOPPING | PHPDBG_IS_RUNNING)) != PHPDBG_IS_STOPPING) { - if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && (buffered == NULL) && !phpdbg_active_sigsafe_mem(TSRMLS_C)) { + if ((PHPDBG_G(flags) & PHPDBG_IS_REMOTE) && (buffered == NULL) && !phpdbg_active_sigsafe_mem()) { fflush(PHPDBG_G(io)[PHPDBG_STDOUT].ptr); } @@ -720,12 +720,12 @@ readline: if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) #endif { - phpdbg_write("prompt", "", "%s", phpdbg_get_prompt(TSRMLS_C)); - phpdbg_consume_stdin_line(cmd = buf TSRMLS_CC); + phpdbg_write("prompt", "", "%s", phpdbg_get_prompt()); + phpdbg_consume_stdin_line(cmd = buf); } #if USE_LIB_STAR else { - cmd = readline(phpdbg_get_prompt(TSRMLS_C)); + cmd = readline(phpdbg_get_prompt()); PHPDBG_G(last_was_newline) = 1; } @@ -774,19 +774,19 @@ readline: return buffer; } /* }}} */ -PHPDBG_API void phpdbg_destroy_input(char **input TSRMLS_DC) /*{{{ */ +PHPDBG_API void phpdbg_destroy_input(char **input) /*{{{ */ { efree(*input); } /* }}} */ -PHPDBG_API int phpdbg_ask_user_permission(const char *question TSRMLS_DC) { +PHPDBG_API int phpdbg_ask_user_permission(const char *question) { if (!(PHPDBG_G(flags) & PHPDBG_WRITE_XML)) { char buf[PHPDBG_MAX_CMD]; phpdbg_out("%s", question); phpdbg_out(" (type y or n): "); while (1) { - phpdbg_consume_stdin_line(buf TSRMLS_CC); + phpdbg_consume_stdin_line(buf); if (buf[1] == '\n' && (buf[0] == 'y' || buf[0] == 'n')) { if (buf[0] == 'y') { return SUCCESS; diff --git a/sapi/phpdbg/phpdbg_cmd.h b/sapi/phpdbg/phpdbg_cmd.h index a79641c080..9589c3644b 100644 --- a/sapi/phpdbg/phpdbg_cmd.h +++ b/sapi/phpdbg/phpdbg_cmd.h @@ -88,7 +88,7 @@ struct _phpdbg_param { #define PHPDBG_ASYNC_SAFE 1 -typedef int (*phpdbg_command_handler_t)(const phpdbg_param_t* TSRMLS_DC); +typedef int (*phpdbg_command_handler_t)(const phpdbg_param_t*); typedef struct _phpdbg_command_t phpdbg_command_t; struct _phpdbg_command_t { @@ -129,28 +129,28 @@ typedef struct { /* * Input Management */ -PHPDBG_API char* phpdbg_read_input(char *buffered TSRMLS_DC); -PHPDBG_API void phpdbg_destroy_input(char** TSRMLS_DC); -PHPDBG_API int phpdbg_ask_user_permission(const char *question TSRMLS_DC); +PHPDBG_API char* phpdbg_read_input(char *buffered); +PHPDBG_API void phpdbg_destroy_input(char**); +PHPDBG_API int phpdbg_ask_user_permission(const char *question); /** * Stack Management */ PHPDBG_API void phpdbg_stack_push(phpdbg_param_t *stack, phpdbg_param_t *param); -PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top TSRMLS_DC); -PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack TSRMLS_DC); -PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe TSRMLS_DC); +PHPDBG_API const phpdbg_command_t *phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top); +PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack); +PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, zend_bool allow_async_unsafe); PHPDBG_API void phpdbg_stack_free(phpdbg_param_t *stack); /* * Parameter Management */ -PHPDBG_API void phpdbg_clear_param(phpdbg_param_t* TSRMLS_DC); -PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t*, phpdbg_param_t* TSRMLS_DC); -PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t * TSRMLS_DC); -PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t * TSRMLS_DC); -PHPDBG_API const char* phpdbg_get_param_type(const phpdbg_param_t* TSRMLS_DC); -PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer TSRMLS_DC); +PHPDBG_API void phpdbg_clear_param(phpdbg_param_t*); +PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t*, phpdbg_param_t*); +PHPDBG_API zend_bool phpdbg_match_param(const phpdbg_param_t *, const phpdbg_param_t *); +PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *); +PHPDBG_API const char* phpdbg_get_param_type(const phpdbg_param_t*); +PHPDBG_API char* phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer); PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg); /** @@ -167,7 +167,7 @@ PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg) #define PHPDBG_COMMAND_D(name, tip, alias, children, args, flags) \ {PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, phpdbg_do_##name, children, args, NULL, flags} -#define PHPDBG_COMMAND(name) int phpdbg_do_##name(const phpdbg_param_t *param TSRMLS_DC) +#define PHPDBG_COMMAND(name) int phpdbg_do_##name(const phpdbg_param_t *param) #define PHPDBG_COMMAND_ARGS param TSRMLS_CC @@ -178,7 +178,7 @@ PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg) */ #define phpdbg_default_switch_case() \ default: \ - phpdbg_error("command", "type=\"wrongarg\" got=\"%s\"", "Unsupported parameter type (%s) for command", phpdbg_get_param_type(param TSRMLS_CC)); \ + phpdbg_error("command", "type=\"wrongarg\" got=\"%s\"", "Unsupported parameter type (%s) for command", phpdbg_get_param_type(param)); \ break #endif /* PHPDBG_CMD_H */ diff --git a/sapi/phpdbg/phpdbg_eol.c b/sapi/phpdbg/phpdbg_eol.c index fc20d567bc..47643aae8d 100644 --- a/sapi/phpdbg/phpdbg_eol.c +++ b/sapi/phpdbg/phpdbg_eol.c @@ -33,7 +33,7 @@ struct phpdbg_eol_rep phpdbg_eol_list[EOL_LIST_LEN] = { {"CR", "\r", PHPDBG_EOL_CR}, }; -int phpdbg_eol_global_update(char *name TSRMLS_DC) +int phpdbg_eol_global_update(char *name) { if (0 == memcmp(name, "CRLF", 4) || 0 == memcmp(name, "crlf", 4) || 0 == memcmp(name, "DOS", 3) || 0 == memcmp(name, "dos", 3)) { @@ -83,7 +83,7 @@ char *phpdbg_eol_rep(int id) /* Inspired by https://ccrma.stanford.edu/~craig/utility/flip/flip.cpp */ -void phpdbg_eol_convert(char **str, int *len TSRMLS_DC) +void phpdbg_eol_convert(char **str, int *len) { char *in = *str, *out ; int in_len = *len, out_len, cursor, i; diff --git a/sapi/phpdbg/phpdbg_eol.h b/sapi/phpdbg/phpdbg_eol.h index 68b54cbe34..0b041b3fdf 100644 --- a/sapi/phpdbg/phpdbg_eol.h +++ b/sapi/phpdbg/phpdbg_eol.h @@ -34,13 +34,13 @@ enum { PHPDBG_EOL_CR /* MAC */ }; -int phpdbg_eol_global_update(char *name TSRMLS_DC); +int phpdbg_eol_global_update(char *name); char *phpdbg_eol_name(int id); char *phpdbg_eol_rep(int id); -void phpdbg_eol_convert(char **str, int *len TSRMLS_DC); +void phpdbg_eol_convert(char **str, int *len); #endif /* PHPDBG_EOL_H */ diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c index c9ba377d95..08e5874eb8 100644 --- a/sapi/phpdbg/phpdbg_frame.c +++ b/sapi/phpdbg/phpdbg_frame.c @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -void phpdbg_restore_frame(TSRMLS_D) /* {{{ */ +void phpdbg_restore_frame(void) /* {{{ */ { if (PHPDBG_FRAME(num) == 0) { return; @@ -40,7 +40,7 @@ void phpdbg_restore_frame(TSRMLS_D) /* {{{ */ EG(scope) = PHPDBG_EX(func)->op_array.scope; } /* }}} */ -void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */ +void phpdbg_switch_frame(int frame) /* {{{ */ { zend_execute_data *execute_data = PHPDBG_FRAME(num)?PHPDBG_FRAME(execute_data):EG(current_execute_data); int i = 0; @@ -70,7 +70,7 @@ void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */ return; } - phpdbg_restore_frame(TSRMLS_C); + phpdbg_restore_frame(); if (frame > 0) { PHPDBG_FRAME(num) = frame; @@ -85,14 +85,14 @@ void phpdbg_switch_frame(int frame TSRMLS_DC) /* {{{ */ phpdbg_notice("frame", "id=\"%d\"", "Switched to frame #%d", frame); { - const char *file_chr = zend_get_executed_filename(TSRMLS_C); + const char *file_chr = zend_get_executed_filename(); zend_string *file = zend_string_init(file_chr, strlen(file_chr), 0); - phpdbg_list_file(file, 3, zend_get_executed_lineno(TSRMLS_C) - 1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); + phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); efree(file); } } /* }}} */ -static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */ +static void phpdbg_dump_prototype(zval *tmp) /* {{{ */ { zval *funcname, *class, class_zv, *type, *args, *argstmp; @@ -129,7 +129,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */ phpdbg_try_access { /* assuming no autoloader call is necessary, class should have been loaded if it's in backtrace ... */ - if ((func = phpdbg_get_function(Z_STRVAL_P(funcname), class ? Z_STRVAL_P(class) : NULL TSRMLS_CC))) { + if ((func = phpdbg_get_function(Z_STRVAL_P(funcname), class ? Z_STRVAL_P(class) : NULL))) { arginfo = func->common.arg_info; } } phpdbg_end_try_access(); @@ -153,7 +153,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */ } ++j; - zend_print_flat_zval_r(argstmp TSRMLS_CC); + zend_print_flat_zval_r(argstmp); phpdbg_xml("</arg>"); } ZEND_HASH_FOREACH_END(); @@ -166,7 +166,7 @@ static void phpdbg_dump_prototype(zval *tmp TSRMLS_DC) /* {{{ */ phpdbg_out(")"); } -void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */ +void phpdbg_dump_backtrace(size_t num) /* {{{ */ { HashPosition position; zval zbacktrace; @@ -184,7 +184,7 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */ } phpdbg_try_access { - zend_fetch_debug_backtrace(&zbacktrace, 0, 0, limit TSRMLS_CC); + zend_fetch_debug_backtrace(&zbacktrace, 0, 0, limit); } phpdbg_catch_access { phpdbg_error("signalsegv", "", "Couldn't fetch backtrace, invalid data source"); return; @@ -207,13 +207,13 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */ if (file) { /* userland */ phpdbg_out("frame #%d: ", i); phpdbg_xml("<frame %r id=\"%d\" file=\"%s\" line=\"%d\"", i, Z_STRVAL_P(file), Z_LVAL_P(line)); - phpdbg_dump_prototype(tmp TSRMLS_CC); + phpdbg_dump_prototype(tmp); phpdbg_out(" at %s:%ld\n", Z_STRVAL_P(file), Z_LVAL_P(line)); i++; } else { phpdbg_out(" => "); phpdbg_xml("<frame %r id=\"%d\" internal=\"internal\"", i); - phpdbg_dump_prototype(tmp TSRMLS_CC); + phpdbg_dump_prototype(tmp); phpdbg_out(" (internal function)\n"); } } diff --git a/sapi/phpdbg/phpdbg_frame.h b/sapi/phpdbg/phpdbg_frame.h index 7c4574ed28..63c838fb91 100644 --- a/sapi/phpdbg/phpdbg_frame.h +++ b/sapi/phpdbg/phpdbg_frame.h @@ -23,8 +23,8 @@ #include "TSRM.h" -void phpdbg_restore_frame(TSRMLS_D); -void phpdbg_switch_frame(int TSRMLS_DC); -void phpdbg_dump_backtrace(size_t TSRMLS_DC); +void phpdbg_restore_frame(void); +void phpdbg_switch_frame(int); +void phpdbg_dump_backtrace(size_t); #endif /* PHPDBG_FRAME_H */ diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index 652e170694..4fad1cff96 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -41,11 +41,11 @@ const phpdbg_command_t phpdbg_help_commands[] = { }; /* }}} */ /* {{{ pretty_print. Formatting escapes and wrapping text in a string before printing it. */ -void pretty_print(char *text TSRMLS_DC) +void pretty_print(char *text) { char *new, *p, *q; - const char *prompt_escape = phpdbg_get_prompt(TSRMLS_C); + const char *prompt_escape = phpdbg_get_prompt(); unsigned int prompt_escape_len = strlen(prompt_escape); unsigned int prompt_len = strlen(PHPDBG_G(prompt)[0]); @@ -53,7 +53,7 @@ void pretty_print(char *text TSRMLS_DC) const char *bold_off_escape = PHPDBG_G(flags) & PHPDBG_IS_COLOURED ? "\033[0m" : ""; unsigned int bold_escape_len = strlen(bold_on_escape); - unsigned int term_width = phpdbg_get_terminal_width(TSRMLS_C); + unsigned int term_width = phpdbg_get_terminal_width(); unsigned int size = 0; int in_bold = 0; @@ -142,16 +142,16 @@ void pretty_print(char *text TSRMLS_DC) } /* }}} */ /* {{{ summary_print. Print a summary line giving, the command, its alias and tip */ -void summary_print(phpdbg_command_t const * const cmd TSRMLS_DC) +void summary_print(phpdbg_command_t const * const cmd) { char *summary; spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**\n", cmd->name, cmd->alias, cmd->tip); - pretty_print(summary TSRMLS_CC); + pretty_print(summary); efree(summary); } /* {{{ get_help. Retries and formats text from the phpdbg help text table */ -static char *get_help(const char * const key TSRMLS_DC) +static char *get_help(const char * const key) { phpdbg_help_text_t *p; @@ -215,26 +215,26 @@ PHPDBG_COMMAND(help) /* {{{ */ int n; if (!param || param->type == EMPTY_PARAM) { - pretty_print(get_help("overview!" TSRMLS_CC) TSRMLS_CC); + pretty_print(get_help("overview!")); return SUCCESS; } if (param && param->type == STR_PARAM) { - n = get_command(param->str, param->len, &cmd, phpdbg_prompt_commands TSRMLS_CC); + n = get_command(param->str, param->len, &cmd, phpdbg_prompt_commands); if (n==1) { - summary_print(cmd TSRMLS_CC); - pretty_print(get_help(cmd->name TSRMLS_CC) TSRMLS_CC); + summary_print(cmd); + pretty_print(get_help(cmd->name)); return SUCCESS; } else if (n>1) { if (param->len > 1) { for (cmd=phpdbg_prompt_commands; cmd->name; cmd++) { if (!strncmp(cmd->name, param->str, param->len)) { - summary_print(cmd TSRMLS_CC); + summary_print(cmd); } } - pretty_print(get_help("duplicate!" TSRMLS_CC) TSRMLS_CC); + pretty_print(get_help("duplicate!")); return SUCCESS; } else { phpdbg_error("help", "type=\"ambiguousalias\" alias=\"%s\"", "Internal help error, non-unique alias \"%c\"", param->str[0]); @@ -242,13 +242,13 @@ PHPDBG_COMMAND(help) /* {{{ */ } } else { /* no prompt command found so try help topic */ - n = get_command( param->str, param->len, &cmd, phpdbg_help_commands TSRMLS_CC); + n = get_command( param->str, param->len, &cmd, phpdbg_help_commands); if (n>0) { if (cmd->alias == 'a') { /* help aliases executes a canned routine */ - return cmd->handler(param TSRMLS_CC); + return cmd->handler(param); } else { - pretty_print(get_help(cmd->name TSRMLS_CC) TSRMLS_CC); + pretty_print(get_help(cmd->name)); return SUCCESS; } } @@ -285,7 +285,7 @@ PHPDBG_HELP(aliases) /* {{{ */ phpdbg_xml("</helpcommands>"); /* Print out aliases for help as this one comes last, with the added text on how aliases are used */ - get_command("h", 1, &c, phpdbg_prompt_commands TSRMLS_CC); + get_command("h", 1, &c, phpdbg_prompt_commands); phpdbg_writeln("aliasinfo", "alias=\"%c\" name=\"%s\" tip=\"%s\"", " %c %-20s %s\n", c->alias, c->name, c->tip); phpdbg_xml("<helpaliases>"); @@ -300,7 +300,7 @@ PHPDBG_HELP(aliases) /* {{{ */ phpdbg_xml("</helpaliases>"); - pretty_print(get_help("aliases!" TSRMLS_CC) TSRMLS_CC); + pretty_print(get_help("aliases!")); return SUCCESS; } /* }}} */ diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c index 01633e4feb..a148a84b45 100644 --- a/sapi/phpdbg/phpdbg_info.c +++ b/sapi/phpdbg/phpdbg_info.c @@ -46,15 +46,15 @@ const phpdbg_command_t phpdbg_info_commands[] = { PHPDBG_INFO(break) /* {{{ */ { - phpdbg_print_breakpoints(PHPDBG_BREAK_FILE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_SYM TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_OPLINE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_FILE_OPLINE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_FUNCTION_OPLINE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD_OPLINE TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_COND TSRMLS_CC); - phpdbg_print_breakpoints(PHPDBG_BREAK_OPCODE TSRMLS_CC); + phpdbg_print_breakpoints(PHPDBG_BREAK_FILE); + phpdbg_print_breakpoints(PHPDBG_BREAK_SYM); + phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD); + phpdbg_print_breakpoints(PHPDBG_BREAK_OPLINE); + phpdbg_print_breakpoints(PHPDBG_BREAK_FILE_OPLINE); + phpdbg_print_breakpoints(PHPDBG_BREAK_FUNCTION_OPLINE); + phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD_OPLINE); + phpdbg_print_breakpoints(PHPDBG_BREAK_COND); + phpdbg_print_breakpoints(PHPDBG_BREAK_OPCODE); return SUCCESS; } /* }}} */ @@ -153,19 +153,19 @@ PHPDBG_INFO(constants) /* {{{ */ return SUCCESS; } /* }}} */ -static int phpdbg_arm_auto_global(zend_auto_global *auto_global TSRMLS_DC) { +static int phpdbg_arm_auto_global(zend_auto_global *auto_global) { if (auto_global->armed) { if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { phpdbg_notice("variableinfo", "unreachable=\"%.*s\"", "Cannot show information about superglobal variable %.*s", auto_global->name->len, auto_global->name->val); } else { - auto_global->armed = auto_global->auto_global_callback(auto_global->name TSRMLS_CC); + auto_global->armed = auto_global->auto_global_callback(auto_global->name); } } return 0; } -static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { +static int phpdbg_print_symbols(zend_bool show_globals) { HashTable vars; zend_array *symtable; zend_string *var; @@ -178,9 +178,9 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { if (show_globals) { /* that array should only be manipulated during init, so safe for async access during execution */ - zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_arm_auto_global TSRMLS_CC); + zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_arm_auto_global); symtable = &EG(symbol_table); - } else if (!(symtable = zend_rebuild_symbol_table(TSRMLS_C))) { + } else if (!(symtable = zend_rebuild_symbol_table())) { phpdbg_error("inactive", "type=\"symbol_table\"", "No active symbol table!"); return SUCCESS; } @@ -189,7 +189,7 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { phpdbg_try_access { ZEND_HASH_FOREACH_STR_KEY_VAL(&symtable->ht, var, data) { - if (zend_is_auto_global(var TSRMLS_CC) ^ !show_globals) { + if (zend_is_auto_global(var) ^ !show_globals) { zend_hash_update(&vars, var, data); } } ZEND_HASH_FOREACH_END(); @@ -226,7 +226,7 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { switch (Z_TYPE_P(data)) { case IS_RESOURCE: phpdbg_try_access { - const char *type = zend_rsrc_list_get_rsrc_type(Z_RES_P(data) TSRMLS_CC); + const char *type = zend_rsrc_list_get_rsrc_type(Z_RES_P(data)); VARIABLEINFO("type=\"%s\"", "\n|-------(typeof)------> (%s)\n", type ? type : "unknown"); } phpdbg_catch_access { VARIABLEINFO("type=\"unknown\"", "\n|-------(typeof)------> (unknown)\n"); @@ -276,12 +276,12 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) { PHPDBG_INFO(vars) /* {{{ */ { - return phpdbg_print_symbols(0 TSRMLS_CC); + return phpdbg_print_symbols(0); } PHPDBG_INFO(globals) /* {{{ */ { - return phpdbg_print_symbols(1 TSRMLS_CC); + return phpdbg_print_symbols(1); } PHPDBG_INFO(literal) /* {{{ */ @@ -309,7 +309,7 @@ PHPDBG_INFO(literal) /* {{{ */ while (literal < ops->last_literal) { if (Z_TYPE(ops->literals[literal]) != IS_NULL) { phpdbg_write("literal", "id=\"%u\"", "|-------- C%u -------> [", literal); - zend_print_zval(&ops->literals[literal], 0 TSRMLS_CC); + zend_print_zval(&ops->literals[literal], 0); phpdbg_out("]\n"); } literal++; @@ -328,16 +328,16 @@ PHPDBG_INFO(memory) /* {{{ */ zend_bool is_mm; if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { - heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem(TSRMLS_C) TSRMLS_CC); + heap = zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem()); } - if ((is_mm = is_zend_mm(TSRMLS_C))) { - used = zend_memory_usage(0 TSRMLS_CC); - real = zend_memory_usage(1 TSRMLS_CC); - peak_used = zend_memory_peak_usage(0 TSRMLS_CC); - peak_real = zend_memory_peak_usage(1 TSRMLS_CC); + if ((is_mm = is_zend_mm())) { + used = zend_memory_usage(0); + real = zend_memory_usage(1); + peak_used = zend_memory_peak_usage(0); + peak_real = zend_memory_peak_usage(1); } if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { - zend_mm_set_heap(heap TSRMLS_CC); + zend_mm_set_heap(heap); } if (is_mm) { @@ -354,7 +354,7 @@ PHPDBG_INFO(memory) /* {{{ */ return SUCCESS; } /* }}} */ -static inline void phpdbg_print_class_name(zend_class_entry *ce TSRMLS_DC) /* {{{ */ +static inline void phpdbg_print_class_name(zend_class_entry *ce) /* {{{ */ { const char *visibility = ce->type == ZEND_USER_CLASS ? "User" : "Internal"; const char *type = (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface" : (ce->ce_flags & ZEND_ACC_ABSTRACT) ? "Abstract Class" : "Class"; @@ -383,14 +383,14 @@ PHPDBG_INFO(classes) /* {{{ */ /* once added, assume that classes are stable... until shutdown. */ ZEND_HASH_FOREACH_PTR(&classes, ce) { - phpdbg_print_class_name(ce TSRMLS_CC); + phpdbg_print_class_name(ce); if (ce->parent) { phpdbg_xml("<parents %r>"); zend_class_entry *pce = ce->parent; do { phpdbg_out("|-------- "); - phpdbg_print_class_name(pce TSRMLS_CC); + phpdbg_print_class_name(pce); } while ((pce = pce->parent)); phpdbg_xml("</parents>"); } diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c index a2a5c5969f..6d74230d20 100644 --- a/sapi/phpdbg/phpdbg_io.c +++ b/sapi/phpdbg/phpdbg_io.c @@ -48,7 +48,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); /* is easy to generalize ... but not needed for now */ -PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) { +PHPDBG_API int phpdbg_consume_stdin_line(char *buf) { int bytes = PHPDBG_G(input_buflen), len = 0; if (PHPDBG_G(input_buflen)) { @@ -85,7 +85,7 @@ PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) { } len += bytes; - } while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1 TSRMLS_CC)) > 0); + } while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1)) > 0); if (bytes <= 0) { PHPDBG_G(flags) |= PHPDBG_IS_QUITTING | PHPDBG_IS_DISCONNECTED; @@ -96,7 +96,7 @@ PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC) { return bytes; } -PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo TSRMLS_DC) { +PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo) { int got_now, i = len, j; char *p = ptr; #ifndef PHP_WIN32 @@ -177,16 +177,16 @@ PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len) { } -PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo TSRMLS_DC) { +PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) { if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { - return phpdbg_consume_bytes(sock, ptr, len, tmo TSRMLS_CC); + return phpdbg_consume_bytes(sock, ptr, len, tmo); } return read(sock, ptr, len); } -PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC) { +PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) { if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { return phpdbg_send_bytes(sock, ptr, len); } @@ -195,9 +195,9 @@ PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC) } -PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSRMLS_DC) { +PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port) { struct addrinfo res; - int fd = phpdbg_create_listenable_socket(interface, port, &res TSRMLS_CC); + int fd = phpdbg_create_listenable_socket(interface, port, &res); if (fd == -1) { return -1; @@ -214,7 +214,7 @@ PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSR } -PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *addr_res TSRMLS_DC) { +PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *addr_res) { int sock = -1, rc; int reuse = 1; struct in6_addr serveraddr; diff --git a/sapi/phpdbg/phpdbg_io.h b/sapi/phpdbg/phpdbg_io.h index a5659e88c6..631b16beb1 100644 --- a/sapi/phpdbg/phpdbg_io.h +++ b/sapi/phpdbg/phpdbg_io.h @@ -21,15 +21,15 @@ #include "phpdbg.h" -PHPDBG_API int phpdbg_consume_stdin_line(char *buf TSRMLS_DC); +PHPDBG_API int phpdbg_consume_stdin_line(char *buf); -PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo TSRMLS_DC); +PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo); PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len); -PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo TSRMLS_DC); -PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len TSRMLS_DC); +PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo); +PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len); -PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *res TSRMLS_DC); -PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port TSRMLS_DC); +PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *res); +PHPDBG_API int phpdbg_open_socket(const char *interface, unsigned short port); PHPDBG_API void phpdbg_close_socket(int sock); #endif /* PHPDBG_IO_H */ diff --git a/sapi/phpdbg/phpdbg_lexer.c b/sapi/phpdbg/phpdbg_lexer.c index 90f3a449da..54f4fc7e72 100644 --- a/sapi/phpdbg/phpdbg_lexer.c +++ b/sapi/phpdbg/phpdbg_lexer.c @@ -29,7 +29,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) { +void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) { PHPDBG_G(parser_stack) = stack; YYSETCONDITION(INITIAL); diff --git a/sapi/phpdbg/phpdbg_lexer.h b/sapi/phpdbg/phpdbg_lexer.h index ab51e7daa8..d9ec56d489 100644 --- a/sapi/phpdbg/phpdbg_lexer.h +++ b/sapi/phpdbg/phpdbg_lexer.h @@ -34,7 +34,7 @@ typedef struct { #define yyparse phpdbg_parse #define yylex phpdbg_lex -void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC); +void phpdbg_init_lexer (phpdbg_param_t *stack, char *input); int phpdbg_lex (phpdbg_param_t* yylval); diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l index 0c27fc22ac..de0f9f1999 100644 --- a/sapi/phpdbg/phpdbg_lexer.l +++ b/sapi/phpdbg/phpdbg_lexer.l @@ -27,7 +27,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -void phpdbg_init_lexer (phpdbg_param_t *stack, char *input TSRMLS_DC) { +void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) { PHPDBG_G(parser_stack) = stack; YYSETCONDITION(INITIAL); diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index f201be9850..7404cd139b 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -47,22 +47,22 @@ const phpdbg_command_t phpdbg_list_commands[] = { PHPDBG_LIST(lines) /* {{{ */ { - if (!PHPDBG_G(exec) && !zend_is_executing(TSRMLS_C)) { + if (!PHPDBG_G(exec) && !zend_is_executing()) { phpdbg_error("inactive", "type=\"execution\"", "Not executing, and execution context not set"); return SUCCESS; } switch (param->type) { case NUMERIC_PARAM: { - const char *char_file = phpdbg_current_file(TSRMLS_C); + const char *char_file = phpdbg_current_file(); zend_string *file = zend_string_init(char_file, strlen(char_file), 0); - phpdbg_list_file(file, param->num < 0 ? 1 - param->num : param->num, (param->num < 0 ? param->num : 0) + zend_get_executed_lineno(TSRMLS_C), 0 TSRMLS_CC); + phpdbg_list_file(file, param->num < 0 ? 1 - param->num : param->num, (param->num < 0 ? param->num : 0) + zend_get_executed_lineno(), 0); efree(file); } break; case FILE_PARAM: { zend_string *file = zend_string_init(param->file.name, strlen(param->file.name), 0); - phpdbg_list_file(file, param->file.line, 0, 0 TSRMLS_CC); + phpdbg_list_file(file, param->file.line, 0, 0); efree(file); } break; @@ -74,7 +74,7 @@ PHPDBG_LIST(lines) /* {{{ */ PHPDBG_LIST(func) /* {{{ */ { - phpdbg_list_function_byname(param->str, param->len TSRMLS_CC); + phpdbg_list_function_byname(param->str, param->len); return SUCCESS; } /* }}} */ @@ -83,12 +83,12 @@ PHPDBG_LIST(method) /* {{{ */ { zend_class_entry *ce; - if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce TSRMLS_CC) == SUCCESS) { + if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce) == SUCCESS) { zend_function *function; char *lcname = zend_str_tolower_dup(param->method.name, strlen(param->method.name)); if ((function = zend_hash_str_find_ptr(&ce->function_table, lcname, strlen(lcname)))) { - phpdbg_list_function(function TSRMLS_CC); + phpdbg_list_function(function); } else { phpdbg_error("list", "type=\"notfound\" method=\"%s::%s\"", "Could not find %s::%s", param->method.class, param->method.name); } @@ -105,10 +105,10 @@ PHPDBG_LIST(class) /* {{{ */ { zend_class_entry *ce; - if (phpdbg_safe_class_lookup(param->str, param->len, &ce TSRMLS_CC) == SUCCESS) { + if (phpdbg_safe_class_lookup(param->str, param->len, &ce) == SUCCESS) { if (ce->type == ZEND_USER_CLASS) { if (ce->info.user.filename) { - phpdbg_list_file(ce->info.user.filename, ce->info.user.line_end - ce->info.user.line_start + 1, ce->info.user.line_start, 0 TSRMLS_CC); + phpdbg_list_file(ce->info.user.filename, ce->info.user.line_end - ce->info.user.line_start + 1, ce->info.user.line_start, 0); } else { phpdbg_error("list", "type=\"nosource\" class=\"%s\"", "The source of the requested class (%s) cannot be found", ce->name); } @@ -122,7 +122,7 @@ PHPDBG_LIST(class) /* {{{ */ return SUCCESS; } /* }}} */ -void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight TSRMLS_DC) /* {{{ */ +void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight) /* {{{ */ { uint line, lastline; phpdbg_file_source *data; @@ -176,7 +176,7 @@ void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highli phpdbg_xml("</list>"); } /* }}} */ -void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */ +void phpdbg_list_function(const zend_function *fbc) /* {{{ */ { const zend_op_array *ops; @@ -187,10 +187,10 @@ void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */ ops = (zend_op_array *) fbc; - phpdbg_list_file(ops->filename, ops->line_end - ops->line_start + 1, ops->line_start, 0 TSRMLS_CC); + phpdbg_list_file(ops->filename, ops->line_end - ops->line_start + 1, ops->line_start, 0); } /* }}} */ -void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ */ +void phpdbg_list_function_byname(const char *str, size_t len) /* {{{ */ { HashTable *func_table = EG(function_table); zend_function* fbc; @@ -220,7 +220,7 @@ void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ * phpdbg_try_access { if ((fbc = zend_hash_str_find_ptr(func_table, func_name, func_name_len))) { - phpdbg_list_function(fbc TSRMLS_CC); + phpdbg_list_function(fbc); } else { phpdbg_error("list", "type=\"nofunction\" function=\"%s\"", "Function %s not found", func_name); } @@ -231,7 +231,7 @@ void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC) /* {{{ * efree(func_name); } /* }}} */ -zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) { +zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { phpdbg_file_source data, *dataptr; zend_file_handle fake = {{0}}; zend_op_array *ret; @@ -240,7 +240,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) { char *bufptr, *endptr; char resolved_path_buf[MAXPATHLEN]; - zend_stream_fixup(file, &data.buf, &data.len TSRMLS_CC); + zend_stream_fixup(file, &data.buf, &data.len); data.filename = filename; data.line[0] = 0; @@ -279,12 +279,12 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type TSRMLS_DC) { dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line); zend_hash_str_add_ptr(&PHPDBG_G(file_sources), filename, strlen(filename), dataptr); - phpdbg_resolve_pending_file_break(filename TSRMLS_CC); + phpdbg_resolve_pending_file_break(filename); - ret = PHPDBG_G(compile_file)(&fake, type TSRMLS_CC); + ret = PHPDBG_G(compile_file)(&fake, type); fake.opened_path = NULL; - zend_file_handle_dtor(&fake TSRMLS_CC); + zend_file_handle_dtor(&fake); return ret; } @@ -302,7 +302,7 @@ void phpdbg_free_file_source(phpdbg_file_source *data) { efree(data); } -void phpdbg_init_list(TSRMLS_D) { +void phpdbg_init_list(void) { PHPDBG_G(compile_file) = zend_compile_file; zend_hash_init(&PHPDBG_G(file_sources), 1, NULL, (dtor_func_t) phpdbg_free_file_source, 0); zend_compile_file = phpdbg_compile_file; diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h index 43a2d474d5..03d8754769 100644 --- a/sapi/phpdbg/phpdbg_list.h +++ b/sapi/phpdbg/phpdbg_list.h @@ -32,13 +32,13 @@ PHPDBG_LIST(class); PHPDBG_LIST(method); PHPDBG_LIST(func); -void phpdbg_list_function_byname(const char *, size_t TSRMLS_DC); -void phpdbg_list_function(const zend_function * TSRMLS_DC); -void phpdbg_list_file(zend_string *, uint, int, uint TSRMLS_DC); +void phpdbg_list_function_byname(const char *, size_t); +void phpdbg_list_function(const zend_function *); +void phpdbg_list_file(zend_string *, uint, int, uint); extern const phpdbg_command_t phpdbg_list_commands[]; -void phpdbg_init_list(TSRMLS_D); +void phpdbg_init_list(void); typedef struct { char *filename; diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c index 20841cbc42..daf6453b4c 100644 --- a/sapi/phpdbg/phpdbg_opcode.c +++ b/sapi/phpdbg/phpdbg_opcode.c @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal TSRMLS_DC) /* {{{ */ +static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal) /* {{{ */ { int iter = 0; @@ -40,7 +40,7 @@ static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zval *literal T return 0; } /* }}} */ -static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars TSRMLS_DC) /* {{{ */ +static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars) /* {{{ */ { char *decode = NULL; @@ -64,7 +64,7 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t } break; case IS_CONST: - asprintf(&decode, "C%u", phpdbg_decode_literal(ops, RT_CONSTANT(ops, *op) TSRMLS_CC)); + asprintf(&decode, "C%u", phpdbg_decode_literal(ops, RT_CONSTANT(ops, *op))); break; case IS_UNUSED: @@ -74,7 +74,7 @@ static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t return decode; } /* }}} */ -char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRMLS_DC) /*{{{ */ +char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars) /*{{{ */ { char *decode[4] = {NULL, NULL, NULL, NULL}; @@ -90,7 +90,7 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM goto format; case ZEND_JMPZNZ: - decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC); + decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars); asprintf(&decode[2], "J%u or J%llu", op->op2.opline_num, op->extended_value); goto result; @@ -102,7 +102,7 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM #ifdef ZEND_JMP_SET case ZEND_JMP_SET: #endif - decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC); + decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars); asprintf(&decode[2], "J%ld", OP_JMP_ADDR(op, op->op2) - ops->opcodes); goto result; @@ -110,10 +110,10 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRM goto result; default: { - decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars TSRMLS_CC); - decode[2] = phpdbg_decode_op(ops, &op->op2, op->op2_type, vars TSRMLS_CC); + decode[1] = phpdbg_decode_op(ops, &op->op1, op->op1_type, vars); + decode[2] = phpdbg_decode_op(ops, &op->op2, op->op2_type, vars); result: - decode[3] = phpdbg_decode_op(ops, &op->result, op->result_type, vars TSRMLS_CC); + decode[3] = phpdbg_decode_op(ops, &op->result, op->result_type, vars); format: asprintf(&decode[0], "%-20s %-20s %-20s", @@ -133,7 +133,7 @@ format: return decode[0]; } /* }}} */ -void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags TSRMLS_DC) /* {{{ */ +void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags) /* {{{ */ { /* force out a line while stepping so the user knows what is happening */ if (ignore_flags || @@ -142,7 +142,7 @@ void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, ze (PHPDBG_G(oplog)))) { zend_op *opline = (zend_op *) execute_data->opline; - char *decode = phpdbg_decode_opline(&execute_data->func->op_array, opline, vars TSRMLS_CC); + char *decode = phpdbg_decode_opline(&execute_data->func->op_array, opline, vars); if (ignore_flags || (!(PHPDBG_G(flags) & PHPDBG_IS_QUIET) || (PHPDBG_G(flags) & PHPDBG_IS_STEPPING))) { /* output line info */ @@ -169,9 +169,9 @@ void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, ze } } /* }}} */ -void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC) /* {{{ */ +void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags) /* {{{ */ { - phpdbg_print_opline_ex(execute_data, NULL, ignore_flags TSRMLS_CC); + phpdbg_print_opline_ex(execute_data, NULL, ignore_flags); } /* }}} */ const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */ diff --git a/sapi/phpdbg/phpdbg_opcode.h b/sapi/phpdbg/phpdbg_opcode.h index 144442981d..abcfda360f 100644 --- a/sapi/phpdbg/phpdbg_opcode.h +++ b/sapi/phpdbg/phpdbg_opcode.h @@ -24,8 +24,8 @@ #include "zend_types.h" const char *phpdbg_decode_opcode(zend_uchar); -char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars TSRMLS_DC); -void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC); -void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags TSRMLS_DC); +char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op, HashTable *vars); +void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags); +void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags); #endif /* PHPDBG_OPCODE_H */ diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c index a9edd19ad9..a6e57a873a 100644 --- a/sapi/phpdbg/phpdbg_out.c +++ b/sapi/phpdbg/phpdbg_out.c @@ -129,7 +129,7 @@ typedef struct buf_area buffy; /* * Do format conversion placing the output in buffer */ -static int format_converter(register buffy *odp, const char *fmt, zend_bool escape_xml, va_list ap TSRMLS_DC) { +static int format_converter(register buffy *odp, const char *fmt, zend_bool escape_xml, va_list ap) { char *sp; char *bep; int cc = 0; @@ -333,7 +333,7 @@ static int format_converter(register buffy *odp, const char *fmt, zend_bool esca switch (*fmt) { case 'Z': zvp = (zval *) va_arg(ap, zval *); - free_zcopy = zend_make_printable_zval(zvp, &zcopy TSRMLS_CC); + free_zcopy = zend_make_printable_zval(zvp, &zcopy); if (free_zcopy) { zvp = &zcopy; } @@ -814,7 +814,7 @@ skip_output: return (cc); } -static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) { +static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap) { buffy od; int cc; @@ -834,7 +834,7 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zen /* * Do the conversion */ - cc = format_converter(&od, format, escape_xml, ap TSRMLS_CC); + cc = format_converter(&od, format, escape_xml, ap); if (len != 0 && od.nextb <= od.buf_end) { *(od.nextb) = '\0'; } @@ -843,26 +843,26 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, zen } } -static int phpdbg_xml_vsnprintf(char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) { +static int phpdbg_xml_vsnprintf(char *buf, size_t len, const char *format, zend_bool escape_xml, va_list ap) { int cc; - strx_printv(&cc, buf, len, format, escape_xml, ap TSRMLS_CC); + strx_printv(&cc, buf, len, format, escape_xml, ap); return (cc); } -PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool escape_xml, va_list ap TSRMLS_DC) { +PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool escape_xml, va_list ap) { va_list ap2; int cc; va_copy(ap2, ap); - cc = phpdbg_xml_vsnprintf(NULL, 0, format, escape_xml, ap2 TSRMLS_CC); + cc = phpdbg_xml_vsnprintf(NULL, 0, format, escape_xml, ap2); va_end(ap2); *buf = NULL; if (cc >= 0) { if ((*buf = emalloc(++cc)) != NULL) { - if ((cc = phpdbg_xml_vsnprintf(*buf, cc, format, escape_xml, ap TSRMLS_CC)) < 0) { + if ((cc = phpdbg_xml_vsnprintf(*buf, cc, format, escape_xml, ap)) < 0) { efree(*buf); *buf = NULL; } @@ -873,23 +873,23 @@ PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool es } /* copy end */ -PHPDBG_API int _phpdbg_xml_asprintf(char **buf TSRMLS_DC, const char *format, zend_bool escape_xml, ...) { +PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...) { int ret; va_list va; va_start(va, escape_xml); - ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va TSRMLS_CC); + ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va); va_end(va); return ret; } -PHPDBG_API int _phpdbg_asprintf(char **buf TSRMLS_DC, const char *format, ...) { +PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...) { int ret; va_list va; va_start(va, format); - ret = phpdbg_xml_vasprintf(buf, format, 0, va TSRMLS_CC); + ret = phpdbg_xml_vasprintf(buf, format, 0, va); va_end(va); return ret; @@ -949,13 +949,13 @@ static void phpdbg_encode_ctrl_chars(char **buf, int *buflen) { *buflen = len; } -static int phpdbg_process_print(int fd, int type, const char *tag, const char *msg, int msglen, const char *xml, int xmllen TSRMLS_DC) { +static int phpdbg_process_print(int fd, int type, const char *tag, const char *msg, int msglen, const char *xml, int xmllen) { char *msgout = NULL, *buf; int msgoutlen, xmloutlen, buflen; const char *severity; if ((PHPDBG_G(flags) & PHPDBG_WRITE_XML) && PHPDBG_G(in_script_xml) && PHPDBG_G(in_script_xml) != type) { - phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("</stream>")); PHPDBG_G(in_script_xml) = 0; } @@ -964,9 +964,9 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m severity = "error"; if (!PHPDBG_G(last_was_newline)) { if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { - phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>")); } else { - phpdbg_mixed_write(fd, ZEND_STRL("\n") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("\n")); } PHPDBG_G(last_was_newline) = 1; } @@ -981,9 +981,9 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m severity = "notice"; if (!PHPDBG_G(last_was_newline)) { if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { - phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>\n" "</phpdbg>")); } else { - phpdbg_mixed_write(fd, ZEND_STRL("\n") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("\n")); } PHPDBG_G(last_was_newline) = 1; } @@ -1027,18 +1027,18 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m if (PHPDBG_G(in_script_xml) != type) { char *stream_buf; int stream_buflen = phpdbg_asprintf(&stream_buf, "<stream type=\"%s\">", type == P_STDERR ? "stderr" : "stdout"); - phpdbg_mixed_write(fd, stream_buf, stream_buflen TSRMLS_CC); + phpdbg_mixed_write(fd, stream_buf, stream_buflen); efree(stream_buf); PHPDBG_G(in_script_xml) = type; } - encoded = php_escape_html_entities((unsigned char *) msg, msglen, 0, ENT_NOQUOTES, PG(internal_encoding) && PG(internal_encoding)[0] ? PG(internal_encoding) : (SG(default_charset) ? SG(default_charset) : "UTF-8") TSRMLS_CC); + encoded = php_escape_html_entities((unsigned char *) msg, msglen, 0, ENT_NOQUOTES, PG(internal_encoding) && PG(internal_encoding)[0] ? PG(internal_encoding) : (SG(default_charset) ? SG(default_charset) : "UTF-8")); buflen = encoded->len; memcpy(buf = emalloc(buflen + 1), encoded->val, buflen); phpdbg_encode_ctrl_chars(&buf, &buflen); - phpdbg_mixed_write(fd, buf, buflen TSRMLS_CC); + phpdbg_mixed_write(fd, buf, buflen); efree(buf); } else { - phpdbg_mixed_write(fd, msg, msglen TSRMLS_CC); + phpdbg_mixed_write(fd, msg, msglen); } return msglen; } @@ -1076,12 +1076,12 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m } phpdbg_encode_ctrl_chars(&xmlout, &xmloutlen); - phpdbg_eol_convert(&xmlout, &xmloutlen TSRMLS_CC); - phpdbg_mixed_write(fd, xmlout, xmloutlen TSRMLS_CC); + phpdbg_eol_convert(&xmlout, &xmloutlen); + phpdbg_mixed_write(fd, xmlout, xmloutlen); efree(xmlout); } else if (msgout) { - phpdbg_eol_convert(&msgout, &msgoutlen TSRMLS_CC); - phpdbg_mixed_write(fd, msgout, msgoutlen TSRMLS_CC); + phpdbg_eol_convert(&msgout, &msgoutlen); + phpdbg_mixed_write(fd, msgout, msgoutlen); } if (PHPDBG_G(req_id) && (PHPDBG_G(flags) & PHPDBG_WRITE_XML)) { @@ -1095,7 +1095,7 @@ static int phpdbg_process_print(int fd, int type, const char *tag, const char *m return msgout ? msgoutlen : xmloutlen; } /* }}} */ -PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, va_list args) { +PHPDBG_API int phpdbg_vprint(int type, int fd, const char *tag, const char *xmlfmt, const char *strfmt, va_list args) { char *msg = NULL, *xml = NULL; int msglen = 0, xmllen = 0; int len; @@ -1103,14 +1103,14 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const if (strfmt != NULL && strlen(strfmt) > 0L) { va_copy(argcpy, args); - msglen = phpdbg_xml_vasprintf(&msg, strfmt, 0, argcpy TSRMLS_CC); + msglen = phpdbg_xml_vasprintf(&msg, strfmt, 0, argcpy); va_end(argcpy); } if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { if (xmlfmt != NULL && strlen(xmlfmt) > 0L) { va_copy(argcpy, args); - xmllen = phpdbg_xml_vasprintf(&xml, xmlfmt, 1, argcpy TSRMLS_CC); + xmllen = phpdbg_xml_vasprintf(&xml, xmlfmt, 1, argcpy); va_end(argcpy); } else { xml = estrdup(""); @@ -1118,7 +1118,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const } if (PHPDBG_G(err_buf).active && type != P_STDOUT && type != P_STDERR) { - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_free_err_buf(); PHPDBG_G(err_buf).type = type; PHPDBG_G(err_buf).fd = fd; @@ -1133,7 +1133,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const return msglen; } - len = phpdbg_process_print(fd, type, tag, msg, msglen, xml, xmllen TSRMLS_CC); + len = phpdbg_process_print(fd, type, tag, msg, msglen, xml, xmllen); if (msg) { efree(msg); @@ -1146,7 +1146,7 @@ PHPDBG_API int phpdbg_vprint(int type TSRMLS_DC, int fd, const char *tag, const return len; } -PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D) { +PHPDBG_API void phpdbg_free_err_buf(void) { if (PHPDBG_G(err_buf).type == 0) { return; } @@ -1160,11 +1160,11 @@ PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D) { } } -PHPDBG_API void phpdbg_activate_err_buf(zend_bool active TSRMLS_DC) { +PHPDBG_API void phpdbg_activate_err_buf(zend_bool active) { PHPDBG_G(err_buf).active = active; } -PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt TSRMLS_DC, ...) { +PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt, ...) { int len; va_list args; int errbuf_active = PHPDBG_G(err_buf).active; @@ -1180,16 +1180,16 @@ PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const #else va_start(args, strfmt); #endif - len = phpdbg_vprint(PHPDBG_G(err_buf).type TSRMLS_CC, PHPDBG_G(err_buf).fd, tag ? tag : PHPDBG_G(err_buf).tag, xmlfmt, strfmt, args); + len = phpdbg_vprint(PHPDBG_G(err_buf).type, PHPDBG_G(err_buf).fd, tag ? tag : PHPDBG_G(err_buf).tag, xmlfmt, strfmt, args); va_end(args); PHPDBG_G(err_buf).active = errbuf_active; - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_free_err_buf(); return len; } -PHPDBG_API int phpdbg_print(int type TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) { +PHPDBG_API int phpdbg_print(int type, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) { va_list args; int len; @@ -1198,13 +1198,13 @@ PHPDBG_API int phpdbg_print(int type TSRMLS_DC, int fd, const char *tag, const c } va_start(args, strfmt); - len = phpdbg_vprint(type TSRMLS_CC, fd, tag, xmlfmt, strfmt, args); + len = phpdbg_vprint(type, fd, tag, xmlfmt, strfmt, args); va_end(args); return len; } -PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) { +PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) { int len = 0; if (PHPDBG_G(flags) & PHPDBG_DISCARD_OUTPUT) { @@ -1217,40 +1217,40 @@ PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) { int buflen; va_start(args, fmt); - buflen = phpdbg_xml_vasprintf(&buffer, fmt, 1, args TSRMLS_CC); + buflen = phpdbg_xml_vasprintf(&buffer, fmt, 1, args); va_end(args); phpdbg_encode_ctrl_chars(&buffer, &buflen); if (PHPDBG_G(in_script_xml)) { - phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("</stream>")); PHPDBG_G(in_script_xml) = 0; } - len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC); + len = phpdbg_mixed_write(fd, buffer, buflen); efree(buffer); } return len; } -PHPDBG_API int phpdbg_log_internal(int fd TSRMLS_DC, const char *fmt, ...) { +PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) { va_list args; char *buffer; int buflen; int len = 0; va_start(args, fmt); - buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args TSRMLS_CC); + buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args); va_end(args); - len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC); + len = phpdbg_mixed_write(fd, buffer, buflen); efree(buffer); return len; } -PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) { +PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) { va_list args; char *buffer; int buflen; @@ -1261,7 +1261,7 @@ PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) { } va_start(args, fmt); - buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args TSRMLS_CC); + buflen = phpdbg_xml_vasprintf(&buffer, fmt, 0, args); va_end(args); if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { @@ -1270,26 +1270,26 @@ PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) { msglen = phpdbg_encode_xml(&msg, buffer, buflen, 256, NULL); phpdbg_encode_ctrl_chars(&msg, &msglen); - phpdbg_eol_convert(&msg, &msglen TSRMLS_CC); + phpdbg_eol_convert(&msg, &msglen); if (PHPDBG_G(in_script_xml)) { - phpdbg_mixed_write(fd, ZEND_STRL("</stream>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("</stream>")); PHPDBG_G(in_script_xml) = 0; } - phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>") TSRMLS_CC); - len = phpdbg_mixed_write(fd, msg, msglen TSRMLS_CC); - phpdbg_mixed_write(fd, ZEND_STRL("</phpdbg>") TSRMLS_CC); + phpdbg_mixed_write(fd, ZEND_STRL("<phpdbg>")); + len = phpdbg_mixed_write(fd, msg, msglen); + phpdbg_mixed_write(fd, ZEND_STRL("</phpdbg>")); } else { - phpdbg_eol_convert(&buffer, &buflen TSRMLS_CC); - len = phpdbg_mixed_write(fd, buffer, buflen TSRMLS_CC); + phpdbg_eol_convert(&buffer, &buflen); + len = phpdbg_mixed_write(fd, buffer, buflen); } return len; } -PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) { /* {{{ */ +PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) { /* {{{ */ int rc = 0; va_list args; @@ -1308,10 +1308,10 @@ PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) { /* #endif phpdbg_asprintf(&buffer, friendly, tp.tv_usec/1000); phpdbg_asprintf(&format, "[%s]: %s\n", buffer, fmt); - rc = phpdbg_xml_vasprintf(&outbuf, format, 0, args TSRMLS_CC); + rc = phpdbg_xml_vasprintf(&outbuf, format, 0, args); if (outbuf) { - rc = phpdbg_mixed_write(fd, outbuf, rc TSRMLS_CC); + rc = phpdbg_mixed_write(fd, outbuf, rc); efree(outbuf); } diff --git a/sapi/phpdbg/phpdbg_out.h b/sapi/phpdbg/phpdbg_out.h index ea25b04279..871ea4dfeb 100644 --- a/sapi/phpdbg/phpdbg_out.h +++ b/sapi/phpdbg/phpdbg_out.h @@ -35,11 +35,11 @@ enum { }; #ifdef ZTS -PHPDBG_API int phpdbg_print(int severity TSRMLS_DC, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 6, 7); -PHPDBG_API int phpdbg_xml_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); -PHPDBG_API int phpdbg_log_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); -PHPDBG_API int phpdbg_out_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); -PHPDBG_API int phpdbg_rlog_internal(int fd TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_print(int severity, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 6, 7); +PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); +PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #else PHPDBG_API int phpdbg_print(int severity, int fd, const char *tag, const char *xmlfmt, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 5, 6); PHPDBG_API int phpdbg_xml_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); @@ -49,42 +49,42 @@ PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_ #endif -#define phpdbg_error(tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_notice(tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_writeln(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_write(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_script(type, fmt, ...) phpdbg_print(type TSRMLS_CC, PHPDBG_G(io)[PHPDBG_STDOUT].fd, NULL, NULL, fmt, ##__VA_ARGS__) -#define phpdbg_log(fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) -#define phpdbg_xml(fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) -#define phpdbg_out(fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) +#define phpdbg_error(tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_notice(tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_writeln(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN, PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_write(tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_script(type, fmt, ...) phpdbg_print(type , PHPDBG_G(io)[PHPDBG_STDOUT].fd, NULL, NULL, fmt, ##__VA_ARGS__) +#define phpdbg_log(fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) +#define phpdbg_xml(fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) +#define phpdbg_out(fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) -#define phpdbg_error_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_notice_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_writeln_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_write_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) -#define phpdbg_script_ex(out, type, fmt, ...) phpdbg_print(type TSRMLS_CC, out, NULL, NULL, fmt, ##__VA_ARGS__) -#define phpdbg_log_ex(out, fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) -#define phpdbg_xml_ex(out, fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) -#define phpdbg_out_ex(out, fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd TSRMLS_CC, fmt, ##__VA_ARGS__) +#define phpdbg_error_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_ERROR , out, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_notice_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_NOTICE , out, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_writeln_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITELN, out, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_write_ex(out, tag, xmlfmt, strfmt, ...) phpdbg_print(P_WRITE , out, tag, xmlfmt, strfmt, ##__VA_ARGS__) +#define phpdbg_script_ex(out, type, fmt, ...) phpdbg_print(type , out, NULL, NULL, fmt, ##__VA_ARGS__) +#define phpdbg_log_ex(out, fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) +#define phpdbg_xml_ex(out, fmt, ...) phpdbg_xml_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) +#define phpdbg_out_ex(out, fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, fmt, ##__VA_ARGS__) -#define phpdbg_rlog(fd, fmt, ...) phpdbg_rlog_internal(fd TSRMLS_CC, fmt, ##__VA_ARGS__) +#define phpdbg_rlog(fd, fmt, ...) phpdbg_rlog_internal(fd, fmt, ##__VA_ARGS__) -#define phpdbg_xml_asprintf(buf, ...) _phpdbg_xml_asprintf(buf TSRMLS_CC, ##__VA_ARGS__) -PHPDBG_API int _phpdbg_xml_asprintf(char **buf TSRMLS_DC, const char *format, zend_bool escape_xml, ...); +#define phpdbg_xml_asprintf(buf, ...) _phpdbg_xml_asprintf(buf, ##__VA_ARGS__) +PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...); -#define phpdbg_asprintf(buf, ...) _phpdbg_asprintf(buf TSRMLS_CC, ##__VA_ARGS__) -PHPDBG_API int _phpdbg_asprintf(char **buf TSRMLS_DC, const char *format, ...); +#define phpdbg_asprintf(buf, ...) _phpdbg_asprintf(buf, ##__VA_ARGS__) +PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...); #if PHPDBG_DEBUG -# define phpdbg_debug(fmt, ...) phpdbg_log_ex(PHPDBG_G(io)[PHPDBG_STDERR].fd TSRMLS_CC, fmt, ##__VA_ARGS__) +# define phpdbg_debug(fmt, ...) phpdbg_log_ex(PHPDBG_G(io)[PHPDBG_STDERR].fd, fmt, ##__VA_ARGS__) #else # define phpdbg_debug(fmt, ...) #endif -PHPDBG_API void phpdbg_free_err_buf(TSRMLS_D); -PHPDBG_API void phpdbg_activate_err_buf(zend_bool active TSRMLS_DC); -PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt TSRMLS_DC, ...); +PHPDBG_API void phpdbg_free_err_buf(void); +PHPDBG_API void phpdbg_activate_err_buf(zend_bool active); +PHPDBG_API int phpdbg_output_err_buf(const char *tag, const char *xmlfmt, const char *strfmt, ...); /* {{{ For separation */ diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c index b4da3ed593..b5191a46a7 100644 --- a/sapi/phpdbg/phpdbg_parser.c +++ b/sapi/phpdbg/phpdbg_parser.c @@ -1912,11 +1912,11 @@ static int yyerror(void ***tsrm_ls, const char *msg) { return 0; } -int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC) { - phpdbg_init_lexer(stack, input TSRMLS_CC); +int phpdbg_do_parse(phpdbg_param_t *stack, char *input) { + phpdbg_init_lexer(stack, input); #ifdef ZTS - return yyparse(TSRMLS_C); + return yyparse(); #else return yyparse(NULL); #endif diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y index e4353976f3..e0bd2f89e2 100644 --- a/sapi/phpdbg/phpdbg_parser.y +++ b/sapi/phpdbg/phpdbg_parser.y @@ -180,11 +180,11 @@ static int yyerror(void ***tsrm_ls, const char *msg) { return 0; } -int phpdbg_do_parse(phpdbg_param_t *stack, char *input TSRMLS_DC) { - phpdbg_init_lexer(stack, input TSRMLS_CC); +int phpdbg_do_parse(phpdbg_param_t *stack, char *input) { + phpdbg_init_lexer(stack, input); #ifdef ZTS - return yyparse(TSRMLS_C); + return yyparse(); #else return yyparse(NULL); #endif diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c index 62a614281d..52bb6629eb 100644 --- a/sapi/phpdbg/phpdbg_print.c +++ b/sapi/phpdbg/phpdbg_print.c @@ -42,7 +42,7 @@ const phpdbg_command_t phpdbg_print_commands[] = { PHPDBG_PRINT(opline) /* {{{ */ { if (PHPDBG_G(in_execution) && EG(current_execute_data)) { - phpdbg_print_opline(EG(current_execute_data), 1 TSRMLS_CC); + phpdbg_print_opline(EG(current_execute_data), 1); } else { phpdbg_error("inactive", "type=\"execution\"", "Not Executing!"); } @@ -50,7 +50,7 @@ PHPDBG_PRINT(opline) /* {{{ */ return SUCCESS; } /* }}} */ -static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) /* {{{ */ +static inline void phpdbg_print_function_helper(zend_function *method) /* {{{ */ { switch (method->type) { case ZEND_USER_FUNCTION: { @@ -79,7 +79,7 @@ static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) zend_hash_init(&vars, op_array->last, NULL, NULL, 0); do { - char *decode = phpdbg_decode_opline(op_array, opline, &vars TSRMLS_CC); + char *decode = phpdbg_decode_opline(op_array, opline, &vars); if (decode != NULL) { phpdbg_writeln("print", "line=\"%u\" opline=\"%p\" opcode=\"%s\" op=\"%s\"", "\t\tL%u\t%p %-30s %s", opline->lineno, @@ -110,13 +110,13 @@ PHPDBG_PRINT(exec) /* {{{ */ { if (PHPDBG_G(exec)) { if (!PHPDBG_G(ops) && !(PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER)) { - phpdbg_compile(TSRMLS_C); + phpdbg_compile(); } if (PHPDBG_G(ops)) { phpdbg_notice("printinfo", "file=\"%s\" num=\"%d\"", "Context %s (%d ops)", PHPDBG_G(exec), PHPDBG_G(ops)->last); - phpdbg_print_function_helper((zend_function*) PHPDBG_G(ops) TSRMLS_CC); + phpdbg_print_function_helper((zend_function*) PHPDBG_G(ops)); } } else { phpdbg_error("inactive", "type=\"nocontext\"", "No execution context set"); @@ -142,7 +142,7 @@ PHPDBG_PRINT(stack) /* {{{ */ phpdbg_notice("printinfo", "opline=\"%p\" num=\"%d\"", "Stack @ %p (%d ops)", ops, ops->last); } } - phpdbg_print_function_helper((zend_function*) ops TSRMLS_CC); + phpdbg_print_function_helper((zend_function*) ops); } else { phpdbg_error("inactive", "type=\"execution\"", "Not Executing!"); } @@ -154,7 +154,7 @@ PHPDBG_PRINT(class) /* {{{ */ { zend_class_entry *ce; - if (phpdbg_safe_class_lookup(param->str, param->len, &ce TSRMLS_CC) == SUCCESS) { + if (phpdbg_safe_class_lookup(param->str, param->len, &ce) == SUCCESS) { phpdbg_notice("printinfo", "type=\"%s\" flag=\"%s\" class=\"%s\" num=\"%d\"", "%s %s: %s (%d methods)", (ce->type == ZEND_USER_CLASS) ? "User" : "Internal", @@ -172,7 +172,7 @@ PHPDBG_PRINT(class) /* {{{ */ zend_function *method; ZEND_HASH_FOREACH_PTR(&ce->function_table, method) { - phpdbg_print_function_helper(method TSRMLS_CC); + phpdbg_print_function_helper(method); } ZEND_HASH_FOREACH_END(); } @@ -188,7 +188,7 @@ PHPDBG_PRINT(method) /* {{{ */ { zend_class_entry *ce; - if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce TSRMLS_CC) == SUCCESS) { + if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce) == SUCCESS) { zend_function *fbc; zend_string *lcname = zend_string_alloc(strlen(param->method.name), 0); zend_str_tolower_copy(lcname->val, param->method.name, lcname->len); @@ -199,7 +199,7 @@ PHPDBG_PRINT(method) /* {{{ */ fbc->common.function_name->val, (fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0); - phpdbg_print_function_helper(fbc TSRMLS_CC); + phpdbg_print_function_helper(fbc); } else { phpdbg_error("print", "type=\"nomethod\" method=\"%s::%s\"", "The method %s::%s could not be found", param->method.class, param->method.name); } @@ -248,7 +248,7 @@ PHPDBG_PRINT(func) /* {{{ */ fbc->common.function_name->val, (fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0); - phpdbg_print_function_helper(fbc TSRMLS_CC); + phpdbg_print_function_helper(fbc); } else { phpdbg_error("print", "type=\"nofunction\" function=\"%s\"", "The function %s could not be found", func_name); } diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index aa431a8ae0..6de08e038e 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -89,7 +89,7 @@ const phpdbg_command_t phpdbg_prompt_commands[] = { PHPDBG_END_COMMAND }; /* }}} */ -static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ */ +static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */ { phpdbg_param_t *name = NULL; @@ -113,7 +113,7 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ * ZVAL_STRINGL(&fci.function_name, lc_name, name->len); fci.size = sizeof(zend_fcall_info); fci.function_table = &PHPDBG_G(registered); - fci.symbol_table = zend_rebuild_symbol_table(TSRMLS_C); + fci.symbol_table = zend_rebuild_symbol_table(); fci.object = NULL; fci.retval = &fretval; fci.no_separation = 1; @@ -171,19 +171,19 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ * next = next->next; } - zend_fcall_info_args(&fci, ¶ms TSRMLS_CC); + zend_fcall_info_args(&fci, ¶ms); } else { fci.params = NULL; fci.param_count = 0; } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); phpdbg_debug("created %d params from arguments", fci.param_count); - if (zend_call_function(&fci, NULL TSRMLS_CC) == SUCCESS) { - zend_print_zval_r(&fretval, 0 TSRMLS_CC); + if (zend_call_function(&fci, NULL) == SUCCESS) { + zend_print_zval_r(&fretval, 0); phpdbg_out("\n"); zval_ptr_dtor(&fretval); } @@ -208,7 +208,7 @@ struct phpdbg_init_state { const char *init_file; }; -static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_DC) { +static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state) { size_t cmd_len = strlen(cmd); state->line++; @@ -228,7 +228,7 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D if (memcmp(cmd, ":>", sizeof(":>")-1) == SUCCESS) { state->in_code = 0; state->code[state->code_len] = '\0'; - zend_eval_stringl(state->code, state->code_len, NULL, "phpdbginit code" TSRMLS_CC); + zend_eval_stringl(state->code, state->code_len, NULL, "phpdbginit code"); free(state->code); state->code = NULL; return; @@ -252,33 +252,33 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D } zend_try { - char *input = phpdbg_read_input(cmd TSRMLS_CC); + char *input = phpdbg_read_input(cmd); phpdbg_param_t stack; phpdbg_init_param(&stack, STACK_PARAM); - phpdbg_activate_err_buf(1 TSRMLS_CC); + phpdbg_activate_err_buf(1); - if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) { - switch (phpdbg_stack_execute(&stack, 1 /* allow_async_unsafe == 1 */ TSRMLS_CC)) { + if (phpdbg_do_parse(&stack, input) <= 0) { + switch (phpdbg_stack_execute(&stack, 1 /* allow_async_unsafe == 1 */)) { case FAILURE: - phpdbg_activate_err_buf(0 TSRMLS_CC); - if (phpdbg_call_register(&stack TSRMLS_CC) == FAILURE) { + phpdbg_activate_err_buf(0); + if (phpdbg_call_register(&stack) == FAILURE) { if (state->init_file) { - phpdbg_output_err_buf("initfailure", "%b file=\"%s\" line=\"%d\" input=\"%s\"", "Unrecognized command in %s:%d: %s, %b!" TSRMLS_CC, state->init_file, state->line, input); + phpdbg_output_err_buf("initfailure", "%b file=\"%s\" line=\"%d\" input=\"%s\"", "Unrecognized command in %s:%d: %s, %b!", state->init_file, state->line, input); } else { - phpdbg_output_err_buf("initfailure", "%b line=\"%d\" input=\"%s\"", "Unrecognized command on line %d: %s, %b!" TSRMLS_CC, state->line, input); + phpdbg_output_err_buf("initfailure", "%b line=\"%d\" input=\"%s\"", "Unrecognized command on line %d: %s, %b!", state->line, input); } } break; } } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); phpdbg_stack_free(&stack); - phpdbg_destroy_input(&input TSRMLS_CC); + phpdbg_destroy_input(&input); } zend_catch { PHPDBG_G(flags) &= ~(PHPDBG_IS_RUNNING | PHPDBG_IS_CLEANING); if (PHPDBG_G(flags) & PHPDBG_IS_QUITTING) { @@ -289,12 +289,12 @@ static void phpdbg_line_init(char *cmd, struct phpdbg_init_state *state TSRMLS_D } -void phpdbg_string_init(char *buffer TSRMLS_DC) { +void phpdbg_string_init(char *buffer) { struct phpdbg_init_state state = {0}; char *str = strtok(buffer, "\n"); while (str) { - phpdbg_line_init(str, &state TSRMLS_CC); + phpdbg_line_init(str, &state); str = strtok(NULL, "\n"); } @@ -304,7 +304,7 @@ void phpdbg_string_init(char *buffer TSRMLS_DC) { } } -void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC) /* {{{ */ +void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init) /* {{{ */ { struct stat sb; @@ -317,7 +317,7 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_ state.init_file = init_file; while (fgets(cmd, PHPDBG_MAX_CMD, fp) != NULL) { - phpdbg_line_init(cmd, &state TSRMLS_CC); + phpdbg_line_init(cmd, &state); } if (state.code) { @@ -335,13 +335,13 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_ } } /* }}} */ -void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC) /* {{{ */ +void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /* {{{ */ { if (!init_file && use_default) { char *scan_dir = getenv("PHP_INI_SCAN_DIR"); int i; - phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0 TSRMLS_CC); + phpdbg_try_file_init(PHPDBG_STRL(PHP_CONFIG_FILE_PATH "/" PHPDBG_INIT_FILENAME), 0); if (!scan_dir) { scan_dir = PHP_CONFIG_FILE_SCAN_DIR; @@ -359,16 +359,16 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TS } asprintf(&init_file, "%s/%s", scan_dir, PHPDBG_INIT_FILENAME); - phpdbg_try_file_init(init_file, strlen(init_file), 1 TSRMLS_CC); + phpdbg_try_file_init(init_file, strlen(init_file), 1); if (i == -1) { break; } scan_dir += i + 1; } - phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0 TSRMLS_CC); + phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0); } else { - phpdbg_try_file_init(init_file, init_file_len, 1 TSRMLS_CC); + phpdbg_try_file_init(init_file, init_file_len, 1); } } @@ -378,12 +378,12 @@ PHPDBG_COMMAND(exec) /* {{{ */ if (VCWD_STAT(param->str, &sb) != FAILURE) { if (sb.st_mode & (S_IFREG|S_IFLNK)) { - char *res = phpdbg_resolve_path(param->str TSRMLS_CC); + char *res = phpdbg_resolve_path(param->str); size_t res_len = strlen(res); if ((res_len != PHPDBG_G(exec_len)) || (memcmp(res, PHPDBG_G(exec), res_len) != SUCCESS)) { if (PHPDBG_G(in_execution)) { - if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?" TSRMLS_CC) == FAILURE) { + if (phpdbg_ask_user_permission("Do you really want to stop execution to set a new execution context?") == FAILURE) { return FAILURE; } } @@ -397,7 +397,7 @@ PHPDBG_COMMAND(exec) /* {{{ */ if (PHPDBG_G(ops)) { phpdbg_notice("exec", "type=\"unsetops\"", "Destroying compiled opcodes"); - phpdbg_clean(0 TSRMLS_CC); + phpdbg_clean(0); } PHPDBG_G(exec) = res; @@ -406,15 +406,15 @@ PHPDBG_COMMAND(exec) /* {{{ */ VCWD_CHDIR_FILE(res); *SG(request_info).argv = PHPDBG_G(exec); - php_hash_environment(TSRMLS_C); + php_hash_environment(); phpdbg_notice("exec", "type=\"set\" context=\"%s\"", "Set execution context: %s", PHPDBG_G(exec)); if (PHPDBG_G(in_execution)) { - phpdbg_clean(1 TSRMLS_CC); + phpdbg_clean(1); } - phpdbg_compile(TSRMLS_C); + phpdbg_compile(); } else { phpdbg_notice("exec", "type=\"unchanged\"", "Execution context not changed"); } @@ -427,7 +427,7 @@ PHPDBG_COMMAND(exec) /* {{{ */ return SUCCESS; } /* }}} */ -int phpdbg_compile(TSRMLS_D) /* {{{ */ +int phpdbg_compile(void) /* {{{ */ { zend_file_handle fh; @@ -436,9 +436,9 @@ int phpdbg_compile(TSRMLS_D) /* {{{ */ return FAILURE; } - if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC) == SUCCESS) { - PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE TSRMLS_CC); - zend_destroy_file_handle(&fh TSRMLS_CC); + if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE) == SUCCESS) { + PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE); + zend_destroy_file_handle(&fh); phpdbg_notice("compile", "context=\"%s\"", "Successful compilation of %s", PHPDBG_G(exec)); @@ -487,7 +487,7 @@ PHPDBG_COMMAND(until) /* {{{ */ return PHPDBG_UNTIL; } /* }}} */ -static void phpdbg_seek_to_end(TSRMLS_D) { +static void phpdbg_seek_to_end(void) { const zend_op *opline = EG(current_execute_data)->opline; const zend_op_array *op_array = &EG(current_execute_data)->func->op_array - 1; @@ -513,7 +513,7 @@ PHPDBG_COMMAND(finish) /* {{{ */ } PHPDBG_G(flags) |= PHPDBG_IN_FINISH; - phpdbg_seek_to_end(TSRMLS_C); + phpdbg_seek_to_end(); return PHPDBG_FINISH; } /* }}} */ @@ -526,7 +526,7 @@ PHPDBG_COMMAND(leave) /* {{{ */ } PHPDBG_G(flags) |= PHPDBG_IN_LEAVE; - phpdbg_seek_to_end(TSRMLS_C); + phpdbg_seek_to_end(); return PHPDBG_LEAVE; } /* }}} */ @@ -536,20 +536,20 @@ PHPDBG_COMMAND(frame) /* {{{ */ if (!param) { phpdbg_notice("frame", "id=\"%d\"", "Currently in frame #%d", PHPDBG_G(frame).num); } else { - phpdbg_switch_frame(param->num TSRMLS_CC); + phpdbg_switch_frame(param->num); } return SUCCESS; } /* }}} */ -static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */ +static inline void phpdbg_handle_exception(void) /* }}} */ { zend_fcall_info fci; zval trace; /* get filename and linenumber before unsetting exception */ - const char *filename = zend_get_executed_filename(TSRMLS_C); - uint32_t lineno = zend_get_executed_lineno(TSRMLS_C); + const char *filename = zend_get_executed_filename(); + uint32_t lineno = zend_get_executed_lineno(); /* call __toString */ ZVAL_STRINGL(&fci.function_name, "__tostring", sizeof("__tostring") - 1); @@ -561,7 +561,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */ fci.param_count = 0; fci.params = NULL; fci.no_separation = 1; - if (zend_call_function(&fci, NULL TSRMLS_CC) == SUCCESS) { + if (zend_call_function(&fci, NULL) == SUCCESS) { phpdbg_writeln("exception", "name=\"%s\" trace=\"%.*s\"", "Uncaught %s!\n%.*s", EG(exception)->ce->name->val, Z_STRLEN(trace), Z_STRVAL(trace)); zval_ptr_dtor(&trace); @@ -573,7 +573,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */ phpdbg_writeln("exception", "opline=\"%p\" file=\"%s\" line=\"%u\"", "Stack entered at %p in %s on line %u", EG(current_execute_data)->func->op_array.opcodes, filename, lineno); zval_dtor(&fci.function_name); - zend_clear_exception(TSRMLS_C); + zend_clear_exception(); } /* }}} */ PHPDBG_COMMAND(run) /* {{{ */ @@ -583,15 +583,15 @@ PHPDBG_COMMAND(run) /* {{{ */ zend_bool restore = 1; if (PHPDBG_G(in_execution)) { - if (phpdbg_ask_user_permission("Do you really want to restart execution?" TSRMLS_CC) == SUCCESS) { + if (phpdbg_ask_user_permission("Do you really want to restart execution?") == SUCCESS) { phpdbg_startup_run++; - phpdbg_clean(1 TSRMLS_CC); + phpdbg_clean(1); } return SUCCESS; } if (!PHPDBG_G(ops)) { - if (phpdbg_compile(TSRMLS_C) == FAILURE) { + if (phpdbg_compile() == FAILURE) { phpdbg_error("compile", "type=\"compilefailure\" context=\"%s\"", "Failed to compile %s, cannot run", PHPDBG_G(exec)); goto out; } @@ -601,7 +601,7 @@ PHPDBG_COMMAND(run) /* {{{ */ if (ex && ex->symbol_table) { zend_hash_clean(&ex->symbol_table->ht); } else { - zend_rebuild_symbol_table(TSRMLS_C); + zend_rebuild_symbol_table(); } /* clean seek state */ @@ -609,7 +609,7 @@ PHPDBG_COMMAND(run) /* {{{ */ zend_hash_clean(&PHPDBG_G(seek)); /* reset hit counters */ - phpdbg_reset_breakpoints(TSRMLS_C); + phpdbg_reset_breakpoints(); if (param && param->type != EMPTY_PARAM && param->len != 0) { char **argv = emalloc(5 * sizeof(char *)); @@ -633,13 +633,13 @@ PHPDBG_COMMAND(run) /* {{{ */ SG(request_info).argv = erealloc(argv, ++argc * sizeof(char *)); SG(request_info).argc = argc; - php_hash_environment(TSRMLS_C); + php_hash_environment(); } zend_try { PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE; PHPDBG_G(flags) |= PHPDBG_IS_RUNNING; - zend_execute(PHPDBG_G(ops), &PHPDBG_G(retval) TSRMLS_CC); + zend_execute(PHPDBG_G(ops), &PHPDBG_G(retval)); PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE; } zend_catch { PHPDBG_G(in_execution) = 0; @@ -661,11 +661,11 @@ PHPDBG_COMMAND(run) /* {{{ */ if (restore) { if (EG(exception)) { - phpdbg_handle_exception(TSRMLS_C); + phpdbg_handle_exception(); } } - phpdbg_clean(1 TSRMLS_CC); + phpdbg_clean(1); PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING; } else { @@ -677,10 +677,10 @@ out: return SUCCESS; } /* }}} */ -int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv TSRMLS_DC) { +int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv) { phpdbg_notice("eval", "variable=\"%.*s\"", "Printing variable %.*s", (int) len, name); phpdbg_xml("<eval %r>"); - zend_print_zval_r(zv, 0 TSRMLS_CC); + zend_print_zval_r(zv, 0); phpdbg_xml("</eval>"); phpdbg_out("\n"); @@ -704,7 +704,7 @@ PHPDBG_COMMAND(ev) /* {{{ */ if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { phpdbg_try_access { - phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0 TSRMLS_CC); + phpdbg_parse_variable(param->str, param->len, &EG(symbol_table).ht, 0, phpdbg_output_ev_variable, 0); } phpdbg_catch_access { phpdbg_error("signalsegv", "", "Could not fetch data, invalid data source"); } phpdbg_end_try_access(); @@ -720,13 +720,13 @@ PHPDBG_COMMAND(ev) /* {{{ */ /* disable stepping while eval() in progress */ PHPDBG_G(flags) |= PHPDBG_IN_EVAL; zend_try { - if (zend_eval_stringl(param->str, param->len, &retval, "eval()'d code" TSRMLS_CC) == SUCCESS) { + if (zend_eval_stringl(param->str, param->len, &retval, "eval()'d code") == SUCCESS) { phpdbg_xml("<eval %r>"); if (PHPDBG_G(flags) & PHPDBG_WRITE_XML) { zval *zvp = &retval; - phpdbg_xml_var_dump(zvp TSRMLS_CC); + phpdbg_xml_var_dump(zvp); } - zend_print_zval_r(&retval, 0 TSRMLS_CC); + zend_print_zval_r(&retval, 0); phpdbg_xml("</eval>"); phpdbg_out("\n"); zval_ptr_dtor(&retval); @@ -760,9 +760,9 @@ PHPDBG_COMMAND(back) /* {{{ */ } if (!param) { - phpdbg_dump_backtrace(0 TSRMLS_CC); + phpdbg_dump_backtrace(0); } else { - phpdbg_dump_backtrace(param->num TSRMLS_CC); + phpdbg_dump_backtrace(param->num); } return SUCCESS; @@ -826,42 +826,42 @@ PHPDBG_COMMAND(break) /* {{{ */ { if (!param) { phpdbg_set_breakpoint_file( - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); + zend_get_executed_filename(), + zend_get_executed_lineno()); } else switch (param->type) { case ADDR_PARAM: - phpdbg_set_breakpoint_opline(param->addr TSRMLS_CC); + phpdbg_set_breakpoint_opline(param->addr); break; case NUMERIC_PARAM: if (PHPDBG_G(exec)) { - phpdbg_set_breakpoint_file(phpdbg_current_file(TSRMLS_C), param->num TSRMLS_CC); + phpdbg_set_breakpoint_file(phpdbg_current_file(), param->num); } else { phpdbg_error("inactive", "type=\"noexec\"", "Execution context not set!"); } break; case METHOD_PARAM: - phpdbg_set_breakpoint_method(param->method.class, param->method.name TSRMLS_CC); + phpdbg_set_breakpoint_method(param->method.class, param->method.name); break; case NUMERIC_METHOD_PARAM: - phpdbg_set_breakpoint_method_opline(param->method.class, param->method.name, param->num TSRMLS_CC); + phpdbg_set_breakpoint_method_opline(param->method.class, param->method.name, param->num); break; case NUMERIC_FUNCTION_PARAM: - phpdbg_set_breakpoint_function_opline(param->str, param->num TSRMLS_CC); + phpdbg_set_breakpoint_function_opline(param->str, param->num); break; case FILE_PARAM: - phpdbg_set_breakpoint_file(param->file.name, param->file.line TSRMLS_CC); + phpdbg_set_breakpoint_file(param->file.name, param->file.line); break; case NUMERIC_FILE_PARAM: - phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line TSRMLS_CC); + phpdbg_set_breakpoint_file_opline(param->file.name, param->file.line); break; case COND_PARAM: - phpdbg_set_breakpoint_expression(param->str, param->len TSRMLS_CC); + phpdbg_set_breakpoint_expression(param->str, param->len); break; case STR_PARAM: - phpdbg_set_breakpoint_symbol(param->str, param->len TSRMLS_CC); + phpdbg_set_breakpoint_symbol(param->str, param->len); break; case OP_PARAM: - phpdbg_set_breakpoint_opcode(param->str, param->len TSRMLS_CC); + phpdbg_set_breakpoint_opcode(param->str, param->len); break; phpdbg_default_switch_case(); @@ -883,17 +883,17 @@ PHPDBG_COMMAND(sh) /* {{{ */ return SUCCESS; } /* }}} */ -static int add_module_info(zend_module_entry *module TSRMLS_DC) { +static int add_module_info(zend_module_entry *module) { phpdbg_write("module", "name=\"%s\"", "%s\n", module->name); return 0; } -static int add_zendext_info(zend_extension *ext TSRMLS_DC) { +static int add_zendext_info(zend_extension *ext) { phpdbg_write("extension", "name=\"%s\"", "%s\n", ext->name); return 0; } -PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name TSRMLS_DC) { +PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) { DL_HANDLE handle; char *extension_dir; @@ -962,7 +962,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name *name = new_extension->name; - zend_register_extension(new_extension, handle TSRMLS_CC); + zend_register_extension(new_extension, handle); if (new_extension->startup) { if (new_extension->startup(new_extension) != SUCCESS) { @@ -1003,20 +1003,20 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name module_entry->module_number = zend_next_free_module(); module_entry->handle = handle; - if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) { + if ((module_entry = zend_register_module_ex(module_entry)) == NULL) { phpdbg_error("dl", "type=\"registerfailure\" module=\"%s\"", "Unable to register module %s", module_entry->name); goto quit; } - if (zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) { + if (zend_startup_module_ex(module_entry) == FAILURE) { phpdbg_error("dl", "type=\"startupfailure\" module=\"%s\"", "Unable to startup module %s", module_entry->name); goto quit; } if (module_entry->request_startup_func) { - if (module_entry->request_startup_func(MODULE_PERSISTENT, module_entry->module_number TSRMLS_CC) == FAILURE) { + if (module_entry->request_startup_func(MODULE_PERSISTENT, module_entry->module_number) == FAILURE) { phpdbg_error("dl", "type=\"initfailure\" module=\"%s\"", "Unable to initialize module %s", module_entry->name); goto quit; @@ -1040,24 +1040,24 @@ PHPDBG_COMMAND(dl) /* {{{ */ if (!param || param->type == EMPTY_PARAM) { phpdbg_notice("dl", "extensiontype=\"Zend extension\"", "Zend extensions"); - zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info TSRMLS_CC); + zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info); phpdbg_out("\n"); phpdbg_notice("dl", "extensiontype=\"module\"", "Modules"); - zend_hash_apply(&module_registry, (apply_func_t) add_module_info TSRMLS_CC); + zend_hash_apply(&module_registry, (apply_func_t) add_module_info); } else switch (param->type) { case STR_PARAM: #ifdef HAVE_LIBDL path = estrndup(param->str, param->len); - phpdbg_activate_err_buf(1 TSRMLS_CC); - if ((type = phpdbg_load_module_or_extension(&path, &name TSRMLS_CC)) == NULL) { + phpdbg_activate_err_buf(1); + if ((type = phpdbg_load_module_or_extension(&path, &name)) == NULL) { phpdbg_error("dl", "path=\"%s\" %b", "Could not load %s, not found or invalid zend extension / module: %b", path); efree(name); } else { phpdbg_notice("dl", "extensiontype=\"%s\" name=\"%s\" path=\"%s\"", "Successfully loaded the %s %s at path %s", type, name, path); } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); efree(path); #else phpdbg_error("dl", "type=\"unsupported\" path=\"%.*s\"", "Cannot dynamically load %.*s - dynamic modules are not supported", (int) param->len, param->str); @@ -1075,7 +1075,7 @@ PHPDBG_COMMAND(source) /* {{{ */ struct stat sb; if (VCWD_STAT(param->str, &sb) != -1) { - phpdbg_try_file_init(param->str, param->len, 0 TSRMLS_CC); + phpdbg_try_file_init(param->str, param->len, 0); } else { phpdbg_error("source", "type=\"notfound\" file=\"%s\"", "Failed to stat %s, file does not exist", param->str); } @@ -1088,7 +1088,7 @@ PHPDBG_COMMAND(export) /* {{{ */ FILE *handle = VCWD_FOPEN(param->str, "w+"); if (handle) { - phpdbg_export_breakpoints(handle TSRMLS_CC); + phpdbg_export_breakpoints(handle); fclose(handle); } else { phpdbg_error("export", "type=\"openfailure\" file=\"%s\"", "Failed to open or create %s, check path and permissions", param->str); @@ -1135,7 +1135,7 @@ PHPDBG_COMMAND(quit) /* {{{ */ PHPDBG_COMMAND(clean) /* {{{ */ { if (PHPDBG_G(in_execution)) { - if (phpdbg_ask_user_permission("Do you really want to clean your current environment?" TSRMLS_CC) == FAILURE) { + if (phpdbg_ask_user_permission("Do you really want to clean your current environment?") == FAILURE) { return SUCCESS; } } @@ -1150,7 +1150,7 @@ PHPDBG_COMMAND(clean) /* {{{ */ PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING; - phpdbg_clean(1 TSRMLS_CC); + phpdbg_clean(1); phpdbg_xml("</cleaninfo>"); @@ -1171,7 +1171,7 @@ PHPDBG_COMMAND(clear) /* {{{ */ phpdbg_writeln("clear", "methodoplines=\"%d\"", "Method oplines %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE])); phpdbg_writeln("clear", "eval=\"%d\"", "Conditionals %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_COND])); - phpdbg_clear_breakpoints(TSRMLS_C); + phpdbg_clear_breakpoints(); phpdbg_xml("</clearinfo>"); @@ -1190,7 +1190,7 @@ PHPDBG_COMMAND(list) /* {{{ */ return PHPDBG_LIST_HANDLER(lines)(PHPDBG_COMMAND_ARGS); case STR_PARAM: - phpdbg_list_function_byname(param->str, param->len TSRMLS_CC); + phpdbg_list_function_byname(param->str, param->len); break; case METHOD_PARAM: @@ -1205,10 +1205,10 @@ PHPDBG_COMMAND(list) /* {{{ */ PHPDBG_COMMAND(watch) /* {{{ */ { if (!param || param->type == EMPTY_PARAM) { - phpdbg_list_watchpoints(TSRMLS_C); + phpdbg_list_watchpoints(); } else switch (param->type) { case STR_PARAM: - if (phpdbg_create_var_watchpoint(param->str, param->len TSRMLS_CC) != FAILURE) { + if (phpdbg_create_var_watchpoint(param->str, param->len) != FAILURE) { phpdbg_notice("watch", "variable=\"%.*s\"", "Set watchpoint on %.*s", (int) param->len, param->str); } break; @@ -1219,7 +1219,7 @@ PHPDBG_COMMAND(watch) /* {{{ */ return SUCCESS; } /* }}} */ -int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ +int phpdbg_interactive(zend_bool allow_async_unsafe) /* {{{ */ { int ret = SUCCESS; char *input = NULL; @@ -1232,15 +1232,15 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ zend_bailout(); } - if (!(input = phpdbg_read_input(NULL TSRMLS_CC))) { + if (!(input = phpdbg_read_input(NULL))) { break; } phpdbg_init_param(&stack, STACK_PARAM); - if (phpdbg_do_parse(&stack, input TSRMLS_CC) <= 0) { - phpdbg_activate_err_buf(1 TSRMLS_CC); + if (phpdbg_do_parse(&stack, input) <= 0) { + phpdbg_activate_err_buf(1); #ifdef PHP_WIN32 #define PARA ((phpdbg_param_t *)stack.next)->type @@ -1248,11 +1248,11 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ sigio_watcher_start(); } #endif - switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe TSRMLS_CC)) { + switch (ret = phpdbg_stack_execute(&stack, allow_async_unsafe)) { case FAILURE: if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) { - if (!allow_async_unsafe || phpdbg_call_register(&stack TSRMLS_CC) == FAILURE) { - phpdbg_output_err_buf(NULL, "%b", "%b" TSRMLS_CC); + if (!allow_async_unsafe || phpdbg_call_register(&stack) == FAILURE) { + phpdbg_output_err_buf(NULL, "%b", "%b"); } } break; @@ -1261,8 +1261,8 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ case PHPDBG_FINISH: case PHPDBG_UNTIL: case PHPDBG_NEXT: { - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); if (!PHPDBG_G(in_execution) && !(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) { phpdbg_error("command", "type=\"noexec\"", "Not running"); } @@ -1270,8 +1270,8 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ } } - phpdbg_activate_err_buf(0 TSRMLS_CC); - phpdbg_free_err_buf(TSRMLS_C); + phpdbg_activate_err_buf(0); + phpdbg_free_err_buf(); #ifdef PHP_WIN32 if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE && (RUN_PARAM == PARA || EVAL_PARAM == PARA)) { sigio_watcher_stop(); @@ -1281,33 +1281,33 @@ int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC) /* {{{ */ } phpdbg_stack_free(&stack); - phpdbg_destroy_input(&input TSRMLS_CC); + phpdbg_destroy_input(&input); PHPDBG_G(req_id) = 0; input = NULL; } if (input) { phpdbg_stack_free(&stack); - phpdbg_destroy_input(&input TSRMLS_CC); + phpdbg_destroy_input(&input); PHPDBG_G(req_id) = 0; } if (PHPDBG_G(in_execution)) { - phpdbg_restore_frame(TSRMLS_C); + phpdbg_restore_frame(); } PHPDBG_G(flags) &= ~PHPDBG_IS_INTERACTIVE; - phpdbg_print_changed_zvals(TSRMLS_C); + phpdbg_print_changed_zvals(); return ret; } /* }}} */ -void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */ +void phpdbg_clean(zend_bool full) /* {{{ */ { /* this is implicitly required */ if (PHPDBG_G(ops)) { - destroy_op_array(PHPDBG_G(ops) TSRMLS_CC); + destroy_op_array(PHPDBG_G(ops)); efree(PHPDBG_G(ops)); PHPDBG_G(ops) = NULL; } @@ -1321,13 +1321,13 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */ #define DO_INTERACTIVE(allow_async_unsafe) do { \ if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { \ - const char *file_char = zend_get_executed_filename(TSRMLS_C); \ + const char *file_char = zend_get_executed_filename(); \ zend_string *file = zend_string_init(file_char, strlen(file_char), 0); \ - phpdbg_list_file(file, 3, zend_get_executed_lineno(TSRMLS_C)-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC); \ + phpdbg_list_file(file, 3, zend_get_executed_lineno()-1, zend_get_executed_lineno()); \ efree(file); \ } \ \ - switch (phpdbg_interactive(allow_async_unsafe TSRMLS_CC)) { \ + switch (phpdbg_interactive(allow_async_unsafe)) { \ case PHPDBG_LEAVE: \ case PHPDBG_FINISH: \ case PHPDBG_UNTIL: \ @@ -1337,7 +1337,7 @@ void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */ } \ } while (0) -void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ +void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */ { zend_bool original_in_execution = PHPDBG_G(in_execution); HashTable vars; @@ -1353,7 +1353,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ while (1) { if ((PHPDBG_G(flags) & PHPDBG_BP_RESOLVE_MASK)) { /* resolve nth opline breakpoints */ - phpdbg_resolve_op_array_breaks(&execute_data->func->op_array TSRMLS_CC); + phpdbg_resolve_op_array_breaks(&execute_data->func->op_array); } #ifdef ZEND_WIN32 @@ -1402,8 +1402,8 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ PHPDBG_G(flags) &= ~PHPDBG_IN_LEAVE; zend_hash_clean(&PHPDBG_G(seek)); phpdbg_notice("breakpoint", "id=\"leave\" file=\"%s\" line=\"%u\"", "Breaking for leave at %s:%u", - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C) + zend_get_executed_filename(), + zend_get_executed_lineno() ); DO_INTERACTIVE(1); } else { @@ -1414,7 +1414,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ } /* not while in conditionals */ - phpdbg_print_opline_ex(execute_data, &vars, 0 TSRMLS_CC); + phpdbg_print_opline_ex(execute_data, &vars, 0); if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING && (PHPDBG_G(flags) & PHPDBG_STEP_OPCODE || execute_data->opline->lineno != PHPDBG_G(last_line))) { PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING; @@ -1423,7 +1423,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ /* check if some watchpoint was hit */ { - if (phpdbg_print_changed_zvals(TSRMLS_C) == SUCCESS) { + if (phpdbg_print_changed_zvals() == SUCCESS) { DO_INTERACTIVE(1); } } @@ -1433,9 +1433,9 @@ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ phpdbg_breakbase_t *brake; if ((PHPDBG_G(flags) & PHPDBG_BP_MASK) - && (brake = phpdbg_find_breakpoint(execute_data TSRMLS_CC)) + && (brake = phpdbg_find_breakpoint(execute_data)) && (brake->type != PHPDBG_BREAK_FILE || execute_data->opline->lineno != PHPDBG_G(last_line))) { - phpdbg_hit_breakpoint(brake, 1 TSRMLS_CC); + phpdbg_hit_breakpoint(brake, 1); DO_INTERACTIVE(1); } } @@ -1456,7 +1456,7 @@ next: if (execute_data->opline->opcode == ZEND_DO_FCALL && execute_data->func->type == ZEND_USER_FUNCTION) { zend_execute_ex = execute_ex; } - PHPDBG_G(vmret) = execute_data->opline->handler(execute_data TSRMLS_CC); + PHPDBG_G(vmret) = execute_data->opline->handler(execute_data); zend_execute_ex = phpdbg_execute_ex; if (PHPDBG_G(vmret) != 0) { @@ -1473,7 +1473,7 @@ next: } /* }}} */ /* only if *not* interactive and while executing */ -void phpdbg_force_interruption(TSRMLS_D) { +void phpdbg_force_interruption(void) { zend_execute_data *data = EG(current_execute_data); /* should be always readable if not NULL */ PHPDBG_G(flags) |= PHPDBG_IN_SIGNAL_HANDLER; @@ -1504,7 +1504,7 @@ PHPDBG_COMMAND(eol) /* {{{ */ phpdbg_notice("eol", "argument required", "argument required"); } else switch (param->type) { case STR_PARAM: - if (FAILURE == phpdbg_eol_global_update(param->str TSRMLS_CC)) { + if (FAILURE == phpdbg_eol_global_update(param->str)) { phpdbg_notice("eol", "unknown EOL name '%s', give crlf, lf, cr", "unknown EOL name '%s', give crlf, lf, cr", param->str); } break; diff --git a/sapi/phpdbg/phpdbg_prompt.h b/sapi/phpdbg/phpdbg_prompt.h index f583f2cdcd..3bd30c6279 100644 --- a/sapi/phpdbg/phpdbg_prompt.h +++ b/sapi/phpdbg/phpdbg_prompt.h @@ -22,13 +22,13 @@ #define PHPDBG_PROMPT_H /* {{{ */ -void phpdbg_string_init(char *buffer TSRMLS_DC); -void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default TSRMLS_DC); -void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init TSRMLS_DC); -int phpdbg_interactive(zend_bool allow_async_unsafe TSRMLS_DC); -int phpdbg_compile(TSRMLS_D); -void phpdbg_clean(zend_bool full TSRMLS_DC); -void phpdbg_force_interruption(TSRMLS_D); +void phpdbg_string_init(char *buffer); +void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default); +void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_init); +int phpdbg_interactive(zend_bool allow_async_unsafe); +int phpdbg_compile(void); +void phpdbg_clean(zend_bool full); +void phpdbg_force_interruption(void); /* }}} */ /* {{{ phpdbg command handlers */ @@ -65,9 +65,9 @@ extern const phpdbg_command_t phpdbg_prompt_commands[]; /* }}} */ /* {{{ */ #if PHP_VERSION_ID >= 50500 -void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC); +void phpdbg_execute_ex(zend_execute_data *execute_data); #else -void phpdbg_execute_ex(zend_op_array *op_array TSRMLS_DC); +void phpdbg_execute_ex(zend_op_array *op_array); #endif /* }}} */ #endif /* PHPDBG_PROMPT_H */ diff --git a/sapi/phpdbg/phpdbg_rinit_hook.c b/sapi/phpdbg/phpdbg_rinit_hook.c index ab976c4ddb..d6d136b466 100644 --- a/sapi/phpdbg/phpdbg_rinit_hook.c +++ b/sapi/phpdbg/phpdbg_rinit_hook.c @@ -68,18 +68,18 @@ static PHP_RINIT_FUNCTION(phpdbg_webhelper) /* {{{ */ char *msg = NULL; char msglen[5] = {0}; - phpdbg_webdata_compress(&msg, (int *)msglen TSRMLS_CC); + phpdbg_webdata_compress(&msg, (int *)msglen); send(s, msglen, 4, 0); send(s, msg, *(int *) msglen, 0); while ((buflen = recv(s, buf, sizeof(buf) - 1, 0)) > 0) { - php_write(buf, buflen TSRMLS_CC); + php_write(buf, buflen); } close(s); - php_output_flush_all(TSRMLS_C); + php_output_flush_all(); zend_bailout(); } #endif diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c index 82b9f69f7a..2428f2b735 100644 --- a/sapi/phpdbg/phpdbg_set.c +++ b/sapi/phpdbg/phpdbg_set.c @@ -48,9 +48,9 @@ const phpdbg_command_t phpdbg_set_commands[] = { PHPDBG_SET(prompt) /* {{{ */ { if (!param || param->type == EMPTY_PARAM) { - phpdbg_writeln("setprompt", "str=\"%s\"", "Current prompt: %s", phpdbg_get_prompt(TSRMLS_C)); + phpdbg_writeln("setprompt", "str=\"%s\"", "Current prompt: %s", phpdbg_get_prompt()); } else { - phpdbg_set_prompt(param->str TSRMLS_CC); + phpdbg_set_prompt(param->str); } return SUCCESS; @@ -62,12 +62,12 @@ PHPDBG_SET(break) /* {{{ */ case NUMERIC_PARAM: { if (param->next) { if (param->next->num) { - phpdbg_enable_breakpoint(param->num TSRMLS_CC); + phpdbg_enable_breakpoint(param->num); } else { - phpdbg_disable_breakpoint(param->num TSRMLS_CC); + phpdbg_disable_breakpoint(param->num); } } else { - phpdbg_breakbase_t *brake = phpdbg_find_breakbase(param->num TSRMLS_CC); + phpdbg_breakbase_t *brake = phpdbg_find_breakbase(param->num); if (brake) { phpdbg_writeln("setbreak", "id=\"%ld\" active=\"%s\"", "Breakpoint #%ld %s", param->num, brake->disabled ? "off" : "on"); } else { @@ -90,9 +90,9 @@ PHPDBG_SET(breaks) /* {{{ */ } else switch (param->type) { case NUMERIC_PARAM: { if (param->num) { - phpdbg_enable_breakpoints(TSRMLS_C); + phpdbg_enable_breakpoints(); } else { - phpdbg_disable_breakpoints(TSRMLS_C); + phpdbg_disable_breakpoints(); } } break; @@ -106,31 +106,31 @@ PHPDBG_SET(breaks) /* {{{ */ #ifndef _WIN32 PHPDBG_SET(color) /* {{{ */ { - const phpdbg_color_t *color = phpdbg_get_color(param->next->str, param->next->len TSRMLS_CC); + const phpdbg_color_t *color = phpdbg_get_color(param->next->str, param->next->len); if (!color) { phpdbg_error("setcolor", "type=\"nocolor\"", "Failed to find the requested color (%s)", param->next->str); return SUCCESS; } - switch (phpdbg_get_element(param->str, param->len TSRMLS_CC)) { + switch (phpdbg_get_element(param->str, param->len)) { case PHPDBG_COLOR_PROMPT: phpdbg_notice("setcolor", "type=\"prompt\" color=\"%s\" code=\"%s\"", "setting prompt color to %s (%s)", color->name, color->code); if (PHPDBG_G(prompt)[1]) { free(PHPDBG_G(prompt)[1]); PHPDBG_G(prompt)[1]=NULL; } - phpdbg_set_color(PHPDBG_COLOR_PROMPT, color TSRMLS_CC); + phpdbg_set_color(PHPDBG_COLOR_PROMPT, color); break; case PHPDBG_COLOR_ERROR: phpdbg_notice("setcolor", "type=\"error\" color=\"%s\" code=\"%s\"", "setting error color to %s (%s)", color->name, color->code); - phpdbg_set_color(PHPDBG_COLOR_ERROR, color TSRMLS_CC); + phpdbg_set_color(PHPDBG_COLOR_ERROR, color); break; case PHPDBG_COLOR_NOTICE: phpdbg_notice("setcolor", "type=\"notice\" color=\"%s\" code=\"%s\"", "setting notice color to %s (%s)", color->name, color->code); - phpdbg_set_color(PHPDBG_COLOR_NOTICE, color TSRMLS_CC); + phpdbg_set_color(PHPDBG_COLOR_NOTICE, color); break; default: diff --git a/sapi/phpdbg/phpdbg_sigio_win32.c b/sapi/phpdbg/phpdbg_sigio_win32.c index 158e034872..97e858f311 100644 --- a/sapi/phpdbg/phpdbg_sigio_win32.c +++ b/sapi/phpdbg/phpdbg_sigio_win32.c @@ -36,7 +36,7 @@ SigIoWatcherThread(VOID *p) #endif top: - (void)phpdbg_consume_bytes(swd->fd, &sig, 1, -1 TSRMLS_CC); + (void)phpdbg_consume_bytes(swd->fd, &sig, 1, -1); if (3 == sig) { @@ -47,11 +47,11 @@ top: } } if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) { - phpdbg_set_sigsafe_mem(&sig TSRMLS_CC); + phpdbg_set_sigsafe_mem(&sig); zend_try { - phpdbg_force_interruption(TSRMLS_C); + phpdbg_force_interruption(); } zend_end_try(); - phpdbg_clear_sigsafe_mem(TSRMLS_C); + phpdbg_clear_sigsafe_mem(); goto end; } if (!(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) { @@ -72,7 +72,6 @@ session. */ void sigio_watcher_start(void) { - TSRMLS_FETCH(); PHPDBG_G(swd).fd = PHPDBG_G(io)[PHPDBG_STDIN].fd; #ifdef ZTS @@ -92,7 +91,6 @@ void sigio_watcher_stop(void) { DWORD waited; - TSRMLS_FETCH(); if (INVALID_HANDLE_VALUE == PHPDBG_G(sigio_watcher_thread)) { /* it probably did bail out already */ diff --git a/sapi/phpdbg/phpdbg_sigsafe.c b/sapi/phpdbg/phpdbg_sigsafe.c index 1ca7bf230c..ce321595b1 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.c +++ b/sapi/phpdbg/phpdbg_sigsafe.c @@ -7,7 +7,6 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); #define EXP_STR(x) STR(x) static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t alignment) { - TSRMLS_FETCH(); if (EXPECTED(size == PHPDBG_SIGSAFE_MEM_SIZE && !PHPDBG_G(sigsafe_mem).allocated)) { PHPDBG_G(sigsafe_mem).allocated = 1; @@ -28,7 +27,7 @@ static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t ali static void zend_mm_mem_free(zend_mm_storage *storage, void *ptr, size_t size) { } -void phpdbg_set_sigsafe_mem(char *buffer TSRMLS_DC) { +void phpdbg_set_sigsafe_mem(char *buffer) { phpdbg_signal_safe_mem *mem = &PHPDBG_G(sigsafe_mem); mem->mem = buffer; mem->allocated = 0; @@ -38,19 +37,19 @@ void phpdbg_set_sigsafe_mem(char *buffer TSRMLS_DC) { mem->heap = zend_mm_startup_ex(&mem->storage); - mem->old_heap = zend_mm_set_heap(mem->heap TSRMLS_CC); + mem->old_heap = zend_mm_set_heap(mem->heap); } -zend_mm_heap *phpdbg_original_heap_sigsafe_mem(TSRMLS_D) { +zend_mm_heap *phpdbg_original_heap_sigsafe_mem(void) { return PHPDBG_G(sigsafe_mem).old_heap; } -void phpdbg_clear_sigsafe_mem(TSRMLS_D) { - zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem(TSRMLS_C) TSRMLS_CC); +void phpdbg_clear_sigsafe_mem(void) { + zend_mm_set_heap(phpdbg_original_heap_sigsafe_mem()); PHPDBG_G(sigsafe_mem).mem = NULL; } -zend_bool phpdbg_active_sigsafe_mem(TSRMLS_D) { +zend_bool phpdbg_active_sigsafe_mem(void) { return !!PHPDBG_G(sigsafe_mem).mem; } diff --git a/sapi/phpdbg/phpdbg_sigsafe.h b/sapi/phpdbg/phpdbg_sigsafe.h index 9ef723fdca..d8a195f266 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.h +++ b/sapi/phpdbg/phpdbg_sigsafe.h @@ -18,11 +18,11 @@ typedef struct { #include "phpdbg.h" -zend_bool phpdbg_active_sigsafe_mem(TSRMLS_D); +zend_bool phpdbg_active_sigsafe_mem(void); -void phpdbg_set_sigsafe_mem(char *mem TSRMLS_DC); -void phpdbg_clear_sigsafe_mem(TSRMLS_D); +void phpdbg_set_sigsafe_mem(char *mem); +void phpdbg_clear_sigsafe_mem(void); -zend_mm_heap *phpdbg_original_heap_sigsafe_mem(TSRMLS_D); +zend_mm_heap *phpdbg_original_heap_sigsafe_mem(void); #endif diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c index bff971d4cf..ee938f5c0d 100644 --- a/sapi/phpdbg/phpdbg_utils.c +++ b/sapi/phpdbg/phpdbg_utils.c @@ -140,20 +140,20 @@ PHPDBG_API int phpdbg_is_class_method(const char *str, size_t len, char **class, return 1; } /* }}} */ -PHPDBG_API char *phpdbg_resolve_path(const char *path TSRMLS_DC) /* {{{ */ +PHPDBG_API char *phpdbg_resolve_path(const char *path) /* {{{ */ { char resolved_name[MAXPATHLEN]; - if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL) { + if (expand_filepath(path, resolved_name) == NULL) { return NULL; } return estrdup(resolved_name); } /* }}} */ -PHPDBG_API const char *phpdbg_current_file(TSRMLS_D) /* {{{ */ +PHPDBG_API const char *phpdbg_current_file(void) /* {{{ */ { - const char *file = zend_get_executed_filename(TSRMLS_C); + const char *file = zend_get_executed_filename(); if (memcmp(file, "[no active file]", sizeof("[no active file]")) == 0) { return PHPDBG_G(exec); @@ -162,7 +162,7 @@ PHPDBG_API const char *phpdbg_current_file(TSRMLS_D) /* {{{ */ return file; } /* }}} */ -PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const char *cname TSRMLS_DC) /* {{{ */ +PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const char *cname) /* {{{ */ { zend_function *func = NULL; zend_string *lfname = zend_string_alloc(strlen(fname), 0); @@ -172,7 +172,7 @@ PHPDBG_API const zend_function *phpdbg_get_function(const char *fname, const cha zend_class_entry *ce; zend_string *lcname = zend_string_alloc(strlen(cname), 0); memcpy(lcname->val, zend_str_tolower_dup(cname, lcname->len), lcname->len + 1); - ce = zend_lookup_class(lcname TSRMLS_CC); + ce = zend_lookup_class(lcname); efree(lcname); @@ -217,7 +217,7 @@ PHPDBG_API char *phpdbg_trim(const char *str, size_t len, size_t *new_len) /* {{ } /* }}} */ -PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC) /* {{{ */ +PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length) /* {{{ */ { const phpdbg_color_t *color = colors; @@ -235,26 +235,26 @@ PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_ return NULL; } /* }}} */ -PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color) /* {{{ */ { PHPDBG_G(colors)[element] = color; } /* }}} */ -PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length) /* {{{ */ { - const phpdbg_color_t *color = phpdbg_get_color(name, name_length TSRMLS_CC); + const phpdbg_color_t *color = phpdbg_get_color(name, name_length); if (color) { - phpdbg_set_color(element, color TSRMLS_CC); + phpdbg_set_color(element, color); } else PHPDBG_G(colors)[element] = colors; } /* }}} */ -PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(TSRMLS_D) /* {{{ */ +PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(void) /* {{{ */ { return colors; } /* }}} */ -PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC) { +PHPDBG_API int phpdbg_get_element(const char *name, size_t len) { const phpdbg_element_t *element = elements; while (element && element->name) { @@ -269,7 +269,7 @@ PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC) { return PHPDBG_COLOR_INVALID; } -PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */ +PHPDBG_API void phpdbg_set_prompt(const char *prompt) /* {{{ */ { /* free formatted prompt */ if (PHPDBG_G(prompt)[1]) { @@ -286,7 +286,7 @@ PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */ PHPDBG_G(prompt)[0] = strdup(prompt); } /* }}} */ -PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */ +PHPDBG_API const char *phpdbg_get_prompt(void) /* {{{ */ { /* find cached prompt */ if (PHPDBG_G(prompt)[1]) { @@ -312,13 +312,13 @@ PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */ return PHPDBG_G(prompt)[1]; } /* }}} */ -int phpdbg_rebuild_symtable(TSRMLS_D) { +int phpdbg_rebuild_symtable(void) { if (!EG(current_execute_data) || !EG(current_execute_data)->func) { phpdbg_error("inactive", "type=\"op_array\"", "No active op array!"); return FAILURE; } - if (!zend_rebuild_symbol_table(TSRMLS_C)) { + if (!zend_rebuild_symbol_table()) { phpdbg_error("inactive", "type=\"symbol_table\"", "No active symbol table!"); return FAILURE; } @@ -326,7 +326,7 @@ int phpdbg_rebuild_symtable(TSRMLS_D) { return SUCCESS; } -PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D) /* {{{ */ +PHPDBG_API int phpdbg_get_terminal_width(void) /* {{{ */ { int columns; #ifdef _WIN32 @@ -353,7 +353,7 @@ PHPDBG_API void phpdbg_set_async_io(int fd) { #endif } -int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce TSRMLS_DC) { +int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce) { if (PHPDBG_G(flags) & PHPDBG_IN_SIGNAL_HANDLER) { char *lc_name, *lc_free; int lc_length; @@ -380,7 +380,7 @@ int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry efree(lc_free); } else { zend_string *str_name = zend_string_init(name, name_length, 0); - *ce = zend_lookup_class(str_name TSRMLS_CC); + *ce = zend_lookup_class(str_name); efree(str_name); } @@ -394,15 +394,15 @@ char *phpdbg_get_property_key(char *key) { return strchr(key + 1, 0) + 1; } -static int phpdbg_parse_variable_arg_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, phpdbg_parse_var_func callback TSRMLS_DC) { - return callback(name, len, keyname, keylen, parent, zv TSRMLS_CC); +static int phpdbg_parse_variable_arg_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, phpdbg_parse_var_func callback) { + return callback(name, len, keyname, keylen, parent, zv); } -PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent TSRMLS_DC) { - return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_parse_variable_arg_wrapper, silent, callback TSRMLS_CC); +PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent) { + return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_parse_variable_arg_wrapper, silent, callback); } -PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, zend_bool silent, void *arg TSRMLS_DC) { +PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, zend_bool silent, void *arg) { int ret = FAILURE; zend_bool new_index = 1; char *last_index; @@ -468,11 +468,11 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable efree(key); } - ret = callback(name, namelen, keyname, index_len, parent, zv, arg TSRMLS_CC) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE; + ret = callback(name, namelen, keyname, index_len, parent, zv, arg) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE; } else if (Z_TYPE_P(zv) == IS_OBJECT) { - phpdbg_parse_variable_with_arg(input, len, Z_OBJPROP_P(zv), i, callback, silent, arg TSRMLS_CC); + phpdbg_parse_variable_with_arg(input, len, Z_OBJPROP_P(zv), i, callback, silent, arg); } else if (Z_TYPE_P(zv) == IS_ARRAY) { - phpdbg_parse_variable_with_arg(input, len, Z_ARRVAL_P(zv), i, callback, silent, arg TSRMLS_CC); + phpdbg_parse_variable_with_arg(input, len, Z_ARRVAL_P(zv), i, callback, silent, arg); } else { /* Ignore silently */ } @@ -496,7 +496,7 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable char *name = estrndup(input, len); char *keyname = estrndup(last_index, index_len); - ret = callback(name, len, keyname, index_len, parent, zv, arg TSRMLS_CC) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE; + ret = callback(name, len, keyname, index_len, parent, zv, arg) == SUCCESS || ret == SUCCESS?SUCCESS:FAILURE; } else if (Z_TYPE_P(zv) == IS_OBJECT) { parent = Z_OBJPROP_P(zv); } else if (Z_TYPE_P(zv) == IS_ARRAY) { @@ -515,15 +515,15 @@ PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable return FAILURE; } -int phpdbg_is_auto_global(char *name, int len TSRMLS_DC) { +int phpdbg_is_auto_global(char *name, int len) { int ret; zend_string *str = zend_string_init(name, len, 0); - ret = zend_is_auto_global(str TSRMLS_CC); + ret = zend_is_auto_global(str); efree(str); return ret; } -static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC) { +static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong num) { phpdbg_xml("<element"); phpdbg_try_access { @@ -539,14 +539,14 @@ static int phpdbg_xml_array_element_dump(zval *zv, zend_string *key, zend_ulong phpdbg_xml(">"); - phpdbg_xml_var_dump(zv TSRMLS_CC); + phpdbg_xml_var_dump(zv); phpdbg_xml("</element>"); return 0; } -static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC) { +static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulong num) { phpdbg_xml("<property"); phpdbg_try_access { @@ -574,7 +574,7 @@ static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulon phpdbg_xml(">"); - phpdbg_xml_var_dump(zv TSRMLS_CC); + phpdbg_xml_var_dump(zv); phpdbg_xml("</property>"); @@ -583,12 +583,12 @@ static int phpdbg_xml_object_property_dump(zval *zv, zend_string *key, zend_ulon #define COMMON (is_ref ? "&" : "") -PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) { +PHPDBG_API void phpdbg_xml_var_dump(zval *zv) { HashTable *myht; zend_string *class_name, *key; zend_ulong num; zval *val; - int (*element_dump_func)(zval *zv, zend_string *key, zend_ulong num TSRMLS_DC); + int (*element_dump_func)(zval *zv, zend_string *key, zend_ulong num); zend_bool is_ref = 0; int is_temp; @@ -635,7 +635,7 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) { break; } - class_name = Z_OBJ_HANDLER_P(zv, get_class_name)(Z_OBJ_P(zv) TSRMLS_CC); + class_name = Z_OBJ_HANDLER_P(zv, get_class_name)(Z_OBJ_P(zv)); phpdbg_xml("<object refstatus=\"%s\" class=\"%.*s\" id=\"%d\" num=\"%d\">", COMMON, class_name->len, class_name->val, Z_OBJ_HANDLE_P(zv), myht ? zend_hash_num_elements(myht) : 0); zend_string_release(class_name); @@ -643,9 +643,9 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC) { head_done: if (myht) { ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) { - element_dump_func(val, key, num TSRMLS_CC); + element_dump_func(val, key, num); } ZEND_HASH_FOREACH_END(); - zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) element_dump_func, 0); + zend_hash_apply_with_arguments(myht, (apply_func_args_t) element_dump_func, 0); --myht->u.v.nApplyCount; if (is_temp) { zend_hash_destroy(myht); @@ -659,7 +659,7 @@ head_done: } break; case IS_RESOURCE: { - const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(zv) TSRMLS_CC); + const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(zv)); phpdbg_xml("<resource refstatus=\"%s\" id=\"%pd\" type=\"%ld\" />", COMMON, Z_RES_P(zv)->handle, type_name ? type_name : "unknown"); break; } diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h index feb5470b69..a349cd1acf 100644 --- a/sapi/phpdbg/phpdbg_utils.h +++ b/sapi/phpdbg/phpdbg_utils.h @@ -28,10 +28,10 @@ PHPDBG_API int phpdbg_is_numeric(const char*); PHPDBG_API int phpdbg_is_empty(const char*); PHPDBG_API int phpdbg_is_addr(const char*); PHPDBG_API int phpdbg_is_class_method(const char*, size_t, char**, char**); -PHPDBG_API const char *phpdbg_current_file(TSRMLS_D); -PHPDBG_API char *phpdbg_resolve_path(const char* TSRMLS_DC); +PHPDBG_API const char *phpdbg_current_file(void); +PHPDBG_API char *phpdbg_resolve_path(const char*); PHPDBG_API char *phpdbg_trim(const char*, size_t, size_t*); -PHPDBG_API const zend_function *phpdbg_get_function(const char*, const char* TSRMLS_DC); +PHPDBG_API const zend_function *phpdbg_get_function(const char*, const char*); /* {{{ Color Management */ #define PHPDBG_COLOR_LEN 12 @@ -63,36 +63,36 @@ typedef struct _phpdbg_element_t { int id; } phpdbg_element_t; -PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC); -PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color TSRMLS_DC); -PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length TSRMLS_DC); -PHPDBG_API const phpdbg_color_t *phpdbg_get_colors(TSRMLS_D); -PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC); /* }}} */ +PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length); +PHPDBG_API void phpdbg_set_color(int element, const phpdbg_color_t *color); +PHPDBG_API void phpdbg_set_color_ex(int element, const char *name, size_t name_length); +PHPDBG_API const phpdbg_color_t *phpdbg_get_colors(void); +PHPDBG_API int phpdbg_get_element(const char *name, size_t len); /* }}} */ /* {{{ Prompt Management */ -PHPDBG_API void phpdbg_set_prompt(const char* TSRMLS_DC); -PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D); /* }}} */ +PHPDBG_API void phpdbg_set_prompt(const char*); +PHPDBG_API const char *phpdbg_get_prompt(void); /* }}} */ /* {{{ Console Width */ -PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D); /* }}} */ +PHPDBG_API int phpdbg_get_terminal_width(void); /* }}} */ PHPDBG_API void phpdbg_set_async_io(int fd); -int phpdbg_rebuild_symtable(TSRMLS_D); +int phpdbg_rebuild_symtable(void); -int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce TSRMLS_DC); +int phpdbg_safe_class_lookup(const char *name, int name_length, zend_class_entry **ce); char *phpdbg_get_property_key(char *key); -typedef int (*phpdbg_parse_var_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv TSRMLS_DC); -typedef int (*phpdbg_parse_var_with_arg_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, void *arg TSRMLS_DC); +typedef int (*phpdbg_parse_var_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv); +typedef int (*phpdbg_parse_var_with_arg_func)(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, void *arg); -PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent TSRMLS_DC); -PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, zend_bool silent, void *arg TSRMLS_DC); +PHPDBG_API int phpdbg_parse_variable(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_func callback, zend_bool silent); +PHPDBG_API int phpdbg_parse_variable_with_arg(char *input, size_t len, HashTable *parent, size_t i, phpdbg_parse_var_with_arg_func callback, zend_bool silent, void *arg); -int phpdbg_is_auto_global(char *name, int len TSRMLS_DC); +int phpdbg_is_auto_global(char *name, int len); -PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC); +PHPDBG_API void phpdbg_xml_var_dump(zval *zv); #ifdef ZTS #define PHPDBG_OUTPUT_BACKUP_DEFINES() \ @@ -109,14 +109,14 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv TSRMLS_DC); #define PHPDBG_OUTPUT_BACKUP_SWAP() \ original_output_globals = *output_globals_ptr; \ memset(output_globals_ptr, 0, sizeof(zend_output_globals)); \ - php_output_activate(TSRMLS_C); + php_output_activate(); #define PHPDBG_OUTPUT_BACKUP() \ PHPDBG_OUTPUT_BACKUP_DEFINES() \ PHPDBG_OUTPUT_BACKUP_SWAP() #define PHPDBG_OUTPUT_BACKUP_RESTORE() \ - php_output_deactivate(TSRMLS_C); \ + php_output_deactivate(); \ *output_globals_ptr = original_output_globals; #endif /* PHPDBG_UTILS_H */ diff --git a/sapi/phpdbg/phpdbg_wait.c b/sapi/phpdbg/phpdbg_wait.c index a76dda88e4..62105d882d 100644 --- a/sapi/phpdbg/phpdbg_wait.c +++ b/sapi/phpdbg/phpdbg_wait.c @@ -23,7 +23,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -static void phpdbg_rebuild_http_globals_array(int type, const char *name TSRMLS_DC) { +static void phpdbg_rebuild_http_globals_array(int type, const char *name) { zval *zvp; if (Z_TYPE(PG(http_globals)[type]) != IS_UNDEF) { zval_dtor(&PG(http_globals)[type]); @@ -35,7 +35,7 @@ static void phpdbg_rebuild_http_globals_array(int type, const char *name TSRMLS_ } -static int phpdbg_dearm_autoglobals(zend_auto_global *auto_global TSRMLS_DC) { +static int phpdbg_dearm_autoglobals(zend_auto_global *auto_global) { if (auto_global->name->len != sizeof("GLOBALS") - 1 || memcmp(auto_global->name->val, "GLOBALS", sizeof("GLOBALS") - 1)) { auto_global->armed = 0; } @@ -48,7 +48,7 @@ typedef struct { HashPosition pos[2]; } phpdbg_intersect_ptr; -static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) { +static int phpdbg_array_data_compare(const void *a, const void *b) { Bucket *f, *s; zval result; zval *first, *second; @@ -59,7 +59,7 @@ static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) { first = &f->val; second = &s->val; - if (string_compare_function(&result, first, second TSRMLS_CC) == FAILURE) { + if (string_compare_function(&result, first, second) == FAILURE) { return 0; } @@ -72,12 +72,12 @@ static int phpdbg_array_data_compare(const void *a, const void *b TSRMLS_DC) { return 0; } -static void phpdbg_array_intersect_init(phpdbg_intersect_ptr *info, HashTable *ht1, HashTable *ht2 TSRMLS_DC) { +static void phpdbg_array_intersect_init(phpdbg_intersect_ptr *info, HashTable *ht1, HashTable *ht2) { info->ht[0] = ht1; info->ht[1] = ht2; - zend_hash_sort(info->ht[0], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0 TSRMLS_CC); - zend_hash_sort(info->ht[1], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0 TSRMLS_CC); + zend_hash_sort(info->ht[0], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0); + zend_hash_sort(info->ht[1], zend_qsort, (compare_func_t) phpdbg_array_data_compare, 0); zend_hash_internal_pointer_reset_ex(info->ht[0], &info->pos[0]); zend_hash_internal_pointer_reset_ex(info->ht[1], &info->pos[1]); @@ -124,14 +124,14 @@ static int phpdbg_array_intersect(phpdbg_intersect_ptr *info, zval **ptr) { return ret; } -void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { +void phpdbg_webdata_decompress(char *msg, int len) { zval *free_zv = NULL; zval zv, *zvp; HashTable *ht; php_unserialize_data_t var_hash; PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (!php_var_unserialize(&zv, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash TSRMLS_CC)) { + if (!php_var_unserialize(&zv, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash)) { PHP_VAR_UNSERIALIZE_DESTROY(var_hash); phpdbg_error("wait", "type=\"invaliddata\" import=\"fail\"", "Malformed serialized was sent to this socket, arborting"); return; @@ -149,24 +149,24 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { if ((script = zend_hash_str_find(Z_ARRVAL_P(srv), ZEND_STRL("SCRIPT_FILENAME"))) && Z_TYPE_P(script) == IS_STRING) { phpdbg_param_t param; param.str = Z_STRVAL_P(script); - PHPDBG_COMMAND_HANDLER(exec)(¶m TSRMLS_CC); + PHPDBG_COMMAND_HANDLER(exec)(¶m); } } } PG(auto_globals_jit) = 0; - zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_dearm_autoglobals TSRMLS_CC); + zend_hash_apply(CG(auto_globals), (apply_func_t) phpdbg_dearm_autoglobals); zend_hash_clean(&EG(symbol_table).ht); EG(symbol_table) = *Z_ARR_P(zvp); /* Rebuild cookies, env vars etc. from GLOBALS (PG(http_globals)) */ - phpdbg_rebuild_http_globals_array(TRACK_VARS_POST, "_POST" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_GET, "_GET" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_COOKIE, "_COOKIE" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_SERVER, "_SERVER" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_ENV, "_ENV" TSRMLS_CC); - phpdbg_rebuild_http_globals_array(TRACK_VARS_FILES, "_FILES" TSRMLS_CC); + phpdbg_rebuild_http_globals_array(TRACK_VARS_POST, "_POST"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_GET, "_GET"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_COOKIE, "_COOKIE"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_SERVER, "_SERVER"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_ENV, "_ENV"); + phpdbg_rebuild_http_globals_array(TRACK_VARS_FILES, "_FILES"); Z_ADDREF_P(zvp); free_zv = zvp; @@ -222,7 +222,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { } } ZEND_HASH_FOREACH_END(); - phpdbg_array_intersect_init(&pos, &zv_registry, Z_ARRVAL_P(zvp) TSRMLS_CC); + phpdbg_array_intersect_init(&pos, &zv_registry, Z_ARRVAL_P(zvp)); do { int mode = phpdbg_array_intersect(&pos, &module); if (mode < 0) { @@ -299,7 +299,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { } ZEND_HASH_FOREACH_END(); } - zend_ini_deactivate(TSRMLS_C); + zend_ini_deactivate(); if ((zvp = zend_hash_str_find(ht, ZEND_STRL("systemini"))) && Z_TYPE_P(zvp) == IS_ARRAY) { zval *ini_entry; @@ -309,7 +309,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zvp), key, ini_entry) { if (key && Z_TYPE_P(ini_entry) == IS_STRING) { if ((original_ini = zend_hash_find_ptr(EG(ini_directives), key))) { - if (!original_ini->on_modify || original_ini->on_modify(original_ini, Z_STR_P(ini_entry), original_ini->mh_arg1, original_ini->mh_arg2, original_ini->mh_arg3, ZEND_INI_STAGE_ACTIVATE TSRMLS_CC) == SUCCESS) { + if (!original_ini->on_modify || original_ini->on_modify(original_ini, Z_STR_P(ini_entry), original_ini->mh_arg1, original_ini->mh_arg2, original_ini->mh_arg3, ZEND_INI_STAGE_ACTIVATE) == SUCCESS) { if (original_ini->modified && original_ini->orig_value != original_ini->value) { efree(original_ini->value); } @@ -327,7 +327,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(zvp), key, ini_entry) { if (key && Z_TYPE_P(ini_entry) == IS_STRING) { - zend_alter_ini_entry_ex(key, Z_STR_P(ini_entry), ZEND_INI_PERDIR, ZEND_INI_STAGE_HTACCESS, 1 TSRMLS_CC); + zend_alter_ini_entry_ex(key, Z_STR_P(ini_entry), ZEND_INI_PERDIR, ZEND_INI_STAGE_HTACCESS, 1); } } ZEND_HASH_FOREACH_END(); } @@ -384,7 +384,7 @@ PHPDBG_COMMAND(wait) /* {{{ */ recvd -= recv(sr, &(data[(*(int *) msglen) - recvd]), recvd, 0); } while (recvd > 0); - phpdbg_webdata_decompress(data, *(int *) msglen TSRMLS_CC); + phpdbg_webdata_decompress(data, *(int *) msglen); if (PHPDBG_G(socket_fd) != -1) { close(PHPDBG_G(socket_fd)); diff --git a/sapi/phpdbg/phpdbg_wait.h b/sapi/phpdbg/phpdbg_wait.h index 7cf95919cc..c5a6bb95eb 100644 --- a/sapi/phpdbg/phpdbg_wait.h +++ b/sapi/phpdbg/phpdbg_wait.h @@ -24,6 +24,6 @@ PHPDBG_COMMAND(wait); -void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC); +void phpdbg_webdata_decompress(char *msg, int len); #endif /* PHPDBG_WAIT_H */ diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c index 7a39d3ee1a..8caa71caad 100644 --- a/sapi/phpdbg/phpdbg_watch.c +++ b/sapi/phpdbg/phpdbg_watch.c @@ -37,7 +37,7 @@ const phpdbg_command_t phpdbg_watch_commands[] = { PHPDBG_END_COMMAND }; -//#define HT_FROM_WATCH(watch) (watch->type == WATCH_ON_OBJECT ? watch->addr.obj->handlers->get_properties(watch->parent_container.zv TSRMLS_CC) : watch->type == WATCH_ON_ARRAY ? &watch->addr.arr->ht : NULL) +//#define HT_FROM_WATCH(watch) (watch->type == WATCH_ON_OBJECT ? watch->addr.obj->handlers->get_properties(watch->parent_container.zv) : watch->type == WATCH_ON_ARRAY ? &watch->addr.arr->ht : NULL) #define HT_FROM_ZVP(zvp) (Z_TYPE_P(zvp) == IS_OBJECT ? Z_OBJPROP_P(zvp) : Z_TYPE_P(zvp) == IS_ARRAY ? Z_ARRVAL_P(zvp) : NULL) typedef struct { @@ -51,7 +51,7 @@ typedef struct { #define MEMDUMP_SIZE(size) (sizeof(phpdbg_watch_memdump) - sizeof(void *) + (size)) -static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr TSRMLS_DC) { +static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr) { phpdbg_watchpoint_t *watch; phpdbg_btree_result *result = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), (zend_ulong)phpdbg_get_page_boundary(addr) + phpdbg_pagesize - 1); @@ -70,24 +70,24 @@ static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr TSRMLS_DC) { return watch; } -static void phpdbg_change_watchpoint_access(phpdbg_watchpoint_t *watch, int access TSRMLS_DC) { +static void phpdbg_change_watchpoint_access(phpdbg_watchpoint_t *watch, int access) { /* pagesize is assumed to be in the range of 2^x */ mprotect(phpdbg_get_page_boundary(watch->addr.ptr), phpdbg_get_total_page_size(watch->addr.ptr, watch->size), access); } -static inline void phpdbg_activate_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { - phpdbg_change_watchpoint_access(watch, PROT_READ TSRMLS_CC); +static inline void phpdbg_activate_watchpoint(phpdbg_watchpoint_t *watch) { + phpdbg_change_watchpoint_access(watch, PROT_READ); } -static inline void phpdbg_deactivate_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { - phpdbg_change_watchpoint_access(watch, PROT_READ | PROT_WRITE TSRMLS_CC); +static inline void phpdbg_deactivate_watchpoint(phpdbg_watchpoint_t *watch) { + phpdbg_change_watchpoint_access(watch, PROT_READ | PROT_WRITE); } -static inline void phpdbg_store_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static inline void phpdbg_store_watchpoint(phpdbg_watchpoint_t *watch) { phpdbg_btree_insert(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr, watch); } -static inline void phpdbg_remove_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static inline void phpdbg_remove_watchpoint(phpdbg_watchpoint_t *watch) { phpdbg_btree_delete(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr); } @@ -108,10 +108,10 @@ void phpdbg_create_ht_watchpoint(HashTable *ht, phpdbg_watchpoint_t *watch) { void phpdbg_watch_HashTable_dtor(zval *ptr); -static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC); -static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC); -static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC); -static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC); +static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch); +static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch); +static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch); +static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch); /* TODO: Store all the possible watches the refcounted may refer to (for displaying & deleting by identifier) */ @@ -125,7 +125,7 @@ static phpdbg_watchpoint_t *phpdbg_create_refcounted_watchpoint(phpdbg_watchpoin return watch; } -static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch) { phpdbg_watch_collision *cur; if ((cur = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->addr.ref))) { cur->num++; @@ -139,43 +139,43 @@ static void phpdbg_add_watch_collision(phpdbg_watchpoint_t *watch TSRMLS_DC) { coll.watch = *watch; zend_hash_init(&coll.watches, 8, NULL, NULL, 0); cur = zend_hash_index_add_mem(&PHPDBG_G(watch_collisions), (zend_ulong) watch->addr.ref, &coll, sizeof(phpdbg_watch_collision)); - phpdbg_store_watchpoint(&cur->watch TSRMLS_CC); - phpdbg_activate_watchpoint(&cur->watch TSRMLS_CC); + phpdbg_store_watchpoint(&cur->watch); + phpdbg_activate_watchpoint(&cur->watch); } zend_hash_str_add_ptr(&cur->watches, watch->parent->str, watch->parent->str_len, watch->parent); } -static void phpdbg_remove_watch_collision(zend_refcounted *ref TSRMLS_DC) { +static void phpdbg_remove_watch_collision(zend_refcounted *ref) { phpdbg_watch_collision *cur; if ((cur = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) ref))) { phpdbg_watchpoint_t *watch = cur->watch.parent; if (watch->flags == PHPDBG_WATCH_RECURSIVE && !--cur->refs) { - phpdbg_delete_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_watchpoints_recursive(watch); } zend_hash_str_del(&cur->watches, watch->str, watch->str_len); if (!--cur->num) { - phpdbg_deactivate_watchpoint(&cur->watch TSRMLS_CC); - phpdbg_remove_watchpoint(&cur->watch TSRMLS_CC); + phpdbg_deactivate_watchpoint(&cur->watch); + phpdbg_remove_watchpoint(&cur->watch); - phpdbg_delete_watchpoint(watch TSRMLS_CC); + phpdbg_delete_watchpoint(watch); zend_hash_index_del(&PHPDBG_G(watch_collisions), (zend_ulong) ref); } } } -static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch) { watch->flags |= PHPDBG_WATCH_SIMPLE; - phpdbg_store_watchpoint(watch TSRMLS_CC); + phpdbg_store_watchpoint(watch); zend_hash_str_add_ptr(&PHPDBG_G(watchpoints), watch->str, watch->str_len, watch); if (watch->parent && watch->parent->type == WATCH_ON_ZVAL && Z_REFCOUNTED_P(watch->parent->addr.zv)) { - phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(watch->parent->addr.zv)) TSRMLS_CC); + phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(watch->parent->addr.zv))); } if (watch->type == WATCH_ON_ZVAL) { @@ -193,16 +193,16 @@ static int phpdbg_create_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { ref->parent_container = NULL; phpdbg_create_zval_watchpoint(Z_REFVAL_P(watch->addr.zv), ref); - phpdbg_create_watchpoint(ref TSRMLS_CC); + phpdbg_create_watchpoint(ref); } } - phpdbg_activate_watchpoint(watch TSRMLS_CC); + phpdbg_activate_watchpoint(watch); return SUCCESS; } -static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_DC) { +static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch) { zval *zv = zv_watch->addr.zv; phpdbg_watchpoint_t *watch = emalloc(sizeof(phpdbg_watchpoint_t)); HashTable *ht = HT_FROM_ZVP(zv); @@ -215,7 +215,7 @@ static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_D phpdbg_create_ht_watchpoint(ht, watch); - phpdbg_create_watchpoint(watch TSRMLS_CC); + phpdbg_create_watchpoint(watch); if (Z_TYPE_P(zv) == IS_ARRAY) { watch->flags |= PHPDBG_WATCH_ARRAY; @@ -223,12 +223,12 @@ static int phpdbg_create_array_watchpoint(phpdbg_watchpoint_t *zv_watch TSRMLS_D watch->flags |= PHPDBG_WATCH_OBJECT; } - phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(zv)) TSRMLS_CC); + phpdbg_add_watch_collision(phpdbg_create_refcounted_watchpoint(watch, Z_COUNTED_P(zv))); return SUCCESS; } -static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch) { HashTable *ht; zval *zvp = watch->addr.zv; @@ -237,7 +237,7 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_ } watch->flags |= PHPDBG_WATCH_RECURSIVE; - phpdbg_create_watchpoint(watch TSRMLS_CC); + phpdbg_create_watchpoint(watch); ZVAL_DEREF(zvp); @@ -272,7 +272,7 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_ } phpdbg_create_zval_watchpoint(zv, new_watch); - phpdbg_create_recursive_watchpoint(new_watch TSRMLS_CC); + phpdbg_create_recursive_watchpoint(new_watch); } ZEND_HASH_FOREACH_END(); } @@ -294,34 +294,34 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch TSRMLS_ } phpdbg_create_ht_watchpoint(ht, new_watch); - phpdbg_create_watchpoint(new_watch TSRMLS_CC); + phpdbg_create_watchpoint(new_watch); } return SUCCESS; } -static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_bool user_request TSRMLS_DC) { +static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_bool user_request) { if (watch->type == WATCH_ON_HASHTABLE) { HashTable *ht; phpdbg_btree_result *result; if (watch->type == WATCH_ON_HASHTABLE && user_request) { - phpdbg_delete_ht_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_ht_watchpoints_recursive(watch); } else { ht = HT_FROM_ZVP(watch->addr.zv); if ((result = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong) ht))) { - phpdbg_delete_watchpoint_recursive((phpdbg_watchpoint_t *) result->ptr, user_request TSRMLS_CC); + phpdbg_delete_watchpoint_recursive((phpdbg_watchpoint_t *) result->ptr, user_request); } } } else if (watch->type == WATCH_ON_ZVAL) { - phpdbg_delete_zval_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_zval_watchpoints_recursive(watch); } return zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len); } -static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch) { zend_string *strkey; zend_long numkey; char *str; @@ -336,26 +336,26 @@ static void phpdbg_delete_ht_watchpoints_recursive(phpdbg_watchpoint_t *watch TS } if ((watchpoint = zend_hash_str_find_ptr(&PHPDBG_G(watchpoints), str, str_len))) { - phpdbg_delete_watchpoint_recursive(watchpoint, 1 TSRMLS_CC); + phpdbg_delete_watchpoint_recursive(watchpoint, 1); } } ZEND_HASH_FOREACH_END(); } -static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static void phpdbg_delete_zval_watchpoints_recursive(phpdbg_watchpoint_t *watch) { if (Z_REFCOUNTED_P(watch->addr.zv)) { - phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv) TSRMLS_CC); + phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv)); } } -static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) { +static void phpdbg_delete_watchpoints_recursive(phpdbg_watchpoint_t *watch) { if (watch->type == WATCH_ON_ZVAL) { - phpdbg_delete_zval_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_zval_watchpoints_recursive(watch); } else if (watch->type == WATCH_ON_HASHTABLE) { - phpdbg_delete_ht_watchpoints_recursive(watch TSRMLS_CC); + phpdbg_delete_ht_watchpoints_recursive(watch); } } -static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) { +static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch) { int ret; phpdbg_watchpoint_t *watch; phpdbg_btree_result *result; @@ -367,7 +367,7 @@ static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) { watch = result->ptr; if (watch->flags & PHPDBG_WATCH_RECURSIVE) { - ret = phpdbg_delete_watchpoint_recursive(watch, 1 TSRMLS_CC); + ret = phpdbg_delete_watchpoint_recursive(watch, 1); } else { ret = zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len); } @@ -379,7 +379,7 @@ static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) { return ret; } -static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC) TSRMLS_DC) { +static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname, size_t keylen, HashTable *parent, zval *zv, int (*callback)(phpdbg_watchpoint_t *)) { int ret; phpdbg_watchpoint_t *watch = emalloc(sizeof(phpdbg_watchpoint_t)); watch->flags = 0; @@ -390,7 +390,7 @@ static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname watch->parent_container = parent; phpdbg_create_zval_watchpoint(zv, watch); - ret = callback(watch TSRMLS_CC); + ret = callback(watch); if (ret != SUCCESS) { efree(watch); @@ -401,27 +401,27 @@ static int phpdbg_watchpoint_parse_wrapper(char *name, size_t len, char *keyname return ret; } -PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC), zend_bool silent TSRMLS_DC) { - return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, 0, callback TSRMLS_CC); +PHPDBG_API int phpdbg_watchpoint_parse_input(char *input, size_t len, HashTable *parent, size_t i, int (*callback)(phpdbg_watchpoint_t *), zend_bool silent) { + return phpdbg_parse_variable_with_arg(input, len, parent, i, (phpdbg_parse_var_with_arg_func) phpdbg_watchpoint_parse_wrapper, 0, callback); } -static int phpdbg_watchpoint_parse_symtables(char *input, size_t len, int (*callback)(phpdbg_watchpoint_t * TSRMLS_DC) TSRMLS_DC) { +static int phpdbg_watchpoint_parse_symtables(char *input, size_t len, int (*callback)(phpdbg_watchpoint_t *)) { if (EG(scope) && len >= 5 && !memcmp("$this", input, 5)) { zend_hash_str_add(&EG(current_execute_data)->symbol_table->ht, ZEND_STRL("this"), &EG(current_execute_data)->This); } - if (phpdbg_is_auto_global(input, len TSRMLS_CC) && phpdbg_watchpoint_parse_input(input, len, &EG(symbol_table).ht, 0, callback, 1 TSRMLS_CC) != FAILURE) { + if (phpdbg_is_auto_global(input, len) && phpdbg_watchpoint_parse_input(input, len, &EG(symbol_table).ht, 0, callback, 1) != FAILURE) { return SUCCESS; } - return phpdbg_watchpoint_parse_input(input, len, &EG(current_execute_data)->symbol_table->ht, 0, callback, 0 TSRMLS_CC); + return phpdbg_watchpoint_parse_input(input, len, &EG(current_execute_data)->symbol_table->ht, 0, callback, 0); } PHPDBG_WATCH(delete) /* {{{ */ { switch (param->type) { case STR_PARAM: - if (phpdbg_delete_var_watchpoint(param->str, param->len TSRMLS_CC) == FAILURE) { + if (phpdbg_delete_var_watchpoint(param->str, param->len) == FAILURE) { phpdbg_error("watchdelete", "type=\"nowatch\"", "Nothing was deleted, no corresponding watchpoint found"); } else { phpdbg_notice("watchdelete", "variable=\"%.*s\"", "Removed watchpoint %.*s", (int) param->len, param->str); @@ -436,13 +436,13 @@ PHPDBG_WATCH(delete) /* {{{ */ PHPDBG_WATCH(recursive) /* {{{ */ { - if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) { + if (phpdbg_rebuild_symtable() == FAILURE) { return SUCCESS; } switch (param->type) { case STR_PARAM: - if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_recursive_watchpoint TSRMLS_CC) != FAILURE) { + if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_recursive_watchpoint) != FAILURE) { phpdbg_notice("watchrecursive", "variable=\"%.*s\"", "Set recursive watchpoint on %.*s", (int)param->len, param->str); } break; @@ -455,13 +455,13 @@ PHPDBG_WATCH(recursive) /* {{{ */ PHPDBG_WATCH(array) /* {{{ */ { - if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) { + if (phpdbg_rebuild_symtable() == FAILURE) { return SUCCESS; } switch (param->type) { case STR_PARAM: - if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_array_watchpoint TSRMLS_CC) != FAILURE) { + if (phpdbg_watchpoint_parse_symtables(param->str, param->len, phpdbg_create_array_watchpoint) != FAILURE) { phpdbg_notice("watcharray", "variable=\"%.*s\"", "Set array watchpoint on %.*s", (int)param->len, param->str); } break; @@ -474,7 +474,6 @@ PHPDBG_WATCH(array) /* {{{ */ void phpdbg_watch_HashTable_dtor(zval *zv) { phpdbg_btree_result *result; - TSRMLS_FETCH(); zval_ptr_dtor_wrapper(zv); @@ -486,7 +485,7 @@ void phpdbg_watch_HashTable_dtor(zval *zv) { phpdbg_notice("watchdelete", "variable=\"%.*s\" recursive=\"%s\"", "%.*s was removed, removing watchpoint%s", (int) watch->str_len, watch->str, (watch->flags & PHPDBG_WATCH_RECURSIVE) ? " recursively" : ""); if (watch->flags & PHPDBG_WATCH_RECURSIVE) { - phpdbg_delete_watchpoint_recursive(watch, 0 TSRMLS_CC); + phpdbg_delete_watchpoint_recursive(watch, 0); } else { zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len); } @@ -494,26 +493,26 @@ void phpdbg_watch_HashTable_dtor(zval *zv) { } -int phpdbg_create_var_watchpoint(char *input, size_t len TSRMLS_DC) { - if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) { +int phpdbg_create_var_watchpoint(char *input, size_t len) { + if (phpdbg_rebuild_symtable() == FAILURE) { return FAILURE; } - return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_create_watchpoint TSRMLS_CC); + return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_create_watchpoint); } -int phpdbg_delete_var_watchpoint(char *input, size_t len TSRMLS_DC) { - if (phpdbg_rebuild_symtable(TSRMLS_C) == FAILURE) { +int phpdbg_delete_var_watchpoint(char *input, size_t len) { + if (phpdbg_rebuild_symtable() == FAILURE) { return FAILURE; } - return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_delete_watchpoint TSRMLS_CC); + return phpdbg_watchpoint_parse_symtables(input, len, phpdbg_delete_watchpoint); } #ifdef _WIN32 -int phpdbg_watchpoint_segfault_handler(void *addr TSRMLS_DC) { +int phpdbg_watchpoint_segfault_handler(void *addr) { #else -int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC) { +int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context) { #endif void *page; phpdbg_watch_memdump *dump; @@ -549,16 +548,15 @@ int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC) return SUCCESS; } -void phpdbg_watchpoints_clean(TSRMLS_D) { +void phpdbg_watchpoints_clean(void) { zend_hash_clean(&PHPDBG_G(watchpoints)); } static void phpdbg_watch_dtor(zval *pDest) { phpdbg_watchpoint_t *watch = (phpdbg_watchpoint_t *) Z_PTR_P(pDest); - TSRMLS_FETCH(); - phpdbg_deactivate_watchpoint(watch TSRMLS_CC); - phpdbg_remove_watchpoint(watch TSRMLS_CC); + phpdbg_deactivate_watchpoint(watch); + phpdbg_remove_watchpoint(watch); efree(watch->str); efree(watch->name_in_parent); @@ -575,7 +573,7 @@ static void phpdbg_watch_mem_dtor(void *llist_data) { free(*(void **) llist_data); } -void phpdbg_setup_watchpoints(TSRMLS_D) { +void phpdbg_setup_watchpoints(void) { #if _SC_PAGE_SIZE phpdbg_pagesize = sysconf(_SC_PAGE_SIZE); #elif _SC_PAGESIZE @@ -593,7 +591,7 @@ void phpdbg_setup_watchpoints(TSRMLS_D) { zend_hash_init(&PHPDBG_G(watch_collisions), 8, NULL, NULL, 0); } -static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { +static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump) { /* fetch all changes between dump->page and dump->page + dump->size */ phpdbg_btree_position pos = phpdbg_btree_find_between(&PHPDBG_G(watchpoint_tree), (zend_ulong) dump->page, (zend_ulong) dump->page + dump->size); phpdbg_btree_result *result; @@ -631,11 +629,11 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { } if (curTest != watch->addr.ptr) { - phpdbg_deactivate_watchpoint(watch TSRMLS_CC); - phpdbg_remove_watchpoint(watch TSRMLS_CC); + phpdbg_deactivate_watchpoint(watch); + phpdbg_remove_watchpoint(watch); watch->addr.ptr = curTest; - phpdbg_store_watchpoint(watch TSRMLS_CC); - phpdbg_activate_watchpoint(watch TSRMLS_CC); + phpdbg_store_watchpoint(watch); + phpdbg_activate_watchpoint(watch); reenable = 0; } @@ -680,7 +678,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { } else { phpdbg_out("Old value: "); phpdbg_xml("<watchvalue %r type=\"old\">"); - zend_print_flat_zval_r((zval *) oldPtr TSRMLS_CC); + zend_print_flat_zval_r((zval *) oldPtr); phpdbg_xml("</watchvalue>"); phpdbg_out("\n"); } @@ -694,7 +692,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { reenable = 0; if (Z_REFCOUNTED_P((zval *) oldPtr)) { - phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr) TSRMLS_CC); + phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr)); } break; } @@ -702,7 +700,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { if (show_value) { phpdbg_out("New value: "); phpdbg_xml("<watchvalue %r type=\"new\">"); - zend_print_flat_zval_r(watch->addr.zv TSRMLS_CC); + zend_print_flat_zval_r(watch->addr.zv); phpdbg_xml("</watchvalue>"); phpdbg_out("\n"); } @@ -710,14 +708,14 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { /* add new watchpoints if necessary */ if (Z_PTR_P(watch->addr.zv) != Z_PTR_P((zval *) oldPtr)) { if (Z_REFCOUNTED_P((zval *) oldPtr)) { - phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr) TSRMLS_CC); + phpdbg_remove_watch_collision(Z_COUNTED_P((zval *) oldPtr)); } if (Z_REFCOUNTED_P(watch->addr.zv)) { if (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS) { phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\"", "New refcount: %d", Z_COUNTED_P(watch->addr.zv)->refcount); } if (watch->flags & PHPDBG_WATCH_RECURSIVE) { - phpdbg_create_recursive_watchpoint(watch TSRMLS_CC); + phpdbg_create_recursive_watchpoint(watch); } } } @@ -744,7 +742,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { /* add new watchpoints if necessary */ if (watch->flags & PHPDBG_WATCH_RECURSIVE) { - phpdbg_create_recursive_watchpoint(watch TSRMLS_CC); + phpdbg_create_recursive_watchpoint(watch); } } } @@ -774,7 +772,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { } } -int phpdbg_print_changed_zvals(TSRMLS_D) { +int phpdbg_print_changed_zvals(void) { zend_llist_position pos; phpdbg_watch_memdump **dump; int ret; @@ -786,7 +784,7 @@ int phpdbg_print_changed_zvals(TSRMLS_D) { dump = (phpdbg_watch_memdump **) zend_llist_get_last_ex(&PHPDBG_G(watchlist_mem), &pos); do { - phpdbg_print_changed_zval(*dump TSRMLS_CC); + phpdbg_print_changed_zval(*dump); } while ((dump = (phpdbg_watch_memdump **) zend_llist_get_prev_ex(&PHPDBG_G(watchlist_mem), &pos))); zend_llist_clean(&PHPDBG_G(watchlist_mem)); @@ -797,7 +795,7 @@ int phpdbg_print_changed_zvals(TSRMLS_D) { return ret; } -void phpdbg_list_watchpoints(TSRMLS_D) { +void phpdbg_list_watchpoints(void) { phpdbg_watchpoint_t *watch; phpdbg_xml("<watchlist %r>"); @@ -811,7 +809,6 @@ void phpdbg_list_watchpoints(TSRMLS_D) { void phpdbg_watch_efree(void *ptr) { phpdbg_btree_result *result; - TSRMLS_FETCH(); result = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), (zend_ulong) ptr); @@ -820,7 +817,7 @@ void phpdbg_watch_efree(void *ptr) { if ((size_t) watch->addr.ptr + watch->size > (size_t) ptr) { if (watch->type == WATCH_ON_ZVAL) { - phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv) TSRMLS_CC); + phpdbg_remove_watch_collision(Z_COUNTED_P(watch->addr.zv)); } zend_hash_str_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len); } diff --git a/sapi/phpdbg/phpdbg_watch.h b/sapi/phpdbg/phpdbg_watch.h index 35cab10dc1..8bee00261c 100644 --- a/sapi/phpdbg/phpdbg_watch.h +++ b/sapi/phpdbg/phpdbg_watch.h @@ -80,23 +80,23 @@ typedef struct { HashTable watches; } phpdbg_watch_collision; -void phpdbg_setup_watchpoints(TSRMLS_D); +void phpdbg_setup_watchpoints(void); #ifndef _WIN32 -int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context TSRMLS_DC); +int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context); #else -int phpdbg_watchpoint_segfault_handler(void *addr TSRMLS_DC); +int phpdbg_watchpoint_segfault_handler(void *addr); #endif void phpdbg_create_addr_watchpoint(void *addr, size_t size, phpdbg_watchpoint_t *watch); void phpdbg_create_zval_watchpoint(zval *zv, phpdbg_watchpoint_t *watch); -int phpdbg_delete_var_watchpoint(char *input, size_t len TSRMLS_DC); -int phpdbg_create_var_watchpoint(char *input, size_t len TSRMLS_DC); +int phpdbg_delete_var_watchpoint(char *input, size_t len); +int phpdbg_create_var_watchpoint(char *input, size_t len); -int phpdbg_print_changed_zvals(TSRMLS_D); +int phpdbg_print_changed_zvals(void); -void phpdbg_list_watchpoints(TSRMLS_D); +void phpdbg_list_watchpoints(void); void phpdbg_watch_efree(void *ptr); diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.c b/sapi/phpdbg/phpdbg_webdata_transfer.c index 5ce6759062..258c8cf09f 100644 --- a/sapi/phpdbg/phpdbg_webdata_transfer.c +++ b/sapi/phpdbg/phpdbg_webdata_transfer.c @@ -19,15 +19,15 @@ #include "phpdbg_webdata_transfer.h" #include "ext/standard/php_var.h" -static int phpdbg_is_auto_global(char *name, int len TSRMLS_DC) { +static int phpdbg_is_auto_global(char *name, int len) { int ret; zend_string *str = zend_string_init(name, len, 0); - ret = zend_is_auto_global(str TSRMLS_CC); + ret = zend_is_auto_global(str); efree(str); return ret; } -PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) { +PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len) { zval array; HashTable *ht; zval zv[9] = {{{0}}}; @@ -37,11 +37,11 @@ PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) { /* fetch superglobals */ { - phpdbg_is_auto_global(ZEND_STRL("GLOBALS") TSRMLS_CC); + phpdbg_is_auto_global(ZEND_STRL("GLOBALS")); /* might be JIT */ - phpdbg_is_auto_global(ZEND_STRL("_ENV") TSRMLS_CC); - phpdbg_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC); - phpdbg_is_auto_global(ZEND_STRL("_REQUEST") TSRMLS_CC); + phpdbg_is_auto_global(ZEND_STRL("_ENV")); + phpdbg_is_auto_global(ZEND_STRL("_SERVER")); + phpdbg_is_auto_global(ZEND_STRL("_REQUEST")); array_init(&zv[1]); zend_hash_copy(Z_ARRVAL(zv[1]), &EG(symbol_table).ht, NULL); Z_ARRVAL(zv[1])->pDestructor = NULL; /* we're operating on a copy! Don't double free zvals */ @@ -165,7 +165,7 @@ PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC) { smart_str buf = {0}; PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&buf, &array, &var_hash TSRMLS_CC); + php_var_serialize(&buf, &array, &var_hash); PHP_VAR_SERIALIZE_DESTROY(var_hash); *msg = buf.s->val; *len = buf.s->len; diff --git a/sapi/phpdbg/phpdbg_webdata_transfer.h b/sapi/phpdbg/phpdbg_webdata_transfer.h index d70175ad99..f4edae9b3f 100644 --- a/sapi/phpdbg/phpdbg_webdata_transfer.h +++ b/sapi/phpdbg/phpdbg_webdata_transfer.h @@ -22,6 +22,6 @@ #include "zend.h" #include "phpdbg.h" -PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len TSRMLS_DC); +PHPDBG_API void phpdbg_webdata_compress(char **msg, int *len); #endif /* PHPDBG_WEBDATA_TRANSFER_H */ diff --git a/sapi/phpdbg/phpdbg_win.c b/sapi/phpdbg/phpdbg_win.c index b0cbdf267a..5ad99cb0ef 100644 --- a/sapi/phpdbg/phpdbg_win.c +++ b/sapi/phpdbg/phpdbg_win.c @@ -31,9 +31,8 @@ int phpdbg_exception_handler_win32(EXCEPTION_POINTERS *xp) { CONTEXT *xc = xp->ContextRecord; if(xr->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { - TSRMLS_FETCH(); - - if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1] TSRMLS_CC) == SUCCESS) { + + if (phpdbg_watchpoint_segfault_handler((void *)xr->ExceptionInformation[1]) == SUCCESS) { return EXCEPTION_CONTINUE_EXECUTION; } } diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c index ba8dfe3838..81c17c3c49 100644 --- a/sapi/phttpd/phttpd.c +++ b/sapi/phttpd/phttpd.c @@ -53,7 +53,7 @@ php_phttpd_startup(sapi_module_struct *sapi_module) } static int -php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) +php_phttpd_sapi_ub_write(const char *str, uint str_length) { int sent_bytes; @@ -67,7 +67,7 @@ php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) } static int -php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) +php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers) { char *header_name, *header_content; char *p; @@ -94,7 +94,7 @@ php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str } static int -php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers) { if (SG(sapi_headers).send_default_content_type) { fd_printf(PHG(cip)->fd,"Content-Type: text/html\n"); @@ -106,7 +106,7 @@ php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) } static char * -php_phttpd_sapi_read_cookies(TSRMLS_D) +php_phttpd_sapi_read_cookies(void) { /* @@ -126,7 +126,7 @@ php_phttpd_sapi_read_cookies(TSRMLS_D) } static int -php_phttpd_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) +php_phttpd_sapi_read_post(char *buf, uint count_bytes) { /* uint max_read; @@ -181,7 +181,7 @@ static sapi_module_struct phttpd_sapi_module = { }; static void -php_phttpd_request_ctor(TSRMLS_D TSRMLS_DC) +php_phttpd_request_ctor(void) { memset(&SG(request_info), 0, sizeof(sapi_globals_struct)); /* pfusch! */ @@ -232,19 +232,19 @@ php_phttpd_request_ctor(TSRMLS_D TSRMLS_DC) } static void -php_phttpd_request_dtor(TSRMLS_D TSRMLS_DC) +php_phttpd_request_dtor(void) { free(SG(request_info).path_translated); } -int php_doit(TSRMLS_D) +int php_doit(void) { struct stat sb; zend_file_handle file_handle; struct httpinfo *hip = PHG(cip)->hip; - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { return -1; } @@ -253,9 +253,9 @@ int php_doit(TSRMLS_D) file_handle.free_filename = 0; /* - php_phttpd_hash_environment(TSRMLS_C); + php_phttpd_hash_environment(); */ - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); php_request_shutdown(NULL); return SG(sapi_headers).http_response_code; @@ -281,16 +281,15 @@ int pm_request(struct connectioninfo *cip) { struct httpinfo *hip = cip->hip; int status; - TSRMLS_FETCH(); if (strcasecmp(hip->method, "GET") == 0 || strcasecmp(hip->method, "HEAD") == 0 || strcasecmp(hip->method, "POST") == 0) { PHG(cip) = cip; - php_phttpd_request_ctor(TSRMLS_C); - status = php_doit(TSRMLS_C); - php_phttpd_request_dtor(TSRMLS_C); + php_phttpd_request_ctor(); + status = php_doit(); + php_phttpd_request_dtor(); return status; } else { diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index d92526cf5e..cabd3c19a9 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -120,7 +120,7 @@ static zend_module_entry php_pi3web_module = { }; -static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC) +static int zend_pi3web_ub_write(const char *str, uint str_length) { DWORD num_bytes = str_length; LPCONTROL_BLOCK cb; @@ -136,19 +136,19 @@ static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC) } -static int sapi_pi3web_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_pi3web_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers) { return SAPI_HEADER_ADD; } -static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length TSRMLS_DC) +static void accumulate_header_length(sapi_header_struct *sapi_header, uint *total_length) { *total_length += sapi_header->header_len+2; } -static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr TSRMLS_DC) +static void concat_header(sapi_header_struct *sapi_header, char **combined_headers_ptr) { memcpy(*combined_headers_ptr, sapi_header->header, sapi_header->header_len); *combined_headers_ptr += sapi_header->header_len; @@ -159,7 +159,7 @@ static void concat_header(sapi_header_struct *sapi_header, char **combined_heade } -static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers) { uint total_length = 2; /* account for the trailing \r\n */ char *combined_headers, *combined_headers_ptr; @@ -170,19 +170,19 @@ static int sapi_pi3web_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) if (SG(sapi_headers).send_default_content_type) { - sapi_get_default_content_type_header(&default_content_type TSRMLS_CC); - accumulate_header_length(&default_content_type, (void *) &total_length TSRMLS_CC); + sapi_get_default_content_type_header(&default_content_type); + accumulate_header_length(&default_content_type, (void *) &total_length); } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length TSRMLS_CC); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) accumulate_header_length, (void *) &total_length); /* Generate headers */ combined_headers = (char *) emalloc(total_length+1); combined_headers_ptr = combined_headers; if (SG(sapi_headers).send_default_content_type) { - concat_header(&default_content_type, (void *) &combined_headers_ptr TSRMLS_CC); + concat_header(&default_content_type, (void *) &combined_headers_ptr); sapi_free_header(&default_content_type); /* we no longer need it */ } - zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr TSRMLS_CC); + zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t) concat_header, (void *) &combined_headers_ptr); *combined_headers_ptr++ = '\r'; *combined_headers_ptr++ = '\n'; *combined_headers_ptr = 0; @@ -209,7 +209,7 @@ static int php_pi3web_startup(sapi_module_struct *sapi_module) } -static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_pi3web_read_post(char *buffer, uint count_bytes) { LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); DWORD read_from_buf=0; @@ -242,7 +242,7 @@ static int sapi_pi3web_read_post(char *buffer, uint count_bytes TSRMLS_DC) } -static char *sapi_pi3web_read_cookies(TSRMLS_D) +static char *sapi_pi3web_read_cookies(void) { LPCONTROL_BLOCK lpCB = (LPCONTROL_BLOCK) SG(server_context); char variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE]; @@ -263,7 +263,7 @@ static char *sapi_pi3web_read_cookies(TSRMLS_D) return NULL; } -static void init_request_info(LPCONTROL_BLOCK lpCB TSRMLS_DC) +static void init_request_info(LPCONTROL_BLOCK lpCB) { SG(server_context) = lpCB; SG(request_info).request_method = lpCB->lpszMethod; @@ -277,7 +277,7 @@ static void init_request_info(LPCONTROL_BLOCK lpCB TSRMLS_DC) SG(sapi_headers).http_response_code = 200; } -static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_pi3web_register_variables(zval *track_vars_array) { char static_variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE]; char *variable_buf; @@ -296,11 +296,11 @@ static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC) variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; if (lpCB->GetServerVariable(lpCB->ConnID, pKey, static_variable_buf, &variable_len) && (variable_len > 1)) { - php_register_variable(pKey, static_variable_buf, track_vars_array TSRMLS_CC); + php_register_variable(pKey, static_variable_buf, track_vars_array); } else if (PIPlatform_getLastError()==PIAPI_EINVAL) { variable_buf = (char *) emalloc(variable_len); if (lpCB->GetServerVariable(lpCB->ConnID, pKey, variable_buf, &variable_len)) { - php_register_variable(pKey, variable_buf, track_vars_array TSRMLS_CC); + php_register_variable(pKey, variable_buf, track_vars_array); } efree(variable_buf); } @@ -312,7 +312,7 @@ static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC) variable_len = PI3WEB_SERVER_VAR_BUF_SIZE; if (lpCB->GetServerVariable(lpCB->ConnID, "SCRIPT_NAME", static_variable_buf, &variable_len) && (variable_len > 1)) { - php_register_variable("PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC); + php_register_variable("PHP_SELF", static_variable_buf, track_vars_array); } } @@ -346,7 +346,6 @@ MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB) { zend_file_handle file_handle = {0}; int iRet = PIAPI_COMPLETED; - TSRMLS_FETCH(); zend_first_try { file_handle.filename = lpCB->lpszFileName; @@ -354,20 +353,20 @@ MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB) file_handle.type = ZEND_HANDLE_FILENAME; file_handle.opened_path = NULL; - init_request_info(lpCB TSRMLS_CC); - php_request_startup(TSRMLS_C); + init_request_info(lpCB); + php_request_startup(); switch ( lpCB->dwBehavior ) { case PHP_MODE_STANDARD: - iRet = ( php_execute_script( &file_handle TSRMLS_CC ) ) ? + iRet = ( php_execute_script( &file_handle ) ) ? PIAPI_COMPLETED : PIAPI_ERROR; break; case PHP_MODE_HIGHLIGHT: { zend_syntax_highlighter_ini syntax_highlighter_ini; - if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) + if ( open_file_for_scanning( &file_handle ) == SUCCESS ) { php_get_highlight_struct( &syntax_highlighter_ini ); - zend_highlight( &syntax_highlighter_ini TSRMLS_CC ); + zend_highlight( &syntax_highlighter_ini ); } else { @@ -381,11 +380,11 @@ MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB) ctr.line = "Content-Type: text/plain"; ctr.line_len = strlen(ctr.line); - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); + sapi_header_op(SAPI_HEADER_REPLACE, &ctr); } - if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) + if ( open_file_for_scanning( &file_handle ) == SUCCESS ) { - zend_indent(TSRMLS_C); + zend_indent(); } else { @@ -393,7 +392,7 @@ MODULE_API DWORD PHP7_wrapper(LPCONTROL_BLOCK lpCB) }; break; case PHP_MODE_LINT: - iRet = (php_lint_script(&file_handle TSRMLS_CC) == SUCCESS) ? + iRet = (php_lint_script(&file_handle) == SUCCESS) ? PIAPI_COMPLETED : PIAPI_ERROR; break; default: diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c index 756f7353e9..35ae0201dc 100644 --- a/sapi/roxen/roxen.c +++ b/sapi/roxen/roxen.c @@ -211,7 +211,7 @@ INLINE static int lookup_integer_header(char *headername, int default_value) */ static int -php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) { +php_roxen_low_ub_write(const char *str, uint str_length) { int sent_bytes = 0; struct pike_string *to_write = NULL; #ifdef ROXEN_USE_ZTS @@ -242,7 +242,7 @@ php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) { */ static int -php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) +php_roxen_sapi_ub_write(const char *str, uint str_length) { #ifdef ROXEN_USE_ZTS GET_THIS(); @@ -274,7 +274,7 @@ php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) } } } else { - THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length TSRMLS_CC), + THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length), "write"); } return sent_bytes; @@ -324,7 +324,7 @@ static void php_roxen_set_header(char *header_name, char *value, char *p) */ static int php_roxen_sapi_header_handler(sapi_header_struct *sapi_header, - sapi_headers_struct *sapi_headers TSRMLS_DC) + sapi_headers_struct *sapi_headers) { char *header_name, *header_content, *p; header_name = sapi_header->header; @@ -346,7 +346,7 @@ php_roxen_sapi_header_handler(sapi_header_struct *sapi_header, */ static int -php_roxen_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +php_roxen_low_send_headers(sapi_headers_struct *sapi_headers) { struct pike_string *ind; struct svalue *s_headermap; @@ -375,10 +375,10 @@ php_roxen_low_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) } static int -php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers) { int res = 0; - THREAD_SAFE_RUN(res = php_roxen_low_send_headers(sapi_headers TSRMLS_CC), "send headers"); + THREAD_SAFE_RUN(res = php_roxen_low_send_headers(sapi_headers), "send headers"); return res; } @@ -387,7 +387,7 @@ php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) * the client. Used for POST/PUT requests. */ -INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes TSRMLS_DC) +INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes) { uint total_read = 0; #ifdef ROXEN_USE_ZTS @@ -413,10 +413,10 @@ INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes TSRMLS_DC) } static int -php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) +php_roxen_sapi_read_post(char *buf, uint count_bytes) { uint total_read = 0; - THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes TSRMLS_CC), "read post"); + THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes), "read post"); return total_read; } @@ -426,7 +426,7 @@ php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) */ static char * -php_roxen_sapi_read_cookies(TSRMLS_D) +php_roxen_sapi_read_cookies(void) { char *cookies; cookies = lookup_string_header("HTTP_COOKIE", NULL); @@ -520,7 +520,7 @@ static sapi_module_struct roxen_sapi_module = { &zvalue, sizeof(zval *), NULL) static void -php_roxen_hash_environment(TSRMLS_D) +php_roxen_hash_environment(void) { int i; char buf[512]; @@ -570,7 +570,7 @@ php_roxen_hash_environment(TSRMLS_D) * "executes" the script */ -static int php_roxen_module_main(TSRMLS_D) +static int php_roxen_module_main(void) { int res, len; char *dir; @@ -585,14 +585,14 @@ static int php_roxen_module_main(TSRMLS_D) file_handle.opened_path = NULL; THREADS_ALLOW(); - res = php_request_startup(TSRMLS_C); + res = php_request_startup(); THREADS_DISALLOW(); if(res == FAILURE) { return 0; } - php_roxen_hash_environment(TSRMLS_C); + php_roxen_hash_environment(); THREADS_ALLOW(); - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); php_request_shutdown(NULL); THREADS_DISALLOW(); return 1; @@ -613,8 +613,7 @@ void f_php_roxen_request_handler(INT32 args) #ifdef ROXEN_USE_ZTS GET_THIS(); #endif - TSRMLS_FETCH(); - + if(current_thread == th_self()) php_error(E_WARNING, "PHP7.Interpreter->run: Tried to run a PHP-script from a PHP " "callback!"); @@ -662,7 +661,7 @@ void f_php_roxen_request_handler(INT32 args) } else THIS->my_fd = 0; - status = php_roxen_module_main(TSRMLS_C); + status = php_roxen_module_main(); current_thread = -1; apply_svalue(done_callback, 0); diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index 7c03454f58..db9b1c5306 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -64,7 +64,7 @@ static php_thttpd_globals thttpd_globals; #define TG(v) (thttpd_globals.v) #endif -static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC) +static int sapi_thttpd_ub_write(const char *str, uint str_length) { int n; uint sent = 0; @@ -103,7 +103,7 @@ static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC) # endif #endif -static int do_writev(struct iovec *vec, int nvec, int len TSRMLS_DC) +static int do_writev(struct iovec *vec, int nvec, int len) { int n; @@ -170,7 +170,7 @@ static int do_writev(struct iovec *vec, int nvec, int len TSRMLS_DC) #define KA_NO "Connection: close\r\n" #define DEF_CT "Content-Type: text/html\r\n" -static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers) { char buf[1024], *p; VEC_BASE(); @@ -211,7 +211,7 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) ADD_VEC(h->header, h->header_len); #ifndef SERIALIZE_HEADERS if (n >= COMBINE_HEADERS - 1) { - len = do_writev(vec, n, len TSRMLS_CC); + len = do_writev(vec, n, len); n = 0; } #endif @@ -230,9 +230,9 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) ADD_VEC("\r\n", 2); #ifdef SERIALIZE_HEADERS - sapi_thttpd_ub_write(vec_str.c, vec_str.len TSRMLS_CC); + sapi_thttpd_ub_write(vec_str.c, vec_str.len); #else - do_writev(vec, n, len TSRMLS_CC); + do_writev(vec, n, len); #endif VEC_FREE(); @@ -245,7 +245,7 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) #define CONSUME_BYTES(n) do { TG(hc)->checked_idx += (n); } while (0) -static int sapi_thttpd_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_thttpd_read_post(char *buffer, uint count_bytes) { size_t read_bytes = 0; @@ -259,32 +259,32 @@ static int sapi_thttpd_read_post(char *buffer, uint count_bytes TSRMLS_DC) return read_bytes; } -static char *sapi_thttpd_read_cookies(TSRMLS_D) +static char *sapi_thttpd_read_cookies(void) { return TG(hc)->cookie; } #define BUF_SIZE 512 #define ADD_STRING_EX(name,buf) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) + php_register_variable(name, buf, track_vars_array) #define ADD_STRING(name) ADD_STRING_EX((name), buf) -static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_thttpd_register_variables(zval *track_vars_array) { char buf[BUF_SIZE + 1]; char *p; - php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC); + php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array); + php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array); + php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array); + php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array); + php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array); + php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array); if (TG(hc)->one_one) { - php_register_variable("SERVER_PROTOCOL", "HTTP/1.1", track_vars_array TSRMLS_CC); + php_register_variable("SERVER_PROTOCOL", "HTTP/1.1", track_vars_array); } else { - php_register_variable("SERVER_PROTOCOL", "HTTP/1.0", track_vars_array TSRMLS_CC); + php_register_variable("SERVER_PROTOCOL", "HTTP/1.0", track_vars_array); } p = httpd_ntoa(&TG(hc)->client_addr); @@ -306,7 +306,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC) #define CONDADD(name, field) \ if (TG(hc)->field[0]) { \ - php_register_variable(#name, TG(hc)->field, track_vars_array TSRMLS_CC); \ + php_register_variable(#name, TG(hc)->field, track_vars_array); \ } CONDADD(QUERY_STRING, query); @@ -328,7 +328,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC) } if (TG(hc)->authorization[0]) - php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC); + php_register_variable("AUTH_TYPE", "Basic", track_vars_array); } static PHP_MINIT_FUNCTION(thttpd) @@ -349,7 +349,7 @@ static zend_module_entry php_thttpd_module = { STANDARD_MODULE_PROPERTIES }; -static int php_thttpd_startup(sapi_module_struct *sapi_module TSRMLS_DC) +static int php_thttpd_startup(sapi_module_struct *sapi_module) { #if PHP_API_VERSION >= 20020918 if (php_module_startup(sapi_module, &php_thttpd_module, 1) == FAILURE) { @@ -363,7 +363,7 @@ static int php_thttpd_startup(sapi_module_struct *sapi_module TSRMLS_DC) return SUCCESS; } -static int sapi_thttpd_get_fd(int *nfd TSRMLS_DC) +static int sapi_thttpd_get_fd(int *nfd) { if (nfd) *nfd = TG(hc)->conn_fd; return SUCCESS; @@ -408,11 +408,11 @@ static sapi_module_struct thttpd_sapi_module = { sapi_thttpd_get_fd }; -static void thttpd_module_main(int show_source TSRMLS_DC) +static void thttpd_module_main(int show_source) { zend_file_handle file_handle; - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { return; } @@ -420,20 +420,20 @@ static void thttpd_module_main(int show_source TSRMLS_DC) zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); - highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC); + highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini); } else { file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = SG(request_info).path_translated; file_handle.free_filename = 0; file_handle.opened_path = NULL; - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); } php_request_shutdown(NULL); } -static void thttpd_request_ctor(TSRMLS_D) +static void thttpd_request_ctor(void) { smart_str s = {0}; @@ -463,10 +463,10 @@ static void thttpd_request_ctor(TSRMLS_D) TG(unconsumed_length) = SG(request_info).content_length; - php_handle_auth_data(TG(hc)->authorization TSRMLS_CC); + php_handle_auth_data(TG(hc)->authorization); } -static void thttpd_request_dtor(TSRMLS_D) +static void thttpd_request_dtor(void) { smart_str_free(&TG(sbuf)); if (SG(request_info).query_string) @@ -596,7 +596,7 @@ static void queue_request(httpd_conn *hc) tsrm_mutex_unlock(qr_lock); } -static off_t thttpd_real_php_request(httpd_conn *hc, int TSRMLS_DC); +static off_t thttpd_real_php_request(httpd_conn *hc, int); static void *worker_thread(void *dummy) { @@ -615,7 +615,7 @@ static void *worker_thread(void *dummy) thread_atomic_dec(nr_free_threads); - thttpd_real_php_request(hc, 0 TSRMLS_CC); + thttpd_real_php_request(hc, 0); shutdown(hc->conn_fd, 0); destroy_conn(hc); free(hc); @@ -654,7 +654,7 @@ static void remove_dead_conn(int fd) #endif -static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC) +static off_t thttpd_real_php_request(httpd_conn *hc, int show_source) { TG(hc) = hc; hc->bytes_sent = 0; @@ -670,9 +670,9 @@ static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC) return 0; } - thttpd_request_ctor(TSRMLS_C); + thttpd_request_ctor(); - thttpd_module_main(show_source TSRMLS_CC); + thttpd_module_main(show_source); /* disable kl, if no content-length was seen or Connection: was set */ if (TG(seen_cl) == 0 || TG(seen_cn) == 1) { @@ -692,7 +692,7 @@ static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC) TG(sbuf).a = 0; } - thttpd_request_dtor(TSRMLS_C); + thttpd_request_dtor(); return 0; } @@ -702,32 +702,27 @@ off_t thttpd_php_request(httpd_conn *hc, int show_source) #ifdef ZTS queue_request(hc); #else - TSRMLS_FETCH(); - return thttpd_real_php_request(hc, show_source TSRMLS_CC); + return thttpd_real_php_request(hc, show_source); #endif } void thttpd_register_on_close(void (*arg)(int)) { - TSRMLS_FETCH(); TG(on_close) = arg; } void thttpd_closed_conn(int fd) { - TSRMLS_FETCH(); if (TG(on_close)) TG(on_close)(fd); } int thttpd_get_fd(void) { - TSRMLS_FETCH(); return TG(hc)->conn_fd; } void thttpd_set_dont_close(void) { - TSRMLS_FETCH(); #ifndef PREMIUM_THTTPD TG(hc)->file_address = (char *) 1; #endif @@ -753,15 +748,13 @@ void thttpd_php_init(void) thttpd_sapi_module.startup(&thttpd_sapi_module); { - TSRMLS_FETCH(); - + SG(server_context) = (void *) 1; } } void thttpd_php_shutdown(void) { - TSRMLS_FETCH(); if (SG(server_context) != NULL) { thttpd_sapi_module.shutdown(&thttpd_sapi_module); diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c index 783fe852bc..8af7da40fa 100644 --- a/sapi/tux/php_tux.c +++ b/sapi/tux/php_tux.c @@ -49,7 +49,7 @@ static php_tux_globals tux_globals; #define TG(v) (tux_globals.v) -static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC) +static int sapi_tux_ub_write(const char *str, uint str_length) { int n; int m; @@ -96,7 +96,7 @@ static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC) return n; } -static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) +static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers) { char buf[1024]; struct iovec *vec; @@ -157,7 +157,7 @@ static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) return SAPI_HEADER_SENT_SUCCESSFULLY; } -static int sapi_tux_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_tux_read_post(char *buffer, uint count_bytes) { #if 0 int amount = 0; @@ -175,16 +175,16 @@ static int sapi_tux_read_post(char *buffer, uint count_bytes TSRMLS_DC) #endif } -static char *sapi_tux_read_cookies(TSRMLS_D) +static char *sapi_tux_read_cookies(void) { return TG(req)->cookies; } #define BUF_SIZE 512 #define ADD_STRING(name) \ - php_register_variable(name, buf, track_vars_array TSRMLS_CC) + php_register_variable(name, buf, track_vars_array) -static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_tux_register_variables(zval *track_vars_array) { char buf[BUF_SIZE + 1]; char *p; @@ -192,16 +192,16 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC) ctr.line = buf; ctr.line_len = slprintf(buf, sizeof(buf), "Server: %s", TUXAPI_version); - sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); + sapi_header_op(SAPI_HEADER_REPLACE, &ctr); - php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array TSRMLS_CC); - php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC); - php_register_variable("DOCUMENT_ROOT", TUXAPI_docroot, track_vars_array TSRMLS_CC); - php_register_variable("SERVER_NAME", TUXAPI_servername, track_vars_array TSRMLS_CC); - php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC); - php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC); + php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array); + php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array); + php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array); + php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array); + php_register_variable("DOCUMENT_ROOT", TUXAPI_docroot, track_vars_array); + php_register_variable("SERVER_NAME", TUXAPI_servername, track_vars_array); + php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array); + php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array); p = inet_ntoa(TG(req)->client_host); /* string representation of IPs are never larger than 512 bytes */ @@ -224,7 +224,7 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC) #define CONDADD(name, field) \ if (TG(req)->field[0]) { \ - php_register_variable(#name, TG(req)->field, track_vars_array TSRMLS_CC); \ + php_register_variable(#name, TG(req)->field, track_vars_array); \ } CONDADD(HTTP_REFERER, referer); @@ -244,7 +244,7 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC) #if 0 if (TG(hc)->authorization[0]) - php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC); + php_register_variable("AUTH_TYPE", "Basic", track_vars_array); #endif } @@ -289,7 +289,7 @@ static sapi_module_struct tux_sapi_module = { STANDARD_SAPI_MODULE_PROPERTIES }; -static void tux_module_main(TSRMLS_D) +static void tux_module_main(void) { zend_file_handle file_handle; @@ -298,15 +298,15 @@ static void tux_module_main(TSRMLS_D) file_handle.free_filename = 0; file_handle.opened_path = NULL; - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { return; } - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); php_request_shutdown(NULL); } -static void tux_request_ctor(TSRMLS_D) +static void tux_request_ctor(void) { char buf[1024]; int offset; @@ -340,11 +340,11 @@ static void tux_request_ctor(TSRMLS_D) SG(request_info).content_length = 0; /* TG(req)->contentlength; */ #if 0 - php_handle_auth_data(TG(hc)->authorization TSRMLS_CC); + php_handle_auth_data(TG(hc)->authorization); #endif } -static void tux_request_dtor(TSRMLS_D) +static void tux_request_dtor(void) { if (TG(header_vec)) { /* free status_line */ @@ -381,7 +381,6 @@ static void *separate_thread(void *bla) int TUXAPI_handle_events(user_req_t *req) { - TSRMLS_FETCH(); if (req->event == PHP_TUX_BACKGROUND_CONN) { tux_closed_conn(req->sock); @@ -391,11 +390,11 @@ int TUXAPI_handle_events(user_req_t *req) TG(req) = req; TG(tux_action) = TUX_ACTION_FINISH_CLOSE_REQ; - tux_request_ctor(TSRMLS_C); + tux_request_ctor(); - tux_module_main(TSRMLS_C); + tux_module_main(); - tux_request_dtor(TSRMLS_C); + tux_request_dtor(); return tux(TG(tux_action), req); } @@ -407,21 +406,18 @@ void tux_register_on_close(void (*arg)(int)) void tux_closed_conn(int fd) { - TSRMLS_FETCH(); if (TG(on_close)) TG(on_close)(fd); } int tux_get_fd(void) { - TSRMLS_FETCH(); return TG(req)->sock; } void tux_set_dont_close(void) { - TSRMLS_FETCH(); TG(req)->event = PHP_TUX_BACKGROUND_CONN; tux(TUX_ACTION_POSTPONE_REQ, TG(req)); diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c index 2978131ac1..914855928a 100644 --- a/sapi/webjames/webjames.c +++ b/sapi/webjames/webjames.c @@ -39,7 +39,7 @@ static php_webjames_globals webjames_globals; #define WG(v) (webjames_globals.v) -static int sapi_webjames_ub_write(const char *str, uint str_length TSRMLS_DC) +static int sapi_webjames_ub_write(const char *str, uint str_length) /*unbuffered write - send data straight out to socket*/ { int totalbytes = 0; @@ -61,7 +61,7 @@ static int sapi_webjames_ub_write(const char *str, uint str_length TSRMLS_DC) return totalbytes; } -static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) +static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *server_context) /*send an HTTP header*/ { char *header = sapi_header->header; @@ -84,7 +84,7 @@ static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *ser } } -static int sapi_webjames_read_post(char *buffer, uint count_bytes TSRMLS_DC) +static int sapi_webjames_read_post(char *buffer, uint count_bytes) /*read some of the post data*/ { if (WG(conn)->body==NULL) return 0; @@ -94,26 +94,26 @@ static int sapi_webjames_read_post(char *buffer, uint count_bytes TSRMLS_DC) return count_bytes; } -static char *sapi_webjames_read_cookies(TSRMLS_D) +static char *sapi_webjames_read_cookies(void) { return WG(conn)->cookie; } #define BUF_SIZE 512 #define ADD_STRING(name,string)\ - php_register_variable(name, string, track_vars_array TSRMLS_CC) + php_register_variable(name, string, track_vars_array) #define ADD_NUM(name,field) {\ snprintf(buf, BUF_SIZE, "%d", WG(conn)->field);\ - php_register_variable(name, buf, track_vars_array TSRMLS_CC);\ + php_register_variable(name, buf, track_vars_array);\ } #define ADD_FIELD(name, field) \ if (WG(conn)->field) { \ - php_register_variable(name, WG(conn)->field, track_vars_array TSRMLS_CC); \ + php_register_variable(name, WG(conn)->field, track_vars_array); \ } -static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC) +static void sapi_webjames_register_variables(zval *track_vars_array) { char buf[BUF_SIZE + 1]; char *docroot; @@ -163,7 +163,7 @@ static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC) ADD_FIELD("HTTP_ACCEPT_ENCODING", acceptencoding); } -static void webjames_module_main(TSRMLS_D) +static void webjames_module_main(void) { zend_file_handle file_handle; FILE *fp=NULL; @@ -208,18 +208,17 @@ static void webjames_module_main(TSRMLS_D) file_handle.free_filename = 0; file_handle.opened_path = NULL; - if (php_request_startup(TSRMLS_C) == FAILURE) { + if (php_request_startup() == FAILURE) { return; } - php_execute_script(&file_handle TSRMLS_CC); + php_execute_script(&file_handle); php_request_shutdown(NULL); } static void webjames_php_close(struct connection *conn, int force) /*called by webjames if it wants to close the connection*/ { - TSRMLS_FETCH(); php_request_shutdown(NULL); WG(oldclose)(conn,force); @@ -228,14 +227,13 @@ static void webjames_php_close(struct connection *conn, int force) void webjames_php_request(struct connection *conn) /*called by WebJames to start handler*/ { - TSRMLS_FETCH(); WG(conn) = conn; WG(bodyread) = 0; WG(oldclose) = conn->close; conn->close=webjames_php_close; - webjames_module_main(TSRMLS_C); + webjames_module_main(); WG(oldclose)(WG(conn), 0); } @@ -309,7 +307,6 @@ static sapi_module_struct sapi_module = { int webjames_php_init(void) /*called when WebJames initialises*/ { - TSRMLS_FETCH(); if (strcmp(configuration.webjames_h_revision,WEBJAMES_H_REVISION)!=0) { /*This file was compiled against a different revision of webjames.h than webjames was, which could be bad news*/ |