diff options
| author | Zeev Suraski <zeev@php.net> | 2001-07-27 10:16:41 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2001-07-27 10:16:41 +0000 |
| commit | fe6f8712a439c8b5046a03bca9ce5ae8e75aa4f5 (patch) | |
| tree | c7bc98cac58386828871aae860f90cac0ebdcf8f /main | |
| parent | 2c254ba762d9392a732d5793b5b193ee6e395f1c (diff) | |
| download | php-git-fe6f8712a439c8b5046a03bca9ce5ae8e75aa4f5.tar.gz | |
- Get rid of ELS_*(), and use TSRMLS_*() instead.
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
Diffstat (limited to 'main')
| -rw-r--r-- | main/SAPI.c | 6 | ||||
| -rw-r--r-- | main/SAPI.h | 2 | ||||
| -rw-r--r-- | main/fopen_wrappers.c | 4 | ||||
| -rw-r--r-- | main/main.c | 69 | ||||
| -rw-r--r-- | main/output.c | 14 | ||||
| -rw-r--r-- | main/php_content_types.c | 2 | ||||
| -rw-r--r-- | main/php_ini.c | 2 | ||||
| -rw-r--r-- | main/php_main.h | 6 | ||||
| -rw-r--r-- | main/php_variables.c | 23 | ||||
| -rw-r--r-- | main/php_variables.h | 10 | ||||
| -rw-r--r-- | main/rfc1867.c | 40 |
11 files changed, 92 insertions, 86 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index 2cce6a85f2..466e673de3 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -48,7 +48,7 @@ SAPI_API int sapi_globals_id; sapi_globals_struct sapi_globals; #endif -static void sapi_globals_ctor(sapi_globals_struct *sapi_globals) +static void sapi_globals_ctor(sapi_globals_struct *sapi_globals TSRMLS_DC) { memset(sapi_globals,0,sizeof(*sapi_globals)); } @@ -64,9 +64,9 @@ SAPI_API void sapi_startup(sapi_module_struct *sf) zend_hash_init_ex(&known_post_content_types, 5, NULL, NULL, 1, 0); #ifdef ZTS - sapi_globals_id = ts_allocate_id(sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, NULL); + ts_allocate_id(&sapi_globals_id, sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, NULL); #else - sapi_globals_ctor(&sapi_globals); + sapi_globals_ctor(&sapi_globals TSRMLS_CC); #endif #ifdef VIRTUAL_DIR diff --git a/main/SAPI.h b/main/SAPI.h index a9ce5922ae..00103225fc 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -184,7 +184,7 @@ struct _sapi_module_struct { int (*read_post)(char *buffer, uint count_bytes SLS_DC); char *(*read_cookies)(SLS_D); - void (*register_server_variables)(zval *track_vars_array ELS_DC SLS_DC PLS_DC); + void (*register_server_variables)(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC); void (*log_message)(char *message); char *php_ini_path_override; diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 6e05d059bb..ea1bc7a8dd 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -401,7 +401,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char ** int safe_mode_include_dir_length; int exec_fname_length; PLS_FETCH(); - ELS_FETCH(); + TSRMLS_FETCH(); if (opened_path) { *opened_path = NULL; @@ -466,7 +466,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char ** * as a fall back case */ if (zend_is_executing()) { - exec_fname = zend_get_executed_filename(ELS_C); + exec_fname = zend_get_executed_filename(TSRMLS_C); exec_fname_length = strlen(exec_fname); path_length = strlen(path); diff --git a/main/main.c b/main/main.c index f69ba04826..7d09d2b66e 100644 --- a/main/main.c +++ b/main/main.c @@ -83,7 +83,7 @@ php_core_globals core_globals; PHPAPI int core_globals_id; #endif -static void php_build_argv(char *s, zval *track_vars_array ELS_DC PLS_DC); +static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC PLS_DC); #define SAFE_FILENAME(f) ((f)?(f):"-") @@ -91,7 +91,7 @@ static void php_build_argv(char *s, zval *track_vars_array ELS_DC PLS_DC); */ static PHP_INI_MH(OnSetPrecision) { - ELS_FETCH(); + TSRMLS_FETCH(); EG(precision) = atoi(new_value); return SUCCESS; @@ -119,7 +119,7 @@ static PHP_INI_MH(OnChangeMemoryLimit) */ static PHP_INI_MH(OnUpdateErrorReporting) { - ELS_FETCH(); + TSRMLS_FETCH(); if (!new_value) { EG(error_reporting) = E_ALL & ~E_NOTICE; @@ -151,7 +151,7 @@ static void php_disable_functions() */ static PHP_INI_MH(OnUpdateTimeout) { - ELS_FETCH(); + TSRMLS_FETCH(); EG(timeout_seconds) = atoi(new_value); if (stage==PHP_INI_STAGE_STARTUP) { @@ -343,7 +343,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ { char buffer[1024]; int buffer_len; - ELS_FETCH(); + TSRMLS_FETCH(); PLS_FETCH(); buffer_len = vsnprintf(buffer, sizeof(buffer)-1, format, args); @@ -553,7 +553,7 @@ static void php_message_handler_for_zend(long message, void *data) break; case ZMSG_MEMORY_LEAK_DETECTED: case ZMSG_MEMORY_LEAK_REPEATED: { - ELS_FETCH(); + TSRMLS_FETCH(); if (EG(error_reporting)&E_WARNING) { #if ZEND_DEBUG @@ -614,11 +614,11 @@ static void sigchld_handler(int apar) /* }}} */ #endif -static int php_hash_environment(ELS_D SLS_DC PLS_DC); +static int php_hash_environment(TSRMLS_D SLS_DC PLS_DC); /* {{{ php_request_startup */ -int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) +int php_request_startup(CLS_D TSRMLS_DC PLS_DC SLS_DC) { int retval = SUCCESS; @@ -636,7 +636,7 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) PG(header_is_being_sent) = 0; PG(connection_status) = PHP_CONNECTION_NORMAL; - zend_activate(CLS_C ELS_CC); + zend_activate(CLS_C TSRMLS_CC); sapi_activate(SLS_C); zend_set_timeout(EG(timeout_seconds)); @@ -662,7 +662,7 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) /* We turn this off in php_execute_script() */ /* PG(during_request_startup) = 0; */ - php_hash_environment(ELS_C SLS_CC PLS_CC); + php_hash_environment(TSRMLS_C SLS_CC PLS_CC); zend_activate_modules(); PG(modules_activated)=1; } zend_catch { @@ -688,10 +688,12 @@ void php_request_shutdown_for_exec(void *dummy) void php_request_shutdown(void *dummy) { CLS_FETCH(); - ELS_FETCH(); + TSRMLS_FETCH(); SLS_FETCH(); PLS_FETCH(); + return; + zend_try { php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1)); } zend_end_try(); @@ -708,7 +710,7 @@ void php_request_shutdown(void *dummy) zend_deactivate_modules(); } - zend_deactivate(CLS_C ELS_CC); + zend_deactivate(CLS_C TSRMLS_CC); zend_try { sapi_deactivate(SLS_C); @@ -743,7 +745,7 @@ static int php_body_write_wrapper(const char *str, uint str_length) #ifdef ZTS /* {{{ core_globals_ctor */ -static void core_globals_ctor(php_core_globals *core_globals) +static void core_globals_ctor(php_core_globals *core_globals TSRMLS_DC) { memset(core_globals,0,sizeof(*core_globals)); } @@ -779,6 +781,7 @@ int php_module_startup(sapi_module_struct *sf) char *php_os; #ifdef ZTS zend_executor_globals *executor_globals; + void ***tsrm_ls; php_core_globals *core_globals; sapi_globals_struct *sapi_globals = ts_resource(sapi_globals_id); #endif @@ -826,7 +829,8 @@ int php_module_startup(sapi_module_struct *sf) #ifdef ZTS executor_globals = ts_resource(executor_globals_id); - core_globals_id = ts_allocate_id(sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, NULL); + tsrm_ls = ts_resource(0); + ts_allocate_id(&core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, NULL); core_globals = ts_resource(core_globals_id); #endif EG(bailout_set) = 0; @@ -951,6 +955,7 @@ void php_module_shutdown() int module_number=0; /* for UNREGISTER_INI_ENTRIES() */ PLS_FETCH(); + return; if (!module_initialized) { return; } @@ -971,7 +976,7 @@ void php_module_shutdown() php_shutdown_info_logos(); UNREGISTER_INI_ENTRIES(); #ifndef ZTS - zend_ini_shutdown(ELS_C); + zend_ini_shutdown(TSRMLS_C); #endif shutdown_memory_manager(0, 1); module_initialized = 0; @@ -980,7 +985,7 @@ void php_module_shutdown() /* {{{ php_register_server_variables */ -static inline void php_register_server_variables(ELS_D SLS_DC PLS_DC) +static inline void php_register_server_variables(TSRMLS_D SLS_DC PLS_DC) { zval *array_ptr=NULL; @@ -991,27 +996,27 @@ static inline void php_register_server_variables(ELS_D SLS_DC PLS_DC) /* Server variables */ if (sapi_module.register_server_variables) { - sapi_module.register_server_variables(array_ptr ELS_CC SLS_CC PLS_CC); + sapi_module.register_server_variables(array_ptr TSRMLS_CC SLS_CC PLS_CC); } /* argv/argc support */ if (PG(register_argc_argv)) { - php_build_argv(SG(request_info).query_string, array_ptr ELS_CC PLS_CC); + php_build_argv(SG(request_info).query_string, array_ptr TSRMLS_CC PLS_CC); } /* PHP Authentication support */ if (SG(request_info).auth_user) { - php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, array_ptr ELS_CC PLS_CC); + php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, array_ptr TSRMLS_CC PLS_CC); } if (SG(request_info).auth_password) { - php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr ELS_CC PLS_CC); + php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr TSRMLS_CC PLS_CC); } } /* }}} */ /* {{{ php_hash_environment */ -static int php_hash_environment(ELS_D SLS_DC PLS_DC) +static int php_hash_environment(TSRMLS_D SLS_DC PLS_DC) { char *p; unsigned char _gpc_flags[3] = {0,0,0}; @@ -1051,7 +1056,7 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC) ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]); array_init(PG(http_globals)[TRACK_VARS_ENV]); INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]); - php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] ELS_CC PLS_CC); + php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC PLS_CC); } while(p && *p) { @@ -1059,21 +1064,21 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC) case 'p': case 'P': if (!_gpc_flags[0] && !SG(headers_sent) && SG(request_info).request_method && !strcasecmp(SG(request_info).request_method, "POST")) { - php_treat_data(PARSE_POST, NULL, NULL ELS_CC PLS_CC SLS_CC); /* POST Data */ + php_treat_data(PARSE_POST, NULL, NULL TSRMLS_CC PLS_CC SLS_CC); /* POST Data */ _gpc_flags[0]=1; } break; case 'c': case 'C': if (!_gpc_flags[1]) { - php_treat_data(PARSE_COOKIE, NULL, NULL ELS_CC PLS_CC SLS_CC); /* Cookie Data */ + php_treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC PLS_CC SLS_CC); /* Cookie Data */ _gpc_flags[1]=1; } break; case 'g': case 'G': if (!_gpc_flags[2]) { - php_treat_data(PARSE_GET, NULL, NULL ELS_CC PLS_CC SLS_CC); /* GET Data */ + php_treat_data(PARSE_GET, NULL, NULL TSRMLS_CC PLS_CC SLS_CC); /* GET Data */ _gpc_flags[2]=1; } break; @@ -1083,20 +1088,20 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC) ALLOC_ZVAL(PG(http_globals)[TRACK_VARS_ENV]); array_init(PG(http_globals)[TRACK_VARS_ENV]); INIT_PZVAL(PG(http_globals)[TRACK_VARS_ENV]); - php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] ELS_CC PLS_CC); + php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC PLS_CC); } else { php_error(E_WARNING, "Unsupported 'e' element (environment) used in gpc_order - use variables_order instead"); } break; case 's': case 'S': - php_register_server_variables(ELS_C SLS_CC PLS_CC); + php_register_server_variables(TSRMLS_C SLS_CC PLS_CC); break; } } if (!have_variables_order) { - php_register_server_variables(ELS_C SLS_CC PLS_CC); + php_register_server_variables(TSRMLS_C SLS_CC PLS_CC); } for (i=0; i<6; i++) { @@ -1119,7 +1124,7 @@ static int php_hash_environment(ELS_D SLS_DC PLS_DC) /* {{{ php_build_argv */ -static void php_build_argv(char *s, zval *track_vars_array ELS_DC PLS_DC) +static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC PLS_DC) { pval *arr, *argc, *tmp; int count = 0; @@ -1195,7 +1200,7 @@ PHPAPI int php_handle_special_queries(SLS_D PLS_DC) /* {{{ php_execute_script */ -PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC) +PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC TSRMLS_DC PLS_DC) { zend_file_handle *prepend_file_p, *append_file_p; zend_file_handle prepend_file, append_file; @@ -1241,7 +1246,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_D } else { append_file_p = NULL; } - zend_execute_scripts(ZEND_REQUIRE CLS_CC ELS_CC, 3, prepend_file_p, primary_file, append_file_p); + zend_execute_scripts(ZEND_REQUIRE CLS_CC TSRMLS_CC, 3, prepend_file_p, primary_file, append_file_p); } zend_end_try(); if (old_cwd[0] != '\0') { @@ -1301,7 +1306,7 @@ PHPAPI int php_handle_auth_data(const char *auth SLS_DC) /* {{{ php_lint_script */ -PHPAPI int php_lint_script(zend_file_handle *file CLS_DC ELS_DC PLS_DC) +PHPAPI int php_lint_script(zend_file_handle *file CLS_DC TSRMLS_DC PLS_DC) { zend_op_array *op_array; diff --git a/main/output.c b/main/output.c index e0d9331678..9ded7e65e4 100644 --- a/main/output.c +++ b/main/output.c @@ -50,7 +50,7 @@ static int php_default_output_func(const char *str, uint str_len) } -static void php_output_init_globals(OLS_D) +static void php_output_init_globals(OLS_D TSRMLS_DC) { OG(php_body_write) = php_default_output_func; OG(php_header_write) = php_default_output_func; @@ -64,9 +64,9 @@ static void php_output_init_globals(OLS_D) PHPAPI void php_output_startup(void) { #ifdef ZTS - output_globals_id = ts_allocate_id(sizeof(php_output_globals), (ts_allocate_ctor) php_output_init_globals, NULL); + ts_allocate_id(&output_globals_id, sizeof(php_output_globals), (ts_allocate_ctor) php_output_init_globals, NULL); #else - php_output_init_globals(OLS_C); + php_output_init_globals(OLS_C TSRMLS_CC); #endif } @@ -93,7 +93,7 @@ PHPAPI void php_output_set_status(zend_bool status) void php_output_register_constants() { - ELS_FETCH(); + TSRMLS_FETCH(); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT); @@ -499,10 +499,10 @@ static int php_ub_body_write(const char *str, uint str_length) OG(output_start_filename) = zend_get_compiled_filename(CLS_C); OG(output_start_lineno) = zend_get_compiled_lineno(CLS_C); } else if (zend_is_executing()) { - ELS_FETCH(); + TSRMLS_FETCH(); - OG(output_start_filename) = zend_get_executed_filename(ELS_C); - OG(output_start_lineno) = zend_get_executed_lineno(ELS_C); + OG(output_start_filename) = zend_get_executed_filename(TSRMLS_C); + OG(output_start_lineno) = zend_get_executed_lineno(TSRMLS_C); } OG(php_body_write) = php_ub_body_write_no_header; diff --git a/main/php_content_types.c b/main/php_content_types.c index 23ca6397b3..902e5e9e0b 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -38,7 +38,7 @@ static sapi_post_entry php_post_entries[] = { SAPI_POST_READER_FUNC(php_default_post_reader) { char *data; - ELS_FETCH(); + TSRMLS_FETCH(); if(!SG(request_info).post_data) sapi_read_standard_form_data(SLS_C); data = estrndup(SG(request_info).post_data,SG(request_info).post_data_length); diff --git a/main/php_ini.c b/main/php_ini.c index 1358f6cdae..586298131c 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -100,7 +100,7 @@ static int php_ini_displayer(zend_ini_entry *ini_entry, int module_number) PHPAPI void display_ini_entries(zend_module_entry *module) { int module_number; - ELS_FETCH(); + TSRMLS_FETCH(); if (module) { module_number = module->module_number; diff --git a/main/php_main.h b/main/php_main.h index e8b813620e..ff371f5efa 100644 --- a/main/php_main.h +++ b/main/php_main.h @@ -28,7 +28,7 @@ #include "php_globals.h" #include "SAPI.h" -PHPAPI int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC); +PHPAPI int php_request_startup(CLS_D TSRMLS_DC PLS_DC SLS_DC); PHPAPI void php_request_shutdown(void *dummy); PHPAPI void php_request_shutdown_for_exec(void *dummy); PHPAPI int php_module_startup(sapi_module_struct *sf); @@ -38,9 +38,9 @@ PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals); PHPAPI int php_startup_extensions(zend_module_entry **ptr, int count); -PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC); +PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC TSRMLS_DC PLS_DC); PHPAPI int php_handle_special_queries(SLS_D PLS_DC); -PHPAPI int php_lint_script(zend_file_handle *file CLS_DC ELS_DC PLS_DC); +PHPAPI int php_lint_script(zend_file_handle *file CLS_DC TSRMLS_DC PLS_DC); PHPAPI void php_handle_aborted_connection(void); PHPAPI int php_handle_auth_data(const char *auth SLS_DC); diff --git a/main/php_variables.c b/main/php_variables.c index bb577fa609..9e0ae88a62 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -29,12 +29,13 @@ #include "zend_globals.h" -PHPAPI void php_register_variable(char *var, char *strval, zval *track_vars_array ELS_DC PLS_DC) { - php_register_variable_safe(var, strval, strlen(strval), track_vars_array ELS_CC PLS_CC); +PHPAPI void php_register_variable(char *var, char *strval, zval *track_vars_array TSRMLS_DC PLS_DC) +{ + php_register_variable_safe(var, strval, strlen(strval), track_vars_array TSRMLS_CC PLS_CC); } /* binary-safe version */ -PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zval *track_vars_array ELS_DC PLS_DC) +PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zval *track_vars_array TSRMLS_DC PLS_DC) { zval new_entry; @@ -47,11 +48,11 @@ PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zva } new_entry.type = IS_STRING; - php_register_variable_ex(var, &new_entry, track_vars_array ELS_CC PLS_CC); + php_register_variable_ex(var, &new_entry, track_vars_array TSRMLS_CC PLS_CC); } -PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_array ELS_DC PLS_DC) +PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_array TSRMLS_DC PLS_DC) { char *p = NULL; char *ip; /* index pointer */ @@ -195,7 +196,7 @@ SAPI_POST_HANDLER_FUNC(php_std_post_handler) char *var, *val; char *strtok_buf = NULL; zval *array_ptr = (zval *) arg; - ELS_FETCH(); + TSRMLS_FETCH(); PLS_FETCH(); var = php_strtok_r(SG(request_info).post_data, "&", &strtok_buf); @@ -208,14 +209,14 @@ SAPI_POST_HANDLER_FUNC(php_std_post_handler) *val++ = '\0'; php_url_decode(var, strlen(var)); val_len = php_url_decode(val, strlen(val)); - php_register_variable_safe(var, val, val_len, array_ptr ELS_CC PLS_CC); + php_register_variable_safe(var, val, val_len, array_ptr TSRMLS_CC PLS_CC); } var = php_strtok_r(NULL, "&", &strtok_buf); } } -void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC) +void php_treat_data(int arg, char *str, zval* destArray TSRMLS_DC PLS_DC SLS_DC) { char *res = NULL, *var, *val, *separator=NULL; const char *c_var; @@ -297,7 +298,7 @@ void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC) *val++ = '\0'; php_url_decode(var, strlen(var)); val_len = php_url_decode(val, strlen(val)); - php_register_variable_safe(var, val, val_len, array_ptr ELS_CC PLS_CC); + php_register_variable_safe(var, val, val_len, array_ptr TSRMLS_CC PLS_CC); } var = php_strtok_r(NULL, separator, &strtok_buf); } @@ -312,7 +313,7 @@ void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC) } -void php_import_environment_variables(zval *array_ptr ELS_DC PLS_DC) +void php_import_environment_variables(zval *array_ptr TSRMLS_DC PLS_DC) { char **env, *p, *t; @@ -322,7 +323,7 @@ void php_import_environment_variables(zval *array_ptr ELS_DC PLS_DC) continue; } t = estrndup(*env, p - *env); - php_register_variable(t, p+1, array_ptr ELS_CC PLS_CC); + php_register_variable(t, p+1, array_ptr TSRMLS_CC PLS_CC); efree(t); } } diff --git a/main/php_variables.h b/main/php_variables.h index 55c139341c..03c47db216 100644 --- a/main/php_variables.h +++ b/main/php_variables.h @@ -30,12 +30,12 @@ #define PARSE_COOKIE 2 #define PARSE_STRING 3 -void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC); -PHPAPI void php_import_environment_variables(zval *array_ptr ELS_DC PLS_DC); -PHPAPI void php_register_variable(char *var, char *val, pval *track_vars_array ELS_DC PLS_DC); +void php_treat_data(int arg, char *str, zval* destArray TSRMLS_DC PLS_DC SLS_DC); +PHPAPI void php_import_environment_variables(zval *array_ptr TSRMLS_DC PLS_DC); +PHPAPI void php_register_variable(char *var, char *val, pval *track_vars_array TSRMLS_DC PLS_DC); /* binary-safe version */ -PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, pval *track_vars_array ELS_DC PLS_DC); -PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_array ELS_DC PLS_DC); +PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, pval *track_vars_array TSRMLS_DC PLS_DC); +PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_array TSRMLS_DC PLS_DC); #endif /* PHP_VARIABLES_H */ diff --git a/main/rfc1867.c b/main/rfc1867.c index aaff8f8bf6..1806b4f125 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -47,38 +47,38 @@ static zend_bool is_protected_variable(char *varname PLS_DC) } -static void safe_php_register_variable(char *var, char *strval, zval *track_vars_array, zend_bool override_protection ELS_DC PLS_DC) +static void safe_php_register_variable(char *var, char *strval, zval *track_vars_array, zend_bool override_protection TSRMLS_DC PLS_DC) { if (override_protection || !is_protected_variable(var PLS_CC)) { - php_register_variable(var, strval, track_vars_array ELS_CC PLS_CC); + php_register_variable(var, strval, track_vars_array TSRMLS_CC PLS_CC); } } -static void safe_php_register_variable_ex(char *var, zval *val, pval *track_vars_array, zend_bool override_protection ELS_DC PLS_DC) +static void safe_php_register_variable_ex(char *var, zval *val, pval *track_vars_array, zend_bool override_protection TSRMLS_DC PLS_DC) { if (override_protection || !is_protected_variable(var PLS_CC)) { - php_register_variable_ex(var, val, track_vars_array ELS_CC PLS_CC); + php_register_variable_ex(var, val, track_vars_array TSRMLS_CC PLS_CC); } } -static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection ELS_DC PLS_DC) +static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC PLS_DC) { int register_globals = PG(register_globals); PG(register_globals) = 0; - safe_php_register_variable(strvar, val, http_post_files, override_protection ELS_CC PLS_CC); + safe_php_register_variable(strvar, val, http_post_files, override_protection TSRMLS_CC PLS_CC); PG(register_globals) = register_globals; } -static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection ELS_DC PLS_DC) +static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC PLS_DC) { int register_globals = PG(register_globals); PG(register_globals) = 0; - safe_php_register_variable_ex(var, val, http_post_files, override_protection ELS_CC PLS_CC); + safe_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC PLS_CC); PG(register_globals) = register_globals; } @@ -113,7 +113,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S zval *http_post_files=NULL; zend_bool upload_successful; zend_bool magic_quotes_gpc; - ELS_FETCH(); + TSRMLS_FETCH(); zend_hash_init(&PG(rfc1867_protected_variables), 5, NULL, NULL, 0); @@ -247,9 +247,9 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S } s = strrchr(filenamebuf, '\\'); if (s && s > filenamebuf) { - safe_php_register_variable(lbuf, s+1, NULL, 0 ELS_CC PLS_CC); + safe_php_register_variable(lbuf, s+1, NULL, 0 TSRMLS_CC PLS_CC); } else { - safe_php_register_variable(lbuf, filenamebuf, NULL, 0 ELS_CC PLS_CC); + safe_php_register_variable(lbuf, filenamebuf, NULL, 0 TSRMLS_CC PLS_CC); } /* Add $foo[name] */ @@ -259,9 +259,9 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S sprintf(lbuf, "%s[name]", namebuf); } if (s && s > filenamebuf) { - register_http_post_files_variable(lbuf, s+1, http_post_files, 0 ELS_CC PLS_CC); + register_http_post_files_variable(lbuf, s+1, http_post_files, 0 TSRMLS_CC PLS_CC); } else { - register_http_post_files_variable(lbuf, filenamebuf, http_post_files, 0 ELS_CC PLS_CC); + register_http_post_files_variable(lbuf, filenamebuf, http_post_files, 0 TSRMLS_CC PLS_CC); } state = 3; @@ -291,7 +291,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S } else { sprintf(lbuf, "%s_type", namebuf); } - safe_php_register_variable(lbuf, s, NULL, 0 ELS_CC PLS_CC); + safe_php_register_variable(lbuf, s, NULL, 0 TSRMLS_CC PLS_CC); /* Add $foo[type] */ if (is_arr_upload) { @@ -299,7 +299,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S } else { sprintf(lbuf, "%s[type]", namebuf); } - register_http_post_files_variable(lbuf, s, http_post_files, 0 ELS_CC PLS_CC); + register_http_post_files_variable(lbuf, s, http_post_files, 0 TSRMLS_CC PLS_CC); if(*s != '\0') { *(loc2 - 1) = '\n'; } @@ -324,7 +324,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S /* Check to make sure we are not overwriting special file * upload variables */ - safe_php_register_variable(namebuf, ptr, array_ptr, 0 ELS_CC PLS_CC); + safe_php_register_variable(namebuf, ptr, array_ptr, 0 TSRMLS_CC PLS_CC); /* And a little kludge to pick out special MAX_FILE_SIZE */ itype = php_check_ident_type(namebuf); @@ -401,7 +401,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S magic_quotes_gpc = PG(magic_quotes_gpc); PG(magic_quotes_gpc) = 0; - safe_php_register_variable(namebuf, temp_filename, NULL, 1 ELS_CC PLS_CC); + safe_php_register_variable(namebuf, temp_filename, NULL, 1 TSRMLS_CC PLS_CC); /* Add $foo[tmp_name] */ if(is_arr_upload) { sprintf(lbuf, "%s[tmp_name][%s]", abuf, arr_index); @@ -409,7 +409,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S sprintf(lbuf, "%s[tmp_name]", namebuf); } add_protected_variable(lbuf PLS_CC); - register_http_post_files_variable(lbuf, temp_filename, http_post_files, 1 ELS_CC PLS_CC); + register_http_post_files_variable(lbuf, temp_filename, http_post_files, 1 TSRMLS_CC PLS_CC); PG(magic_quotes_gpc) = magic_quotes_gpc; { @@ -424,7 +424,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S } else { sprintf(lbuf, "%s_size", namebuf); } - safe_php_register_variable_ex(lbuf, &file_size, NULL, 0 ELS_CC PLS_CC); + safe_php_register_variable_ex(lbuf, &file_size, NULL, 0 TSRMLS_CC PLS_CC); /* Add $foo[size] */ if(is_arr_upload) { @@ -432,7 +432,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S } else { sprintf(lbuf, "%s[size]", namebuf); } - register_http_post_files_variable_ex(lbuf, &file_size, http_post_files, 0 ELS_CC PLS_CC); + register_http_post_files_variable_ex(lbuf, &file_size, http_post_files, 0 TSRMLS_CC PLS_CC); } state = 0; rem -= (loc - ptr); |
