summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/com/COM.c4
-rw-r--r--ext/ctype/ctype.c2
-rw-r--r--ext/curl/curl.c10
-rw-r--r--ext/db/db.c2
-rw-r--r--ext/ereg/ereg.c6
-rw-r--r--ext/fdf/fdf.c4
-rw-r--r--ext/hyperwave/hg_comm.c2
-rw-r--r--ext/java/java.c4
-rwxr-xr-xext/mailparse/mailparse.c2
-rw-r--r--ext/mbstring/mbstring.c10
-rw-r--r--ext/mhash/mhash.c2
-rw-r--r--ext/mssql/php_mssql.c2
-rw-r--r--ext/oci8/oci8.c8
-rw-r--r--ext/odbc/php_odbc.c4
-rw-r--r--ext/oracle/oracle.c8
-rw-r--r--ext/pcre/php_pcre.c17
-rw-r--r--ext/pgsql/pgsql.c8
-rw-r--r--ext/rpc/com/com_wrapper.c4
-rw-r--r--ext/rpc/java/java.c4
-rw-r--r--ext/sablot/sablot.c12
-rw-r--r--ext/session/mod_user.c2
-rw-r--r--ext/session/php_session.h6
-rw-r--r--ext/session/session.c10
-rw-r--r--ext/standard/array.c8
-rw-r--r--ext/standard/assert.c12
-rw-r--r--ext/standard/basic_functions.c17
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/dl.c6
-rw-r--r--ext/standard/file.c11
-rw-r--r--ext/standard/http_fopen_wrapper.c4
-rw-r--r--ext/standard/info.c18
-rw-r--r--ext/standard/lcg.c4
-rw-r--r--ext/standard/reg.c6
-rw-r--r--ext/standard/string.c4
-rw-r--r--ext/standard/syslog.c2
-rw-r--r--ext/standard/var.c6
-rw-r--r--ext/sybase/php_sybase_db.c2
-rw-r--r--ext/sybase_ct/php_sybase_ct.c2
-rw-r--r--ext/wddx/wddx.c4
-rw-r--r--ext/xml/xml.c6
-rw-r--r--ext/xslt/xslt.c2
-rw-r--r--ext/yp/yp.c2
-rw-r--r--ext/zlib/zlib.c8
-rw-r--r--main/SAPI.c6
-rw-r--r--main/SAPI.h2
-rw-r--r--main/fopen_wrappers.c4
-rw-r--r--main/main.c69
-rw-r--r--main/output.c14
-rw-r--r--main/php_content_types.c2
-rw-r--r--main/php_ini.c2
-rw-r--r--main/php_main.h6
-rw-r--r--main/php_variables.c23
-rw-r--r--main/php_variables.h10
-rw-r--r--main/rfc1867.c40
-rw-r--r--sapi/aolserver/aolserver.c12
-rw-r--r--sapi/apache/mod_php4.c22
-rw-r--r--sapi/apache/php_apache.c6
-rw-r--r--sapi/apache/sapi_apache.c6
-rw-r--r--sapi/apache2filter/sapi_apache2.c14
-rw-r--r--sapi/caudium/caudium.c56
-rw-r--r--sapi/cgi/cgi_main.c22
-rw-r--r--sapi/fastcgi/fastcgi.c10
-rw-r--r--sapi/isapi/php4isapi.c58
-rw-r--r--sapi/nsapi/nsapi.c30
-rw-r--r--sapi/phttpd/phttpd.c10
-rw-r--r--sapi/pi3web/pi3web_sapi.c12
-rw-r--r--sapi/roxen/roxen.c12
-rw-r--r--sapi/servlet/servlet.c8
-rw-r--r--sapi/thttpd/thttpd.c28
-rw-r--r--sapi/tux/php_tux.c30
70 files changed, 392 insertions, 381 deletions
diff --git a/ext/com/COM.c b/ext/com/COM.c
index b9b6d80590..360c689b77 100644
--- a/ext/com/COM.c
+++ b/ext/com/COM.c
@@ -1577,7 +1577,7 @@ static int php_COM_load_typelib(ITypeLib *TypeLib, int mode)
ITypeComp *TypeComp;
int i;
int interfaces;
- ELS_FETCH();
+ TSRMLS_FETCH();
if(NULL == TypeLib)
{
@@ -1646,7 +1646,7 @@ static int php_COM_load_typelib(ITypeLib *TypeLib, int mode)
/* Before registering the contsnt, let's see if we can find it */
{
- zend_register_constant(&c ELS_CC);
+ zend_register_constant(&c TSRMLS_CC);
}
j++;
}
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index 17bb8764b4..4fe50ef9de 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -85,7 +85,7 @@ ZEND_GET_MODULE(ctype)
*/
PHP_MINFO_FUNCTION(ctype)
{
- ELS_FETCH();
+ TSRMLS_FETCH();
SLS_FETCH();
php_info_print_table_start();
diff --git a/ext/curl/curl.c b/ext/curl/curl.c
index 79bf5898b0..238ca58c65 100644
--- a/ext/curl/curl.c
+++ b/ext/curl/curl.c
@@ -259,7 +259,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
php_curl *ch = (php_curl *) ctx;
php_curl_write *t = ch->handlers->write;
size_t length = size * nmemb;
- ELS_FETCH();
+ TSRMLS_FETCH();
switch (t->method) {
case PHP_CURL_STDOUT:
@@ -274,7 +274,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
zval *argv[2];
zval *retval;
int error;
- ELS_FETCH();
+ TSRMLS_FETCH();
MAKE_STD_ZVAL(argv[0]);
MAKE_STD_ZVAL(argv[1]);
@@ -315,7 +315,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
php_curl *ch = (php_curl *) ctx;
php_curl_read *t = ch->handlers->read;
int length = -1;
- ELS_FETCH();
+ TSRMLS_FETCH();
switch (t->method) {
case PHP_CURL_DIRECT:
@@ -371,7 +371,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
php_curl_write *t = ch->handlers->write_header;
int error;
int length;
- ELS_FETCH();
+ TSRMLS_FETCH();
switch (t->method) {
case PHP_CURL_STDOUT:
@@ -437,7 +437,7 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
zval *retval;
int error;
int ret = 0;
- ELS_FETCH();
+ TSRMLS_FETCH();
MAKE_STD_ZVAL(argv[0]);
MAKE_STD_ZVAL(argv[1]);
diff --git a/ext/db/db.c b/ext/db/db.c
index 17d6f0d1c6..1166c82bc9 100644
--- a/ext/db/db.c
+++ b/ext/db/db.c
@@ -174,7 +174,7 @@ dbm_info *php_find_dbm(pval *id)
dbm_info *info;
int numitems, i;
int info_type;
- ELS_FETCH();
+ TSRMLS_FETCH();
if (Z_TYPE_P(id) == IS_STRING) {
numitems = zend_hash_num_elements(&EG(regular_list));
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index bcd0111b8a..c962f2b8c4 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -84,7 +84,7 @@ static void _free_reg_cache(reg_cache *rc)
#undef regcomp
#define regcomp(a,b,c) _php_regcomp(a,b,c)
-static void php_reg_init_globals(php_reg_globals *reg_globals)
+static void php_reg_init_globals(php_reg_globals *reg_globals TSRMLS_DC)
{
zend_hash_init(&reg_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1);
}
@@ -92,9 +92,9 @@ static void php_reg_init_globals(php_reg_globals *reg_globals)
PHP_MINIT_FUNCTION(regex)
{
#ifdef ZTS
- reg_globals_id = ts_allocate_id(sizeof(php_reg_globals), (ts_allocate_ctor) php_reg_init_globals, NULL);
+ ts_allocate_id(&reg_globals_id, sizeof(php_reg_globals), (ts_allocate_ctor) php_reg_init_globals, NULL);
#else
- php_reg_init_globals(&reg_globals);
+ php_reg_init_globals(&reg_globals TSRMLS_CC);
#endif
return SUCCESS;
diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c
index 6f7910813f..76605e9186 100644
--- a/ext/fdf/fdf.c
+++ b/ext/fdf/fdf.c
@@ -731,7 +731,7 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler)
FDFErc err;
ASInt32 nBytes;
zval *array_ptr = (zval *) arg;
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
fp=php_open_temporary_file(NULL,"fdfdata.",&filename);
@@ -774,7 +774,7 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler)
for(p=value;*p;p++) if(*p=='\r') *p='\n';
if(lastfieldname) efree(lastfieldname);
lastfieldname = estrdup(name);
- php_register_variable(name, value, array_ptr ELS_CC PLS_CC);
+ php_register_variable(name, value, array_ptr TSRMLS_CC PLS_CC);
}
}
}
diff --git a/ext/hyperwave/hg_comm.c b/ext/hyperwave/hg_comm.c
index aca2956253..d25736b7d9 100644
--- a/ext/hyperwave/hg_comm.c
+++ b/ext/hyperwave/hg_comm.c
@@ -632,7 +632,7 @@ char *fnInsAnchorsIntoText(char *text, DLIST *pAnchorList, char **bodytag, char
int laststart=0;
char emptystring[BUFFERLEN];
int i;
- ELS_FETCH();
+ TSRMLS_FETCH();
emptystring[0] = '\0';
diff --git a/ext/java/java.c b/ext/java/java.c
index e596c16fc3..7a65baa4bd 100644
--- a/ext/java/java.c
+++ b/ext/java/java.c
@@ -599,7 +599,7 @@ static void _php_java_destructor(zend_rsrc_list_entry *rsrc)
}
#ifdef ZTS
-static void alloc_java_globals_ctor(php_java_globals *java_globals) {
+static void alloc_java_globals_ctor(php_java_globals *java_globals TSRMLS_DC) {
memset(java_globals, 0, sizeof(php_java_globals));
}
#endif
@@ -624,7 +624,7 @@ PHP_MINIT_FUNCTION(java) {
}
#ifdef ZTS
- java_globals_id = ts_allocate_id(sizeof(php_java_globals),
+ ts_allocate_id(&java_globals_id, sizeof(php_java_globals),
(ts_allocate_ctor)alloc_java_globals_ctor, NULL);
#endif
diff --git a/ext/mailparse/mailparse.c b/ext/mailparse/mailparse.c
index f1da1cc136..89d1231816 100755
--- a/ext/mailparse/mailparse.c
+++ b/ext/mailparse/mailparse.c
@@ -498,7 +498,7 @@ static int extract_callback_user_func(const char *p, size_t n, zval *userfunc)
{
zval * retval;
zval * arg;
- ELS_FETCH();
+ TSRMLS_FETCH();
MAKE_STD_ZVAL(retval);
retval->type = IS_BOOL;
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index ec4206a45b..b888876f23 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -819,7 +819,7 @@ php_mbstr_encoding_handler(zval *arg, char *res, char *separator) {
mbfl_encoding_detector *identd;
mbfl_buffer_converter *convd;
MBSTRLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
mbfl_string_init(&string);
@@ -919,10 +919,10 @@ php_mbstr_encoding_handler(zval *arg, char *res, char *separator) {
ret = mbfl_buffer_converter_feed_result(convd, &string, &result);
}
if (ret != NULL) {
- php_register_variable_safe(val_list[n], ret->val, ret->len, array_ptr ELS_CC PLS_CC);
+ php_register_variable_safe(val_list[n], ret->val, ret->len, array_ptr TSRMLS_CC PLS_CC);
efree(ret->val);
} else {
- php_register_variable_safe(val_list[n], val_list[n+1], len_list[n+1], array_ptr ELS_CC PLS_CC);
+ php_register_variable_safe(val_list[n], val_list[n+1], len_list[n+1], array_ptr TSRMLS_CC PLS_CC);
}
n+=2;
}
@@ -954,7 +954,7 @@ SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler)
}
/* http input processing */
-void mbstr_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC)
+void mbstr_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;
@@ -1239,7 +1239,7 @@ PHP_FUNCTION(mb_parse_str)
}
n++;
/* add variable to symbol table */
- php_register_variable_safe(var, val, val_len, track_vars_array ELS_CC PLS_CC);
+ php_register_variable_safe(var, val, val_len, track_vars_array TSRMLS_CC PLS_CC);
mbfl_string_clear(&resvar);
mbfl_string_clear(&resval);
}
diff --git a/ext/mhash/mhash.c b/ext/mhash/mhash.c
index 70d0dda27b..e630b7c392 100644
--- a/ext/mhash/mhash.c
+++ b/ext/mhash/mhash.c
@@ -71,7 +71,7 @@ static PHP_MINIT_FUNCTION(mhash)
snprintf(buf, 127, "MHASH_%s", name);
zend_register_long_constant(buf, strlen(buf) + 1,
i, CONST_PERSISTENT,
- module_number ELS_CC);
+ module_number TSRMLS_CC);
free(name);
}
}
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 1e815f0b5d..793d3258ca 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -227,7 +227,7 @@ static void _close_mssql_link(zend_rsrc_list_entry *rsrc)
{
mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr;
MSSQLLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
mssql_ptr->valid = 0;
zend_hash_apply(&EG(regular_list),(int (*)(void *))_clean_invalid_results);
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index c2e83adde3..0be9dcae92 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -395,7 +395,7 @@ CONST void ocifree(dvoid *ctx, dvoid *ptr)
/* }}} */
/* {{{ startup, shutdown and info functions */
-static void php_oci_init_globals(OCILS_D)
+static void php_oci_init_globals(OCILS_D TSRMLS_DC)
{
OCI(shutdown) = 0;
@@ -433,9 +433,9 @@ PHP_MINIT_FUNCTION(oci)
#endif
#ifdef ZTS
- oci_globals_id = ts_allocate_id(sizeof(php_oci_globals), (ts_allocate_ctor) php_oci_init_globals, NULL);
+ ts_allocate_id(&oci_globals_id, sizeof(php_oci_globals), (ts_allocate_ctor) php_oci_init_globals, NULL);
#else
- php_oci_init_globals(OCILS_C);
+ php_oci_init_globals(OCILS_C TSRMLS_CC);
#endif
le_stmt = zend_register_list_destructors_ex(_oci_stmt_list_dtor, NULL, "oci8 statement", module_number);
@@ -2360,7 +2360,7 @@ _oci_close_server(oci_server *server)
char *dbname;
int oldopen;
OCILS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
oldopen = server->is_open;
server->is_open = 2;
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index a4d24ed27a..a763cb8776 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -348,7 +348,7 @@ PHP_INI_BEGIN()
PHP_INI_END()
#ifdef ZTS
-static void php_odbc_init_globals(php_odbc_globals *odbc_globals)
+static void php_odbc_init_globals(php_odbc_globals *odbc_globals TSRMLS_DC)
{
ODBCG(num_persistent) = 0;
}
@@ -363,7 +363,7 @@ PHP_MINIT_FUNCTION(odbc)
#endif
#ifdef ZTS
- odbc_globals_id = ts_allocate_id(sizeof(php_odbc_globals), php_odbc_init_globals, NULL);
+ ts_allocate_id(&odbc_globals_id, sizeof(php_odbc_globals), php_odbc_init_globals, NULL);
odbc_globals = ts_resource(odbc_globals_id);
#else
ODBCG(num_persistent) = 0;
diff --git a/ext/oracle/oracle.c b/ext/oracle/oracle.c
index 3ea87d3dc8..37651537f3 100644
--- a/ext/oracle/oracle.c
+++ b/ext/oracle/oracle.c
@@ -286,7 +286,7 @@ static void php_close_ora_cursor(zend_rsrc_list_entry *rsrc)
/* {{{ php_ora_init_globals
*/
-static void php_ora_init_globals(ORALS_D)
+static void php_ora_init_globals(ORALS_D TSRMLS_DC)
{
if (cfg_get_long("oracle.allow_persistent",
&ORA(allow_persistent))
@@ -319,9 +319,9 @@ PHP_MINIT_FUNCTION(oracle)
{
#ifdef ZTS
- ora_globals_id = ts_allocate_id(sizeof(php_ora_globals), (ts_allocate_ctor) php_ora_init_globals, NULL);
+ ts_allocate_id(&ora_globals_id, sizeof(php_ora_globals), (ts_allocate_ctor) php_ora_init_globals, NULL);
#else
- php_ora_init_globals(ORALS_C);
+ php_ora_init_globals(ORALS_C TSRMLS_CC);
#endif
le_cursor = zend_register_list_destructors_ex(php_close_ora_cursor, NULL, "oracle cursor", module_number);
@@ -1742,7 +1742,7 @@ int ora_set_param_values(oraCursor *cursor, int isout)
pval **pdata;
int i, len, plen;
- ELS_FETCH();
+ TSRMLS_FETCH();
zend_hash_internal_pointer_reset(cursor->params);
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 6ea088e5c6..145994611c 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -76,7 +76,7 @@ static void php_pcre_init_globals(php_pcre_globals *pcre_globals)
}
-static void php_pcre_shutdown_globals(php_pcre_globals *pcre_globals)
+static void php_pcre_shutdown_globals(php_pcre_globals *pcre_globals TSRMLS_DC)
{
zend_hash_destroy(&PCRE_G(pcre_cache));
}
@@ -97,10 +97,11 @@ PHP_MINFO_FUNCTION(pcre)
static PHP_MINIT_FUNCTION(pcre)
{
#ifdef ZTS
- pcre_globals_id = ts_allocate_id(
- sizeof(php_pcre_globals),
- (ts_allocate_ctor) php_pcre_init_globals,
- (ts_allocate_dtor) php_pcre_shutdown_globals);
+ ts_allocate_id(
+ &pcre_globals_id,
+ sizeof(php_pcre_globals),
+ (ts_allocate_ctor) php_pcre_init_globals,
+ (ts_allocate_dtor) php_pcre_shutdown_globals);
#else
zend_hash_init(&PCRE_G(pcre_cache), 0, NULL, php_free_pcre_cache, 1);
#endif
@@ -565,7 +566,7 @@ static int preg_do_repl_func(zval *function, char *subject, int *offsets, int co
zval *subpats; /* Captured subpatterns */
int result_len; /* Return value length */
int i;
- ELS_FETCH();
+ TSRMLS_FETCH();
MAKE_STD_ZVAL(subpats);
array_init(subpats);
@@ -609,7 +610,7 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject,
char *compiled_string_description;
smart_str code = {0};
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
eval_str_end = eval_str + eval_str_len;
walk = segment = eval_str;
@@ -663,7 +664,7 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject,
compiled_string_description = zend_make_compiled_string_description("regexp code");
/* Run the code */
- if (zend_eval_string(code.c, &retval, compiled_string_description CLS_CC ELS_CC) == FAILURE) {
+ if (zend_eval_string(code.c, &retval, compiled_string_description CLS_CC TSRMLS_CC) == FAILURE) {
efree(compiled_string_description);
zend_error(E_ERROR, "Failed evaluating code:\n%s\n", code);
/* zend_error() does not return in this case */
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index f4bf477b66..46f3708838 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -235,7 +235,7 @@ PHP_INI_END()
/* {{{ php_pgsql_init_globals
*/
-static void php_pgsql_init_globals(PGLS_D)
+static void php_pgsql_init_globals(PGLS_D TSRMLS_DC)
{
PGG(num_persistent) = 0;
PGG(ignore_notices) = 0;
@@ -248,9 +248,9 @@ static void php_pgsql_init_globals(PGLS_D)
PHP_MINIT_FUNCTION(pgsql)
{
#ifdef ZTS
- pgsql_globals_id = ts_allocate_id(sizeof(php_pgsql_globals), (ts_allocate_ctor) php_pgsql_init_globals, NULL);
+ ts_allocate_id(&pgsql_globals_id, sizeof(php_pgsql_globals), (ts_allocate_ctor) php_pgsql_init_globals, NULL);
#else
- php_pgsql_init_globals(PGLS_C);
+ php_pgsql_init_globals(PGLS_C TSRMLS_CC);
#endif
REGISTER_INI_ENTRIES();
@@ -295,7 +295,7 @@ PHP_RINIT_FUNCTION(pgsql)
*/
PHP_RSHUTDOWN_FUNCTION(pgsql)
{
- ELS_FETCH();
+ TSRMLS_FETCH();
zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions);
return SUCCESS;
}
diff --git a/ext/rpc/com/com_wrapper.c b/ext/rpc/com/com_wrapper.c
index b9b6d80590..360c689b77 100644
--- a/ext/rpc/com/com_wrapper.c
+++ b/ext/rpc/com/com_wrapper.c
@@ -1577,7 +1577,7 @@ static int php_COM_load_typelib(ITypeLib *TypeLib, int mode)
ITypeComp *TypeComp;
int i;
int interfaces;
- ELS_FETCH();
+ TSRMLS_FETCH();
if(NULL == TypeLib)
{
@@ -1646,7 +1646,7 @@ static int php_COM_load_typelib(ITypeLib *TypeLib, int mode)
/* Before registering the contsnt, let's see if we can find it */
{
- zend_register_constant(&c ELS_CC);
+ zend_register_constant(&c TSRMLS_CC);
}
j++;
}
diff --git a/ext/rpc/java/java.c b/ext/rpc/java/java.c
index e596c16fc3..7a65baa4bd 100644
--- a/ext/rpc/java/java.c
+++ b/ext/rpc/java/java.c
@@ -599,7 +599,7 @@ static void _php_java_destructor(zend_rsrc_list_entry *rsrc)
}
#ifdef ZTS
-static void alloc_java_globals_ctor(php_java_globals *java_globals) {
+static void alloc_java_globals_ctor(php_java_globals *java_globals TSRMLS_DC) {
memset(java_globals, 0, sizeof(php_java_globals));
}
#endif
@@ -624,7 +624,7 @@ PHP_MINIT_FUNCTION(java) {
}
#ifdef ZTS
- java_globals_id = ts_allocate_id(sizeof(php_java_globals),
+ ts_allocate_id(&java_globals_id, sizeof(php_java_globals),
(ts_allocate_ctor)alloc_java_globals_ctor, NULL);
#endif
diff --git a/ext/sablot/sablot.c b/ext/sablot/sablot.c
index ae9a37b86a..0a91262011 100644
--- a/ext/sablot/sablot.c
+++ b/ext/sablot/sablot.c
@@ -214,7 +214,7 @@ zend_module_entry sablot_module_entry = {
ZEND_GET_MODULE(sablot)
#endif
-static void php_sablot_init_globals(SABLOTLS_D)
+static void php_sablot_init_globals(SABLOTLS_D TSRMLS_DC)
{
SABLOTG(processor) = NULL;
SABLOTG(errors) = NULL;
@@ -227,9 +227,9 @@ static void php_sablot_init_globals(SABLOTLS_D)
PHP_MINIT_FUNCTION(sablot)
{
#ifdef ZTS
- sablot_globals_id = ts_allocate_id(sizeof(php_sablot_globals), (ts_allocate_ctor)php_sablot_init_globals, NULL);
+ ts_allocate_id(&sablot_globals_id, sizeof(php_sablot_globals), (ts_allocate_ctor)php_sablot_init_globals, NULL);
#else
- php_sablot_init_globals(SABLOTLS_C);
+ php_sablot_init_globals(SABLOTLS_C TSRMLS_CC);
#endif
le_sablot = zend_register_list_destructors_ex(_php_sablot_free_processor, NULL, "Sablotron XSLT", module_number);
@@ -1161,7 +1161,7 @@ static void _php_sablot_call_handler_function(zval *handlerName, int argc, zval
{
zval *retval;
int i;
- ELS_FETCH();
+ TSRMLS_FETCH();
MAKE_STD_ZVAL(retval);
if (call_user_function(EG(function_table), NULL, handlerName, retval, argc, args) == FAILURE) {
@@ -1427,7 +1427,7 @@ static MH_ERROR _php_sablot_error(void *userData, SablotHandle p, MH_ERROR code,
if (errorHandler) {
zval *retval;
- ELS_FETCH();
+ TSRMLS_FETCH();
MAKE_STD_ZVAL(retval);
@@ -1520,7 +1520,7 @@ static void _php_sablot_standard_error(php_sablot_error *errors, php_sablot_erro
static int _php_sablot_sh_getAll(void *userData, SablotHandle p, const char *scheme, const char *rest, char **buffer, int *byteCount)
{
php_sablot *handle = (php_sablot *) userData;
- ELS_FETCH();
+ TSRMLS_FETCH();
if (handle->getAllHandler) {
zval *retval,
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index be4e89d50e..0d8ebbc277 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -55,7 +55,7 @@ static zval *ps_call_handler(zval *func, int argc, zval **argv)
{
int i;
zval *retval = NULL;
- ELS_FETCH();
+ TSRMLS_FETCH();
MAKE_STD_ZVAL(retval);
if (call_user_function(EG(function_table), NULL, func, retval,
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 223b81e61f..92aea61cc9 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -164,7 +164,7 @@ void session_adapt_flush(int (*)(const char *, uint));
#endif
void php_set_session_var(char *name, size_t namelen, zval *state_val,HashTable *var_hash PSLS_DC);
-int php_get_session_var(char *name, size_t namelen, zval ***state_var PLS_DC PSLS_DC ELS_DC);
+int php_get_session_var(char *name, size_t namelen, zval ***state_var PLS_DC PSLS_DC TSRMLS_DC);
int php_session_register_module(ps_module *);
@@ -187,7 +187,7 @@ int php_session_register_serializer(const char *name,
ulong key_length; \
ulong num_key; \
zval **struc; \
- ELS_FETCH(); \
+ TSRMLS_FETCH(); \
PLS_FETCH()
#define PS_ENCODE_LOOP(code) \
@@ -195,7 +195,7 @@ int php_session_register_serializer(const char *name,
zend_hash_get_current_key_ex(&PS(vars), &key, &key_length, &num_key, 0, NULL) == HASH_KEY_IS_STRING; \
zend_hash_move_forward(&PS(vars))) { \
key_length--; \
- if (php_get_session_var(key, key_length, &struc PLS_CC PSLS_CC ELS_CC) == SUCCESS) { \
+ if (php_get_session_var(key, key_length, &struc PLS_CC PSLS_CC TSRMLS_CC) == SUCCESS) { \
code; \
} \
}
diff --git a/ext/session/session.c b/ext/session/session.c
index 831866df44..22ffbf3c60 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -234,7 +234,7 @@ typedef struct {
void php_set_session_var(char *name, size_t namelen, zval *state_val,HashTable *var_hash PSLS_DC)
{
PLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
if (PG(register_globals)) {
zval **old_symbol;
@@ -267,7 +267,7 @@ void php_set_session_var(char *name, size_t namelen, zval *state_val,HashTable *
}
}
-int php_get_session_var(char *name, size_t namelen, zval ***state_var PLS_DC PSLS_DC ELS_DC)
+int php_get_session_var(char *name, size_t namelen, zval ***state_var PLS_DC PSLS_DC TSRMLS_DC)
{
HashTable *ht = &EG(symbol_table);
@@ -448,7 +448,7 @@ static void php_session_track_init(void)
{
zval **old_vars = NULL;
PSLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
if (zend_hash_find(&EG(symbol_table), "HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), (void **)&old_vars) == SUCCESS && Z_TYPE_PP(old_vars) == IS_ARRAY) {
PS(http_session_vars) = *old_vars;
@@ -809,7 +809,7 @@ static void php_session_start(PSLS_D)
int module_number = PS(module_number);
int nrand;
int lensess;
- ELS_FETCH();
+ TSRMLS_FETCH();
if (PS(session_status) != php_session_none)
return;
@@ -1448,7 +1448,7 @@ PHP_MINIT_FUNCTION(session)
#ifdef ZTS
php_ps_globals *ps_globals;
- ps_globals_id = ts_allocate_id(sizeof(php_ps_globals), NULL, NULL);
+ ts_allocate_id(&ps_globals_id, sizeof(php_ps_globals), NULL, NULL);
ps_globals = ts_resource(ps_globals_id);
#endif
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 4dd3b1fe14..199075b70e 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -68,7 +68,7 @@ php_array_globals array_globals;
PHP_MINIT_FUNCTION(array)
{
#ifdef ZTS
- array_globals_id = ts_allocate_id(sizeof(php_array_globals), NULL, NULL);
+ ts_allocate_id(&array_globals_id, sizeof(php_array_globals), NULL, NULL);
#endif
REGISTER_LONG_CONSTANT("EXTR_OVERWRITE", EXTR_OVERWRITE, CONST_CS | CONST_PERSISTENT);
@@ -522,7 +522,7 @@ static int array_user_compare(const void *a, const void *b)
Bucket *s;
pval **args[2];
pval *retval_ptr;
- ELS_FETCH();
+ TSRMLS_FETCH();
BLS_FETCH();
f = *((Bucket **) a);
@@ -610,7 +610,7 @@ static int array_user_key_compare(const void *a, const void *b)
pval *args[2];
pval retval;
int status;
- ELS_FETCH();
+ TSRMLS_FETCH();
BLS_FETCH();
args[0] = &key1;
@@ -959,7 +959,7 @@ static int php_array_walk(HashTable *target_hash, zval **userdata)
ulong num_key;
HashPosition pos;
BLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
/* Allocate space for key */
MAKE_STD_ZVAL(key);
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index 8b1a9c3aa6..1fc1684011 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -86,7 +86,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateInt, quiet_eval, php_assert_globals, assert_globals)
PHP_INI_END()
-static void php_assert_init_globals(ASSERTLS_D)
+static void php_assert_init_globals(ASSERTLS_D TSRMLS_DC)
{
ASSERT(callback) = NULL;
}
@@ -95,9 +95,9 @@ PHP_MINIT_FUNCTION(assert)
{
#ifdef ZTS
- assert_globals_id = ts_allocate_id(sizeof(php_assert_globals), (ts_allocate_ctor) php_assert_init_globals, NULL);
+ ts_allocate_id(&assert_globals_id, sizeof(php_assert_globals), (ts_allocate_ctor) php_assert_init_globals, NULL);
#else
- php_assert_init_globals(ASSERTLS_C);
+ php_assert_init_globals(ASSERTLS_C TSRMLS_CC);
#endif
REGISTER_INI_ENTRIES();
@@ -173,7 +173,7 @@ PHP_FUNCTION(assert)
}
compiled_string_description = zend_make_compiled_string_description("assert code");
- if (zend_eval_string(myeval, &retval, compiled_string_description CLS_CC ELS_CC) == FAILURE) {
+ if (zend_eval_string(myeval, &retval, compiled_string_description CLS_CC TSRMLS_CC) == FAILURE) {
efree(compiled_string_description);
zend_error(E_ERROR, "Failure evaluating code:\n%s\n", myeval);
/* zend_error() does not return in this case. */
@@ -199,8 +199,8 @@ PHP_FUNCTION(assert)
zval *args[4];
zval *retval;
int i;
- uint lineno = zend_get_executed_lineno(ELS_C);
- char *filename = zend_get_executed_filename(ELS_C);
+ uint lineno = zend_get_executed_lineno(TSRMLS_C);
+ char *filename = zend_get_executed_filename(TSRMLS_C);
MAKE_STD_ZVAL(args[0]);
MAKE_STD_ZVAL(args[1]);
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 80467d8fcd..da7588ecdb 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -691,7 +691,7 @@ static void php_putenv_destructor(putenv_entry *pe)
void test_class_startup(void);
-static void basic_globals_ctor(BLS_D)
+static void basic_globals_ctor(BLS_D TSRMLS_DC)
{
BG(next) = NULL;
BG(left) = -1;
@@ -709,7 +709,7 @@ static void basic_globals_ctor(BLS_D)
#endif
}
-static void basic_globals_dtor(BLS_D)
+static void basic_globals_dtor(BLS_D TSRMLS_DC)
{
zend_hash_destroy(&BG(sm_protected_env_vars));
if (BG(sm_allowed_env_vars)) {
@@ -726,9 +726,9 @@ PHP_MINIT_FUNCTION(basic)
PLS_FETCH();
#ifdef ZTS
- basic_globals_id = ts_allocate_id(sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
+ ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
#else
- basic_globals_ctor(BLS_C);
+ basic_globals_ctor(BLS_C TSRMLS_CC);
#endif
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
@@ -804,8 +804,9 @@ PHP_MSHUTDOWN_FUNCTION(basic)
{
PLS_FETCH();
BLS_FETCH();
+ TSRMLS_FETCH();
- basic_globals_dtor(BLS_C);
+ basic_globals_dtor(BLS_C TSRMLS_CC);
#ifdef ZTS
ts_free_id(basic_globals_id);
@@ -1824,7 +1825,7 @@ void user_tick_function_dtor(user_tick_function_entry *tick_function_entry)
static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_function_entry)
{
zval retval;
- ELS_FETCH();
+ TSRMLS_FETCH();
if (call_user_function(EG(function_table), NULL, shutdown_function_entry->arguments[0], &retval, shutdown_function_entry->arg_count-1, shutdown_function_entry->arguments+1)==SUCCESS) {
zval_dtor(&retval);
@@ -1839,7 +1840,7 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe)
{
zval retval;
zval *function = tick_fe->arguments[0];
- ELS_FETCH();
+ TSRMLS_FETCH();
if (call_user_function(EG(function_table), NULL, function, &retval,
tick_fe->arg_count - 1, tick_fe->arguments + 1) == SUCCESS) {
@@ -1888,7 +1889,7 @@ static int user_tick_function_compare(user_tick_function_entry *tick_fe1,
void php_call_shutdown_functions(void)
{
BLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
if (BG(user_shutdown_function_names)) zend_try {
zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t)user_shutdown_function_call);
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 927bf958d7..b64893b8d1 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -137,7 +137,7 @@ PHP_MINIT_FUNCTION(dir)
dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry);
#ifdef ZTS
- dir_globals_id = ts_allocate_id(sizeof(php_dir_globals), NULL, NULL);
+ ts_allocate_id(&dir_globals_id, sizeof(php_dir_globals), NULL, NULL);
#endif
tmpstr[0] = DEFAULT_SLASH;
tmpstr[1] = '\0';
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index 439fb889c7..e911f74a80 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -102,7 +102,7 @@ void php_dl(pval *file, int type, pval *return_value)
int error_type;
char *extension_dir;
PLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
if (type==MODULE_PERSISTENT) {
@@ -177,7 +177,7 @@ void php_dl(pval *file, int type, pval *return_value)
module_entry->type = type;
module_entry->module_number = zend_next_free_module();
if (module_entry->module_startup_func) {
- if (module_entry->module_startup_func(type, module_entry->module_number ELS_CC)==FAILURE) {
+ if (module_entry->module_startup_func(type, module_entry->module_number TSRMLS_CC)==FAILURE) {
php_error(error_type, "%s: Unable to initialize module", module_entry->name);
DL_UNLOAD(handle);
RETURN_FALSE;
@@ -186,7 +186,7 @@ void php_dl(pval *file, int type, pval *return_value)
zend_register_module(module_entry);
if ((type == MODULE_TEMPORARY) && module_entry->request_startup_func) {
- if (module_entry->request_startup_func(type, module_entry->module_number ELS_CC)) {
+ if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC)) {
php_error(error_type, "%s: Unable to initialize module", module_entry->name);
DL_UNLOAD(handle);
RETURN_FALSE;
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 3261e06425..4fa6eccf92 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -168,7 +168,7 @@ PHPAPI int php_file_le_socket(void) /* XXX doe we really want this???? */
}
-static void file_globals_ctor(FLS_D)
+static void file_globals_ctor(FLS_D TSRMLS_DC)
{
zend_hash_init(&FG(ht_fsock_keys), 0, NULL, NULL, 1);
zend_hash_init(&FG(ht_fsock_socks), 0, NULL, (void (*)(void *))php_msock_destroy, 1);
@@ -179,7 +179,7 @@ static void file_globals_ctor(FLS_D)
}
-static void file_globals_dtor(FLS_D)
+static void file_globals_dtor(FLS_D TSRMLS_DC)
{
zend_hash_destroy(&FG(ht_fsock_socks));
zend_hash_destroy(&FG(ht_fsock_keys));
@@ -198,9 +198,9 @@ PHP_MINIT_FUNCTION(file)
#endif
#ifdef ZTS
- file_globals_id = ts_allocate_id(sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);
+ ts_allocate_id(&file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);
#else
- file_globals_ctor(FLS_C);
+ file_globals_ctor(FLS_C TSRMLS_CC);
#endif
REGISTER_LONG_CONSTANT("SEEK_SET", SEEK_SET, CONST_CS | CONST_PERSISTENT);
@@ -220,8 +220,9 @@ PHP_MSHUTDOWN_FUNCTION(file)
{
#ifndef ZTS
FLS_FETCH();
+ TSRMLS_FETCH();
- file_globals_dtor(FLS_C);
+ file_globals_dtor(FLS_C TSRMLS_CC);
#endif
return SUCCESS;
}
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 41fadce931..9c09c78dcd 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -274,7 +274,7 @@ FILE *php_fopen_url_wrap_http(char *path, char *mode, int options, int *issock,
php_url_free(resource);
if (location[0] != '\0') {
zval **response_header_new, *entry, **entryp;
- ELS_FETCH();
+ TSRMLS_FETCH();
fp = php_fopen_url_wrap_http(location, mode, options, issock, socketd, opened_path);
if (zend_hash_find(EG(active_symbol_table), "http_response_header", sizeof("http_response_header"), (void **) &response_header_new) == SUCCESS) {
@@ -299,7 +299,7 @@ FILE *php_fopen_url_wrap_http(char *path, char *mode, int options, int *issock,
*issock = 1;
out:
{
- ELS_FETCH();
+ TSRMLS_FETCH();
ZEND_SET_SYMBOL(EG(active_symbol_table), "http_response_header", response_header);
}
return (fp);
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 8f911d2f68..dec141f331 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -58,7 +58,7 @@ static int _display_module_info(zend_module_entry *module, void *arg)
/* {{{ php_print_gpcse_array
*/
-static void php_print_gpcse_array(char *name, uint name_length ELS_DC)
+static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
{
zval **data, **tmp, tmp2;
char *string_key;
@@ -152,7 +152,7 @@ PHPAPI void php_print_info(int flag)
int expose_php = INI_INT("expose_php");
time_t the_time;
struct tm *ta, tmbuf;
- ELS_FETCH();
+ TSRMLS_FETCH();
SLS_FETCH();
the_time = time(NULL);
@@ -244,7 +244,7 @@ PHPAPI void php_print_info(int flag)
PUTS("</a></h1>\n");
}
- zend_ini_sort_entries(ELS_C);
+ zend_ini_sort_entries(TSRMLS_C);
if (flag & PHP_INFO_CONFIGURATION) {
php_info_print_hr();
@@ -303,12 +303,12 @@ PHPAPI void php_print_info(int flag)
if (zend_hash_find(&EG(symbol_table), "PHP_AUTH_PW", sizeof("PHP_AUTH_PW"), (void **) &data) != FAILURE) {
php_info_print_table_row(2, "PHP_AUTH_PW", (*data)->value.str.val);
}
- php_print_gpcse_array("HTTP_GET_VARS", sizeof("HTTP_GET_VARS")-1 ELS_CC);
- php_print_gpcse_array("HTTP_POST_VARS", sizeof("HTTP_POST_VARS")-1 ELS_CC);
- php_print_gpcse_array("HTTP_POST_FILES", sizeof("HTTP_POST_FILES")-1 ELS_CC);
- php_print_gpcse_array("HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS")-1 ELS_CC);
- php_print_gpcse_array("HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS")-1 ELS_CC);
- php_print_gpcse_array("HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS")-1 ELS_CC);
+ php_print_gpcse_array("HTTP_GET_VARS", sizeof("HTTP_GET_VARS")-1 TSRMLS_CC);
+ php_print_gpcse_array("HTTP_POST_VARS", sizeof("HTTP_POST_VARS")-1 TSRMLS_CC);
+ php_print_gpcse_array("HTTP_POST_FILES", sizeof("HTTP_POST_FILES")-1 TSRMLS_CC);
+ php_print_gpcse_array("HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS")-1 TSRMLS_CC);
+ php_print_gpcse_array("HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS")-1 TSRMLS_CC);
+ php_print_gpcse_array("HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS")-1 TSRMLS_CC);
php_info_print_table_end();
}
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c
index 51447252ba..6f97a0397a 100644
--- a/ext/standard/lcg.c
+++ b/ext/standard/lcg.c
@@ -63,7 +63,7 @@ double php_combined_lcg(void)
return z * 4.656613e-10;
}
-static void lcg_init_globals(LCGLS_D)
+static void lcg_init_globals(LCGLS_D TSRMLS_DC)
{
LCG(s1) = 1;
#ifdef ZTS
@@ -76,7 +76,7 @@ static void lcg_init_globals(LCGLS_D)
#ifdef ZTS
PHP_MINIT_FUNCTION(lcg)
{
- lcg_globals_id = ts_allocate_id(sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL);
+ ts_allocate_id(&lcg_globals_id, sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL);
return SUCCESS;
}
#else
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index bcd0111b8a..c962f2b8c4 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -84,7 +84,7 @@ static void _free_reg_cache(reg_cache *rc)
#undef regcomp
#define regcomp(a,b,c) _php_regcomp(a,b,c)
-static void php_reg_init_globals(php_reg_globals *reg_globals)
+static void php_reg_init_globals(php_reg_globals *reg_globals TSRMLS_DC)
{
zend_hash_init(&reg_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1);
}
@@ -92,9 +92,9 @@ static void php_reg_init_globals(php_reg_globals *reg_globals)
PHP_MINIT_FUNCTION(regex)
{
#ifdef ZTS
- reg_globals_id = ts_allocate_id(sizeof(php_reg_globals), (ts_allocate_ctor) php_reg_init_globals, NULL);
+ ts_allocate_id(&reg_globals_id, sizeof(php_reg_globals), (ts_allocate_ctor) php_reg_init_globals, NULL);
#else
- php_reg_init_globals(&reg_globals);
+ php_reg_init_globals(&reg_globals TSRMLS_CC);
#endif
return SUCCESS;
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 04599f0ee7..3f82017d63 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2994,14 +2994,14 @@ PHP_FUNCTION(parse_str)
old_rg = PG(register_globals);
if(argCount == 1) {
PG(register_globals) = 1;
- php_treat_data(PARSE_STRING, res, NULL ELS_CC PLS_CC SLS_CC);
+ php_treat_data(PARSE_STRING, res, NULL TSRMLS_CC PLS_CC SLS_CC);
} else {
PG(register_globals) = 0;
/* Clear out the array that was passed in. */
zval_dtor(*arrayArg);
array_init(*arrayArg);
- php_treat_data(PARSE_STRING, res, *arrayArg ELS_CC PLS_CC SLS_CC);
+ php_treat_data(PARSE_STRING, res, *arrayArg TSRMLS_CC PLS_CC SLS_CC);
}
PG(register_globals) = old_rg;
}
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index 236c54cf88..f6330facd3 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -130,7 +130,7 @@ PHP_RSHUTDOWN_FUNCTION(syslog)
*/
static void start_syslog(BLS_D)
{
- ELS_FETCH();
+ TSRMLS_FETCH();
/* error levels */
SET_VAR_LONG("LOG_EMERG", LOG_EMERG); /* system unusable */
diff --git a/ext/standard/var.c b/ext/standard/var.c
index a652d68e6e..48ddba407b 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -72,7 +72,7 @@ void php_var_dump(zval **struc, int level)
php_printf("%sint(%ld)\n", COMMON, Z_LVAL_PP(struc));
break;
case IS_DOUBLE: {
- ELS_FETCH();
+ TSRMLS_FETCH();
php_printf("%sfloat(%.*G)\n", COMMON, (int) EG(precision), Z_DVAL_PP(struc));
}
@@ -208,7 +208,7 @@ PHPAPI void php_var_serialize(zval *buf, zval **struc, HashTable *var_hash)
return;
case IS_DOUBLE: {
- ELS_FETCH();
+ TSRMLS_FETCH();
slen = sprintf(s, "d:%.*G;",(int) EG(precision), Z_DVAL_PP(struc));
STR_CAT(buf, s, slen);
}
@@ -366,7 +366,7 @@ PHPAPI int php_var_unserialize(zval **rval, const char **p, const char *max, Has
HashTable *myht;
zval **rval_ref;
- ELS_FETCH();
+ TSRMLS_FETCH();
BLS_FETCH();
if (var_hash && **p != 'R') { /* references aren't counted by serializer! */
diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c
index 9ed3cef5f8..c90ea4d01a 100644
--- a/ext/sybase/php_sybase_db.c
+++ b/ext/sybase/php_sybase_db.c
@@ -167,7 +167,7 @@ static void _free_sybase_result(zend_rsrc_list_entry *rsrc)
static void _close_sybase_link(zend_rsrc_list_entry *rsrc)
{
sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr;
- ELS_FETCH();
+ TSRMLS_FETCH();
sybase_ptr->valid = 0;
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index c09720a900..31972985f4 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -145,7 +145,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc)
{
sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr;
CS_INT con_status;
- ELS_FETCH();
+ TSRMLS_FETCH();
SybCtLS_FETCH();
sybase_ptr->valid = 0;
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index f1f9c27aa8..2149708fa8 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -641,7 +641,7 @@ static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
{
zval **val;
HashTable *target_hash;
- ELS_FETCH();
+ TSRMLS_FETCH();
if (Z_TYPE_P(name_var) == IS_STRING)
{
@@ -783,7 +783,7 @@ static void php_wddx_pop_element(void *user_data, const char *name)
zend_class_entry *ce;
zval *obj;
zval *tmp;
- ELS_FETCH();
+ TSRMLS_FETCH();
if (stack->top == 0)
return;
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 02651950c5..365ada931a 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -160,7 +160,7 @@ static int le_xml_parser;
#ifdef ZTS
-static void php_xml_init_globals(php_xml_globals *xml_globals)
+static void php_xml_init_globals(php_xml_globals *xml_globals TSRMLS_DC)
{
XML(default_encoding) = "ISO-8859-1";
}
@@ -171,7 +171,7 @@ PHP_MINIT_FUNCTION(xml)
le_xml_parser = zend_register_list_destructors_ex(xml_parser_dtor, NULL, "xml", module_number);
#ifdef ZTS
- xml_globals_id = ts_allocate_id(sizeof(php_xml_globals), (ts_allocate_ctor) php_xml_init_globals, NULL);
+ ts_allocate_id(&xml_globals_id, sizeof(php_xml_globals), (ts_allocate_ctor) php_xml_init_globals, NULL);
#else
XML(default_encoding) = "ISO-8859-1";
#endif
@@ -367,7 +367,7 @@ xml_set_handler(zval **handler, zval **data)
static zval *
xml_call_handler(xml_parser *parser, zval *handler, int argc, zval **argv)
{
- ELS_FETCH();
+ TSRMLS_FETCH();
if (parser && handler) {
zval *retval;
diff --git a/ext/xslt/xslt.c b/ext/xslt/xslt.c
index dc969b5f12..2ec424ce4e 100644
--- a/ext/xslt/xslt.c
+++ b/ext/xslt/xslt.c
@@ -216,7 +216,7 @@ extern void xslt_call_function(char *name,
zval ***argv; /* Argument container, maps around for call_user_function_ex() */
int error; /* Error container */
int idx; /* Idx, when looping through and free'ing the arguments */
- ELS_FETCH(); /* For TS mode, fetch the executor globals */
+ TSRMLS_FETCH(); /* For TS mode, fetch the executor globals */
/* Allocate and initialize return value from the function */
MAKE_STD_ZVAL(*retval);
diff --git a/ext/yp/yp.c b/ext/yp/yp.c
index 672fe100de..264f382544 100644
--- a/ext/yp/yp.c
+++ b/ext/yp/yp.c
@@ -366,7 +366,7 @@ PHP_FUNCTION(yp_err_string) {
PHP_MINIT_FUNCTION(yp)
{
#ifdef ZTS
- yp_globals_id = ts_allocate_id(sizeof(php_yp_globals), NULL, NULL);
+ ts_allocate_id(&yp_globals_id, sizeof(php_yp_globals), NULL, NULL);
#endif
REGISTER_LONG_CONSTANT("YPERR_BADARGS", YPERR_BADARGS, CONST_CS | CONST_PERSISTENT);
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 5d36cec76f..f31d2eb91b 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -147,7 +147,7 @@ static void phpi_destructor_gzclose(zend_rsrc_list_entry *rsrc)
#ifdef ZTS
/* {{{ php_zlib_init_globals
*/
-static void php_zlib_init_globals(ZLIBLS_D)
+static void php_zlib_init_globals(ZLIBLS_D TSRMLS_DC)
{
ZLIBG(gzgetss_state) = 0;
}
@@ -161,9 +161,9 @@ PHP_MINIT_FUNCTION(zlib)
PLS_FETCH();
#ifdef ZTS
- zlib_globals_id = ts_allocate_id(sizeof(php_zlib_globals), (ts_allocate_ctor) php_zlib_init_globals, NULL);
+ ts_allocate_id(&zlib_globals_id, sizeof(php_zlib_globals), (ts_allocate_ctor) php_zlib_init_globals, NULL);
#else
- ZLIBG(gzgetss_state)=0;
+ ZLIBG(gzgetss_state)=0;
#endif
le_zp = zend_register_list_destructors_ex(phpi_destructor_gzclose, NULL, "zlib", module_number);
@@ -1257,7 +1257,7 @@ static void php_gzip_output_handler(char *output, uint output_len, char **handle
int php_enable_output_compression(int buffer_size)
{
zval **a_encoding, **data;
- ELS_FETCH();
+ TSRMLS_FETCH();
ZLIBLS_FETCH();
if (zend_hash_find(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), (void **) &data)==FAILURE
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);
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c
index 81dbda5346..55b74b0233 100644
--- a/sapi/aolserver/aolserver.c
+++ b/sapi/aolserver/aolserver.c
@@ -305,13 +305,13 @@ php_ns_startup(sapi_module_struct *sapi_module)
*/
#define ADD_STRINGX(name,buf) \
- php_register_variable(name, buf, track_vars_array ELS_CC PLS_CC)
+ php_register_variable(name, buf, track_vars_array TSRMLS_CC PLS_CC)
#define ADD_STRING(name) \
ADD_STRINGX(name, buf)
static void
-php_ns_sapi_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+php_ns_sapi_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
int i;
char buf[NS_BUF_SIZE + 1];
@@ -418,7 +418,7 @@ php_ns_module_main(NSLS_D SLS_DC)
{
zend_file_handle file_handle;
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
file_handle.type = ZEND_HANDLE_FILENAME;
@@ -427,11 +427,11 @@ php_ns_module_main(NSLS_D SLS_DC)
file_handle.opened_path = NULL;
php_ns_config(global_context, 0);
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC) == FAILURE) {
return NS_ERROR;
}
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_request_shutdown(NULL);
return NS_OK;
@@ -617,7 +617,7 @@ int Ns_ModuleInit(char *server, char *module)
sapi_module.startup(&aolserver_sapi_module);
/* TSRM is used to allocate a per-thread structure */
- ns_globals_id = ts_allocate_id(sizeof(ns_globals_struct), NULL, NULL);
+ ts_allocate_id(&ns_globals_id, sizeof(ns_globals_struct), NULL, NULL);
/* the context contains data valid for all threads */
ctx = malloc(sizeof *ctx);
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index fc9782016e..0a17b61721 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -64,7 +64,7 @@
/* {{{ Prototypes
*/
-int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC PLS_DC SLS_DC);
+int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC TSRMLS_DC PLS_DC SLS_DC);
void php_save_umask(void);
void php_restore_umask(void);
int sapi_apache_read_post(char *buffer, uint count_bytes SLS_DC);
@@ -235,7 +235,7 @@ int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC)
/* {{{ sapi_apache_register_server_variables
*/
-static void sapi_apache_register_server_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
register int i;
array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env);
@@ -251,7 +251,7 @@ static void sapi_apache_register_server_variables(zval *track_vars_array ELS_DC
} else {
val = empty_string;
}
- php_register_variable(elts[i].key, val, track_vars_array ELS_CC PLS_CC);
+ php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC PLS_CC);
}
/* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
@@ -266,10 +266,10 @@ static void sapi_apache_register_server_variables(zval *track_vars_array ELS_DC
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 ELS_CC PLS_CC);
+ php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC PLS_CC);
}
- php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC PLS_CC);
}
/* }}} */
@@ -493,7 +493,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
int retval;
HashTable *per_dir_conf;
SLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
CLS_FETCH();
PLS_FETCH();
APLS_FETCH();
@@ -505,7 +505,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
fh.opened_path = NULL;
fh.free_filename = 0;
fh.type = ZEND_HANDLE_FILENAME;
- zend_execute_scripts(ZEND_INCLUDE CLS_CC ELS_CC, 1, &fh);
+ zend_execute_scripts(ZEND_INCLUDE CLS_CC TSRMLS_CC, 1, &fh);
return OK;
}
@@ -533,7 +533,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
r->content_type = php_apache_get_default_mimetype(r SLS_CC);
r->allowed |= (1 << METHODS) - 1;
zend_try {
- zend_ini_deactivate(ELS_C);
+ zend_ini_deactivate(TSRMLS_C);
} zend_end_try();
return DECLINED;
}
@@ -545,7 +545,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(ELS_C);
+ zend_ini_deactivate(TSRMLS_C);
} zend_end_try();
return retval;
}
@@ -555,7 +555,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(ELS_C);
+ zend_ini_deactivate(TSRMLS_C);
} zend_end_try();
return retval;
}
@@ -579,7 +579,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
add_cgi_vars(r);
init_request_info(SLS_C);
- apache_php_module_main(r, display_source_mode CLS_CC ELS_CC PLS_CC SLS_CC);
+ apache_php_module_main(r, display_source_mode CLS_CC TSRMLS_CC PLS_CC SLS_CC);
/* Done, restore umask, turn off timeout, close file and return */
php_restore_umask();
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index c969371526..fd0270414a 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -90,7 +90,7 @@ PHP_INI_END()
-static void php_apache_globals_ctor(php_apache_info_struct *apache_globals)
+static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC)
{
apache_globals->in_request = 0;
}
@@ -99,9 +99,9 @@ static void php_apache_globals_ctor(php_apache_info_struct *apache_globals)
static PHP_MINIT_FUNCTION(apache)
{
#ifdef ZTS
- php_apache_info_id = ts_allocate_id(sizeof(php_apache_info_struct), php_apache_globals_ctor, NULL);
+ ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), php_apache_globals_ctor, NULL);
#else
- php_apache_globals_ctor(&php_apache_info);
+ php_apache_globals_ctor(&php_apache_info TSRMLS_CC);
#endif
REGISTER_INI_ENTRIES();
return SUCCESS;
diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c
index 35d707d024..1ad8807f9d 100644
--- a/sapi/apache/sapi_apache.c
+++ b/sapi/apache/sapi_apache.c
@@ -60,12 +60,12 @@
/* {{{ apache_php_module_main
*/
-int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC PLS_DC SLS_DC)
+int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC TSRMLS_DC PLS_DC SLS_DC)
{
zend_file_handle file_handle;
APLS_FETCH();
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC) == FAILURE) {
return FAILURE;
}
/* sending a file handle to another dll is not working
@@ -88,7 +88,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
- (void) php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ (void) php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
}
AP(in_request) = 0;
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index eede7c88d7..03a2ed90b9 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -143,7 +143,7 @@ php_apache_sapi_read_cookies(SLS_D)
}
static void
-php_apache_sapi_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
php_struct *ctx = SG(server_context);
apr_array_header_t *arr = apr_table_elts(ctx->f->r->subprocess_env);
@@ -151,10 +151,10 @@ php_apache_sapi_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
APR_ARRAY_FOREACH_OPEN(arr, key, val)
if (!val) val = empty_string;
- php_register_variable(key, val, track_vars_array ELS_CC PLS_CC);
+ php_register_variable(key, val, track_vars_array TSRMLS_CC PLS_CC);
APR_ARRAY_FOREACH_CLOSE()
- php_register_variable("PHP_SELF", ctx->f->r->uri, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", ctx->f->r->uri, track_vars_array TSRMLS_CC PLS_CC);
}
static void
@@ -266,7 +266,7 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx SLS_DC)
char *content_type;
const char *auth;
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
PG(during_request_startup) = 0;
@@ -291,7 +291,7 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx SLS_DC)
auth = apr_table_get(f->r->headers_in, "Authorization");
php_handle_auth_data(auth SLS_CC);
- php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC);
+ php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC);
}
static void php_apache_request_dtor(ap_filter_t *f SLS_DC)
@@ -340,7 +340,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
zend_file_handle zfd;
apr_bucket *eos;
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
/* We want to execute only one script per request.
@@ -365,7 +365,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
zfd.free_filename = 0;
zfd.opened_path = NULL;
- php_execute_script(&zfd CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&zfd CLS_CC TSRMLS_CC PLS_CC);
} else {
#define NO_DATA "The PHP Filter did not receive suitable input data"
diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c
index 44e296b51c..4c1cc60f38 100644
--- a/sapi/caudium/caudium.c
+++ b/sapi/caudium/caudium.c
@@ -474,55 +474,55 @@ static zend_module_entry php_caudium_module = {
};
-INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+INLINE static void low_sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
char *tmp;
php_register_variable("PHP_SELF", SG(request_info).request_uri,
- track_vars_array ELS_CC PLS_CC);
+ track_vars_array TSRMLS_CC PLS_CC);
php_register_variable("GATEWAY_INTERFACE", "CGI/1.1",
- track_vars_array ELS_CC PLS_CC);
+ track_vars_array TSRMLS_CC PLS_CC);
php_register_variable("REQUEST_METHOD",
(char *) SG(request_info).request_method,
- track_vars_array ELS_CC PLS_CC);
+ track_vars_array TSRMLS_CC PLS_CC);
php_register_variable("REQUEST_URI", SG(request_info).request_uri,
- track_vars_array ELS_CC PLS_CC);
+ track_vars_array TSRMLS_CC PLS_CC);
php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated,
- track_vars_array ELS_CC PLS_CC);
+ track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("SERVER_NAME", NULL)) != NULL)
- php_register_variable("SERVER_NAME", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("SERVER_NAME", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("SERVER_PORT", NULL)) != NULL)
- php_register_variable("SERVER_PORT", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("SERVER_PORT", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("SERVER_PROTOCOL", NULL)) != NULL)
- php_register_variable("SERVER_PROTOCOL", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("SERVER_PROTOCOL", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("SCRIPT_NAME", NULL)) != NULL)
- php_register_variable("SCRIPT_NAME", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("SCRIPT_NAME", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("SCRIPT_FILENAME", NULL)) != NULL)
- php_register_variable("SCRIPT_FILENAME", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("SCRIPT_FILENAME", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("REMOTE_ADDR", NULL)) != NULL)
- php_register_variable("REMOTE_ADDR", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("REMOTE_ADDR", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("REMOTE_PORT", NULL)) != NULL)
- php_register_variable("REMOTE_PORT", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("REMOTE_PORT", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("DOCUMENT_ROOT", NULL)) != NULL)
- php_register_variable("DOCUMENT_ROOT", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("DOCUMENT_ROOT", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("HTTP_CONNECTION", NULL)) != NULL)
- php_register_variable("HTTP_CONNECTION", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("HTTP_CONNECTION", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("HTTP_USER_AGENT", NULL)) != NULL)
- php_register_variable("HTTP_USER_AGENT", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("HTTP_USER_AGENT", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("DOCUMENT_ROOT", NULL)) != NULL)
- php_register_variable("DOCUMENT_ROOT", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("DOCUMENT_ROOT", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("QUERY_STRING", "")) != NULL)
- php_register_variable("QUERY_STRING", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("QUERY_STRING", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("REMOTE_USER", NULL)) != NULL)
- php_register_variable("REMOTE_USER", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("REMOTE_USER", tmp, track_vars_array TSRMLS_CC PLS_CC);
if( (tmp = lookup_string_header("REMOTE_PASSWORD", NULL)) != NULL)
- php_register_variable("REMOTE_PASSWORD", tmp, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("REMOTE_PASSWORD", tmp, track_vars_array TSRMLS_CC PLS_CC);
}
-static void sapi_caudium_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+static void sapi_caudium_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
- THREAD_SAFE_RUN(low_sapi_caudium_register_variables(track_vars_array ELS_CC SLS_CC PLS_CC), "register_variables");
+ THREAD_SAFE_RUN(low_sapi_caudium_register_variables(track_vars_array TSRMLS_CC SLS_CC PLS_CC), "register_variables");
}
/* this structure is static (as in "it does not change") */
@@ -556,7 +556,7 @@ static sapi_module_struct caudium_sapi_module = {
* with a number of variables. HTTP_* variables are created for
* the HTTP header data, so that a script can access these.
*/
-static void php_caudium_hash_environment(CLS_D ELS_DC PLS_DC SLS_DC)
+static void php_caudium_hash_environment(CLS_D TSRMLS_DC PLS_DC SLS_DC)
{
int i;
char buf[512];
@@ -615,7 +615,7 @@ static void php_caudium_module_main(php_caudium_request *ureq)
SLS_FETCH();
CLS_FETCH();
PLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
GET_THIS();
THIS->filename = ureq->filename;
THIS->done_cb = ureq->done_cb;
@@ -700,7 +700,7 @@ static void php_caudium_module_main(php_caudium_request *ureq)
file_handle.free_filename = 0;
THIS->written = 0;
- res = php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC);
+ res = php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC);
if(res == FAILURE) {
THREAD_SAFE_RUN({
@@ -709,9 +709,9 @@ static void php_caudium_module_main(php_caudium_request *ureq)
free_struct(SLS_C);
}, "Negative run response");
} else {
- THREAD_SAFE_RUN(php_caudium_hash_environment(CLS_C ELS_CC PLS_CC SLS_CC),
+ THREAD_SAFE_RUN(php_caudium_hash_environment(CLS_C TSRMLS_CC PLS_CC SLS_CC),
"environment hashing");
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_request_shutdown(NULL);
THREAD_SAFE_RUN({
push_int(THIS->written);
@@ -817,7 +817,7 @@ void pike_module_init( void )
if (!caudium_php_initialized) {
caudium_php_initialized = 1;
tsrm_startup(1, 1, 0, NULL);
- caudium_globals_id = ts_allocate_id(sizeof(php_caudium_request), NULL, NULL);
+ ts_allocate_id(&caudium_globals_id, sizeof(php_caudium_request), NULL, NULL);
sapi_startup(&caudium_sapi_module);
sapi_module.startup(&caudium_sapi_module);
zend_startup_module(&php_caudium_module);
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 002d6c89c4..26378b7639 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -166,15 +166,15 @@ static char *sapi_cgi_read_cookies(SLS_D)
}
-static void sapi_cgi_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
/* In CGI mode, we consider the environment to be a part of the server
* variables
*/
- php_import_environment_variables(track_vars_array ELS_CC PLS_CC);
+ php_import_environment_variables(track_vars_array TSRMLS_CC PLS_CC);
/* Build the special-case PHP_SELF variable for the CGI version */
- php_register_variable("PHP_SELF", (SG(request_info).request_uri ? SG(request_info).request_uri:""), track_vars_array ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", (SG(request_info).request_uri ? SG(request_info).request_uri:""), track_vars_array TSRMLS_CC PLS_CC);
}
@@ -347,7 +347,7 @@ static void define_command_line_ini_entry(char *arg)
static void php_register_command_line_global_vars(char **arg)
{
char *var, *val;
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
var = *arg;
@@ -356,7 +356,7 @@ static void php_register_command_line_global_vars(char **arg)
printf("No value specified for variable '%s'\n", var);
} else {
*val++ = '\0';
- php_register_variable(var, val, NULL ELS_CC PLS_CC);
+ php_register_variable(var, val, NULL TSRMLS_CC PLS_CC);
}
efree(*arg);
}
@@ -385,6 +385,7 @@ int main(int argc, char *argv[])
zend_executor_globals *executor_globals;
php_core_globals *core_globals;
sapi_globals_struct *sapi_globals;
+ void ***tsrm_ls;
#endif
@@ -483,6 +484,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
executor_globals = ts_resource(executor_globals_id);
core_globals = ts_resource(core_globals_id);
sapi_globals = ts_resource(sapi_globals_id);
+ tsrm_ls = ts_resource(0);
#endif
zend_try {
@@ -561,7 +563,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
break;
case 'i': /* php info & quit */
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC)==FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC)==FAILURE) {
php_module_shutdown();
return FAILURE;
}
@@ -608,7 +610,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
case 'v': /* show php version & quit */
no_headers = 1;
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC)==FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC)==FAILURE) {
php_module_shutdown();
return FAILURE;
}
@@ -665,7 +667,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
SG(request_info).path_translated = script_file;
}
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC)==FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC)==FAILURE) {
php_module_shutdown();
return FAILURE;
}
@@ -732,11 +734,11 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
switch (behavior) {
case PHP_MODE_STANDARD:
- exit_status = php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ exit_status = php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
break;
case PHP_MODE_LINT:
PG(during_request_startup) = 0;
- exit_status = php_lint_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ exit_status = php_lint_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
if (exit_status==SUCCESS) {
zend_printf("No syntax errors detected in %s\n", file_handle.filename);
} else {
diff --git a/sapi/fastcgi/fastcgi.c b/sapi/fastcgi/fastcgi.c
index e9ee629fc7..344c343c88 100644
--- a/sapi/fastcgi/fastcgi.c
+++ b/sapi/fastcgi/fastcgi.c
@@ -147,7 +147,7 @@ static char *sapi_fastcgi_read_cookies(SLS_D)
}
-static void sapi_fastcgi_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+static void sapi_fastcgi_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
char *self = getenv("REQUEST_URI");
char *ptr = strchr( self, '?' );
@@ -162,7 +162,7 @@ static void sapi_fastcgi_register_variables(zval *track_vars_array ELS_DC SLS_DC
/* strip query string off this */
if ( ptr ) *ptr = 0;
- php_register_variable( "PHP_SELF", getenv("REQUEST_URI"), track_vars_array ELS_CC PLS_CC);
+ php_register_variable( "PHP_SELF", getenv("REQUEST_URI"), track_vars_array TSRMLS_CC PLS_CC);
if ( ptr ) *ptr = '?';
}
@@ -203,7 +203,7 @@ static void fastcgi_module_main(TLS_D SLS_DC)
{
zend_file_handle file_handle;
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
file_handle.type = ZEND_HANDLE_FILENAME;
@@ -211,8 +211,8 @@ static void fastcgi_module_main(TLS_D SLS_DC)
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == SUCCESS) {
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC) == SUCCESS) {
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_request_shutdown(NULL);
}
}
diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c
index c006016cf7..6074fcb216 100644
--- a/sapi/isapi/php4isapi.c
+++ b/sapi/isapi/php4isapi.c
@@ -361,7 +361,7 @@ static char *sapi_isapi_read_cookies(SLS_D)
#ifdef WITH_ZEUS
-static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array ELS_DC PLS_DC)
+static void sapi_isapi_register_zeus_ssl_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC PLS_DC)
{
char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
@@ -379,7 +379,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] ) {
strcat( static_cons_buf, static_variable_buf );
}
- php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array ELS_CC PLS_CC );
+ php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array TSRMLS_CC PLS_CC );
strcpy( static_cons_buf, "/C=" );
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
@@ -391,10 +391,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] ) {
strcat( static_cons_buf, static_variable_buf );
}
- php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array ELS_CC PLS_CC );
+ php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array TSRMLS_CC PLS_CC );
}
-static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array ELS_DC PLS_DC)
+static void sapi_isapi_register_zeus_variables(LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array TSRMLS_DC PLS_DC)
{
char static_variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
@@ -413,11 +413,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 ELS_CC PLS_CC );
+ php_register_variable( "PHP_SELF", static_variable_buf, track_vars_array TSRMLS_CC PLS_CC );
/* 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 ELS_CC PLS_CC );
+ php_register_variable( "PATH_INFO", static_variable_buf + scriptname_len - 1, track_vars_array TSRMLS_CC PLS_CC );
/* 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... */
@@ -425,8 +425,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 ELS_CC PLS_CC );
- php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array ELS_CC PLS_CC );
+ php_register_variable( "URL", static_variable_buf, track_vars_array TSRMLS_CC PLS_CC );
+ php_register_variable( "REQUEST_URI", static_variable_buf, track_vars_array TSRMLS_CC PLS_CC );
}
}
@@ -434,38 +434,38 @@ 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 ELS_CC PLS_CC );
+ php_register_variable( "PATH_TRANSLATED", static_variable_buf, track_vars_array TSRMLS_CC PLS_CC );
}
/* 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 ELS_CC PLS_CC );
+ php_register_variable( "PHP_AUTH_USER", static_variable_buf, track_vars_array TSRMLS_CC PLS_CC );
}
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 ELS_CC PLS_CC );
+ php_register_variable( "PHP_AUTH_PW", static_variable_buf, track_vars_array TSRMLS_CC PLS_CC );
}
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( "PHP_AUTH_TYPE", static_variable_buf, track_vars_array ELS_CC PLS_CC );
+ php_register_variable( "PHP_AUTH_TYPE", static_variable_buf, track_vars_array TSRMLS_CC PLS_CC );
}
/* 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 ELS_CC PLS_CC );
+ sapi_isapi_register_zeus_ssl_variables( lpECB, track_vars_array TSRMLS_CC PLS_CC );
}
/* 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 ELS_CC PLS_CC );
+ php_register_variable( "SERVER_SIGNATURE", static_variable_buf, track_vars_array TSRMLS_CC PLS_CC );
}
}
#endif
-static void sapi_isapi_register_server_variables2(char **server_variables, LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array, char **recorded_values ELS_DC PLS_DC)
+static void sapi_isapi_register_server_variables2(char **server_variables, LPEXTENSION_CONTROL_BLOCK lpECB, zval *track_vars_array, char **recorded_values TSRMLS_DC PLS_DC)
{
char **p=server_variables;
DWORD variable_len;
@@ -476,7 +476,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 ELS_CC PLS_CC);
+ php_register_variable(*p, static_variable_buf, track_vars_array TSRMLS_CC PLS_CC);
if (recorded_values) {
recorded_values[p-server_variables] = estrndup(static_variable_buf, variable_len);
}
@@ -484,7 +484,7 @@ static void sapi_isapi_register_server_variables2(char **server_variables, LPEXT
variable_buf = (char *) emalloc(variable_len);
if (lpECB->GetServerVariable(lpECB->ConnID, *p, variable_buf, &variable_len)
&& variable_buf[0]) {
- php_register_variable(*p, variable_buf, track_vars_array ELS_CC PLS_CC);
+ php_register_variable(*p, variable_buf, track_vars_array TSRMLS_CC PLS_CC);
}
if (recorded_values) {
recorded_values[p-server_variables] = variable_buf;
@@ -497,7 +497,7 @@ static void sapi_isapi_register_server_variables2(char **server_variables, LPEXT
}
-static void sapi_isapi_register_server_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+static void sapi_isapi_register_server_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
char *variable;
@@ -509,18 +509,18 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array ELS_DC S
/* 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 ELS_CC PLS_CC);
+ sapi_isapi_register_server_variables2(isapi_special_server_variable_names, lpECB, track_vars_array, isapi_special_server_variables TSRMLS_CC PLS_CC);
if (SG(request_info).cookie_data) {
- php_register_variable("HTTP_COOKIE", SG(request_info).cookie_data, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("HTTP_COOKIE", SG(request_info).cookie_data, track_vars_array TSRMLS_CC PLS_CC);
}
/* Register the standard ISAPI variables */
- sapi_isapi_register_server_variables2(isapi_server_variable_names, lpECB, track_vars_array, NULL ELS_CC PLS_CC);
+ sapi_isapi_register_server_variables2(isapi_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC PLS_CC);
if (isapi_special_server_variables[SPECIAL_VAR_HTTPS]
&& atoi(isapi_special_server_variables[SPECIAL_VAR_HTTPS])) {
/* Register SSL ISAPI variables */
- sapi_isapi_register_server_variables2(isapi_secure_server_variable_names, lpECB, track_vars_array, NULL ELS_CC PLS_CC);
+ sapi_isapi_register_server_variables2(isapi_secure_server_variable_names, lpECB, track_vars_array, NULL TSRMLS_CC PLS_CC);
}
if (isapi_special_server_variables[SPECIAL_VAR_HTTPS]) {
@@ -529,12 +529,12 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array ELS_DC S
#ifdef WITH_ZEUS
- sapi_isapi_register_zeus_variables(lpECB, track_vars_array ELS_CC PLS_CC);
+ sapi_isapi_register_zeus_variables(lpECB, track_vars_array TSRMLS_CC PLS_CC);
#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 ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", isapi_special_server_variables[SPECIAL_VAR_PHP_SELF], track_vars_array TSRMLS_CC PLS_CC);
efree(isapi_special_server_variables[SPECIAL_VAR_PHP_SELF]);
}
@@ -551,7 +551,7 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array ELS_DC S
value++;
}
*colon = 0;
- php_register_variable(variable, value, track_vars_array ELS_CC PLS_CC);
+ php_register_variable(variable, value, track_vars_array TSRMLS_CC PLS_CC);
*colon = ':';
}
variable = php_strtok_r(NULL, "\r\n", &strtok_buf);
@@ -570,7 +570,7 @@ static void sapi_isapi_register_server_variables(zval *track_vars_array ELS_DC S
if (humi.lpszPath[path_len-2] == '\\') {
humi.lpszPath[path_len-2] = 0;
}
- php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("DOCUMENT_ROOT", humi.lpszPath, track_vars_array TSRMLS_CC PLS_CC);
}
}
#endif
@@ -720,7 +720,7 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
zend_bool stack_overflown=0;
SLS_FETCH();
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
#ifdef PHP_ENABLE_SEH
LPEXCEPTION_POINTERS e;
@@ -757,8 +757,8 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.opened_path = NULL;
- php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC);
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
if (SG(request_info).cookie_data) {
efree(SG(request_info).cookie_data);
}
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index 8a57ff41e5..32710d2e1e 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -278,7 +278,7 @@ sapi_nsapi_read_cookies(SLS_D)
}
static void
-sapi_nsapi_register_server_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+sapi_nsapi_register_server_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
size_t i;
@@ -288,48 +288,48 @@ sapi_nsapi_register_server_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC
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 ELS_CC PLS_CC );
+ php_register_variable( (char *)nsapi_reqpb[i].env_var, value, track_vars_array TSRMLS_CC PLS_CC );
}
}
for (i = 0; i < nsapi_headers_size; i++) {
value = pblock_findval(nsapi_headers[i].nsapi_eq, rc->rq->headers);
if (value) {
- php_register_variable( (char *)nsapi_headers[i].env_var, value, track_vars_array ELS_CC PLS_CC );
+ php_register_variable( (char *)nsapi_headers[i].env_var, value, track_vars_array TSRMLS_CC PLS_CC );
}
}
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 ELS_CC PLS_CC );
+ php_register_variable( (char *)nsapi_vars[i].env_var, value, track_vars_array TSRMLS_CC PLS_CC );
}
}
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 ELS_CC PLS_CC );
+ php_register_variable( (char *)nsapi_client[i].env_var, value, track_vars_array TSRMLS_CC PLS_CC );
}
}
value = session_dns(rc->sn);
if (value) {
- php_register_variable("REMOTE_HOST", value, track_vars_array ELS_CC PLS_CC );
+ php_register_variable("REMOTE_HOST", value, track_vars_array TSRMLS_CC PLS_CC );
}
sprintf(buf, "%d", conf_getglobals()->Vport);
- php_register_variable("SERVER_PORT", buf, track_vars_array ELS_CC PLS_CC );
- php_register_variable("SERVER_NAME", util_hostname(), track_vars_array ELS_CC PLS_CC );
- php_register_variable("SERVER_URL", http_uri2url("", ""), track_vars_array ELS_CC PLS_CC );
- php_register_variable("HTTPS", (security_active ? "ON" : "OFF"), track_vars_array ELS_CC PLS_CC );
-/* php_register_variable("SERVER_SOFTWARE", MAGNUS_VERSION_STRING, track_vars_array ELS_CC PLS_CC ); */
+ php_register_variable("SERVER_PORT", buf, track_vars_array TSRMLS_CC PLS_CC );
+ php_register_variable("SERVER_NAME", util_hostname(), track_vars_array TSRMLS_CC PLS_CC );
+ php_register_variable("SERVER_URL", http_uri2url("", ""), track_vars_array TSRMLS_CC PLS_CC );
+ php_register_variable("HTTPS", (security_active ? "ON" : "OFF"), track_vars_array TSRMLS_CC PLS_CC );
+/* php_register_variable("SERVER_SOFTWARE", MAGNUS_VERSION_STRING, track_vars_array TSRMLS_CC PLS_CC ); */
/*
* Special PHP_SELF variable.
*/
value = pblock_findval("uri", rc->rq->reqpb);
if ( value != NULL ) {
- php_register_variable("PHP_SELF", value, track_vars_array ELS_CC PLS_CC );
+ php_register_variable("PHP_SELF", value, track_vars_array TSRMLS_CC PLS_CC );
}
}
@@ -449,10 +449,10 @@ nsapi_module_main(NSLS_D SLS_DC)
zend_file_handle file_handle;
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC) == FAILURE) {
return FAILURE;
}
@@ -466,7 +466,7 @@ nsapi_module_main(NSLS_D SLS_DC)
"Parsing [%s]", SG(request_info).path_translated);
#endif
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_request_shutdown(NULL);
#if defined(NSAPI_DEBUG)
diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c
index 7bcce209df..7ea34fc795 100644
--- a/sapi/phttpd/phttpd.c
+++ b/sapi/phttpd/phttpd.c
@@ -261,10 +261,10 @@ int php_doit(PHLS_D SLS_DC)
struct httpinfo *hip = PHG(cip)->hip;
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC) == FAILURE) {
return -1;
}
@@ -273,9 +273,9 @@ int php_doit(PHLS_D SLS_DC)
file_handle.free_filename = 0;
/*
- php_phttpd_hash_environment(PHLS_C CLS_CC ELS_CC PLS_CC SLS_CC);
+ php_phttpd_hash_environment(PHLS_C CLS_CC TSRMLS_CC PLS_CC SLS_CC);
*/
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_request_shutdown(NULL);
return SG(sapi_headers).http_response_code;
@@ -287,7 +287,7 @@ int pm_init(const char **argv)
sapi_startup(&phttpd_sapi_module);
phttpd_sapi_module.startup(&phttpd_sapi_module);
- ph_globals_id = ts_allocate_id(sizeof(phttpd_globals_struct), NULL, NULL);
+ ts_allocate_id(&ph_globals_id, sizeof(phttpd_globals_struct), NULL, NULL);
return 0;
}
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index 362ec133fc..30eb7ba36e 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -320,7 +320,7 @@ static void init_request_info(sapi_globals_struct *sapi_globals, LPCONTROL_BLOCK
SG(sapi_headers).http_response_code = 200;
}
-static void hash_pi3web_variables(ELS_D SLS_DC)
+static void hash_pi3web_variables(TSRMLS_D SLS_DC)
{
char static_variable_buf[PI3WEB_SERVER_VAR_BUF_SIZE];
char *variable_buf;
@@ -379,7 +379,7 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
int iRet = PIAPI_COMPLETED;
SLS_FETCH();
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
zend_try {
@@ -390,13 +390,13 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
CG(extended_info) = 0;
init_request_info(sapi_globals, lpCB);
- php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC);
+ php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC);
- hash_pi3web_variables(ELS_C SLS_CC);
+ hash_pi3web_variables(TSRMLS_C SLS_CC);
switch ( lpCB->dwBehavior ) {
case PHP_MODE_STANDARD:
- iRet = ( php_execute_script( &file_handle CLS_CC ELS_CC PLS_CC ) == SUCCESS ) ?
+ iRet = ( php_execute_script( &file_handle CLS_CC TSRMLS_CC PLS_CC ) == SUCCESS ) ?
PIAPI_COMPLETED : PIAPI_ERROR;
break;
case PHP_MODE_HIGHLIGHT: {
@@ -426,7 +426,7 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
efree(header_line);
break;
case PHP_MODE_LINT:
- iRet = (php_lint_script(&file_handle CLS_CC ELS_CC PLS_CC) == SUCCESS) ?
+ iRet = (php_lint_script(&file_handle CLS_CC TSRMLS_CC PLS_CC) == SUCCESS) ?
PIAPI_COMPLETED : PIAPI_ERROR;
break;
default:
diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c
index 3aeed484d3..407cba1989 100644
--- a/sapi/roxen/roxen.c
+++ b/sapi/roxen/roxen.c
@@ -528,7 +528,7 @@ static sapi_module_struct roxen_sapi_module = {
&pval, sizeof(zval *), NULL)
static void
-php_roxen_hash_environment(CLS_D ELS_DC PLS_DC SLS_DC)
+php_roxen_hash_environment(CLS_D TSRMLS_DC PLS_DC SLS_DC)
{
int i;
char buf[512];
@@ -586,7 +586,7 @@ static int php_roxen_module_main(SLS_D)
#ifdef ZTS
CLS_FETCH();
PLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
#ifdef ROXEN_USE_ZTS
GET_THIS();
#endif
@@ -598,14 +598,14 @@ static int php_roxen_module_main(SLS_D)
file_handle.opened_path = NULL;
THREADS_ALLOW();
- res = php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC);
+ res = php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC);
THREADS_DISALLOW();
if(res == FAILURE) {
return 0;
}
- php_roxen_hash_environment(CLS_C ELS_CC PLS_CC SLS_CC);
+ php_roxen_hash_environment(CLS_C TSRMLS_CC PLS_CC SLS_CC);
THREADS_ALLOW();
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_request_shutdown(NULL);
THREADS_DISALLOW();
return 1;
@@ -705,7 +705,7 @@ void pike_module_init( void )
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
#ifdef ROXEN_USE_ZTS
- roxen_globals_id = ts_allocate_id(sizeof(php_roxen_request), NULL, NULL);
+ ts_allocate_id(&roxen_globals_id, sizeof(php_roxen_request), NULL, NULL);
#endif
#endif
sapi_startup(&roxen_sapi_module);
diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c
index fd48663be9..14f2a42a8a 100644
--- a/sapi/servlet/servlet.c
+++ b/sapi/servlet/servlet.c
@@ -290,7 +290,7 @@ JNIEXPORT jlong JNICALL Java_net_php_servlet_define
pval *pzval;
jlong addr = 0;
const char *nameAsUTF = (*jenv)->GetStringUTFChars(jenv, name, 0);
- ELS_FETCH();
+ TSRMLS_FETCH();
MAKE_STD_ZVAL(pzval);
addr = (jlong)(long) pzval;
@@ -321,7 +321,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
SLS_FETCH();
PLS_FETCH();
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
zend_try {
SG(server_context) = emalloc(sizeof(servlet_request));
@@ -342,7 +342,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
SG(sapi_headers).http_response_code = 200;
SG(request_info).content_length = contentLength;
SG(request_info).auth_password = NULL;
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC)==FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC)==FAILURE) {
ThrowServletException(jenv,"request startup failure");
return;
}
@@ -385,7 +385,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
zend_highlight(&syntax_highlighter_ini);
}
} else {
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_header(); /* Make sure headers have been sent */
}
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index 1b7cb2caf1..19dcd983d2 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -171,20 +171,20 @@ static char *sapi_thttpd_read_cookies(SLS_D)
#define BUF_SIZE 512
#define ADD_STRING(name) \
- php_register_variable(name, buf, track_vars_array ELS_CC PLS_CC)
+ php_register_variable(name, buf, track_vars_array TSRMLS_CC PLS_CC)
-static void sapi_thttpd_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
char buf[BUF_SIZE + 1];
char *p;
TLS_FETCH();
- php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array ELS_CC PLS_CC);
- php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array ELS_CC PLS_CC);
- php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array ELS_CC PLS_CC);
- php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array ELS_CC PLS_CC);
- php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array ELS_CC PLS_CC);
- php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC PLS_CC);
p = inet_ntoa(TG(hc)->client_addr.sa_in.sin_addr);
/* string representation of IPs are never larger than 512 bytes */
@@ -205,7 +205,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array ELS_DC SLS_DC
#define CONDADD(name, field) \
if (TG(hc)->field[0]) { \
- php_register_variable(#name, TG(hc)->field, track_vars_array ELS_CC PLS_CC); \
+ php_register_variable(#name, TG(hc)->field, track_vars_array TSRMLS_CC PLS_CC); \
}
CONDADD(HTTP_REFERER, referer);
@@ -223,7 +223,7 @@ static void sapi_thttpd_register_variables(zval *track_vars_array ELS_DC SLS_DC
}
if (TG(hc)->authorization[0])
- php_register_variable("AUTH_TYPE", "Basic", track_vars_array ELS_CC PLS_CC);
+ php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC PLS_CC);
}
static sapi_module_struct thttpd_sapi_module = {
@@ -262,7 +262,7 @@ static void thttpd_module_main(TLS_D SLS_DC)
{
zend_file_handle file_handle;
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
file_handle.type = ZEND_HANDLE_FILENAME;
@@ -270,11 +270,11 @@ static void thttpd_module_main(TLS_D SLS_DC)
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC) == FAILURE) {
return;
}
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_request_shutdown(NULL);
}
@@ -554,7 +554,7 @@ void thttpd_php_init(void)
{
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
- thttpd_globals_id = ts_allocate_id(sizeof(php_thttpd_globals), NULL, NULL);
+ ts_allocate_id(&thttpd_globals_id, sizeof(php_thttpd_globals), NULL, NULL);
qr_lock = tsrm_mutex_alloc();
thttpd_register_on_close(remove_dead_conn);
#endif
diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c
index 0b0070228f..7dbc6f748c 100644
--- a/sapi/tux/php_tux.c
+++ b/sapi/tux/php_tux.c
@@ -181,9 +181,9 @@ static char *sapi_tux_read_cookies(SLS_D)
#define BUF_SIZE 512
#define ADD_STRING(name) \
- php_register_variable(name, buf, track_vars_array ELS_CC PLS_CC)
+ php_register_variable(name, buf, track_vars_array TSRMLS_CC PLS_CC)
-static void sapi_tux_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS_DC)
+static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC SLS_DC PLS_DC)
{
char buf[BUF_SIZE + 1];
char *p;
@@ -192,14 +192,14 @@ static void sapi_tux_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS
sprintf(buf, "Server: %s", TUXAPI_version);
sapi_add_header_ex(buf, strlen(buf), 1, 0);
- php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array ELS_CC PLS_CC);
- php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array ELS_CC PLS_CC);
- php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array ELS_CC PLS_CC);
- php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array ELS_CC PLS_CC);
- php_register_variable("DOCUMENT_ROOT", TUXAPI_docroot, track_vars_array ELS_CC PLS_CC);
- php_register_variable("SERVER_NAME", TUXAPI_servername, track_vars_array ELS_CC PLS_CC);
- php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array ELS_CC PLS_CC);
- php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array ELS_CC PLS_CC);
+ php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("REQUEST_METHOD", (char *) SG(request_info).request_method, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("DOCUMENT_ROOT", TUXAPI_docroot, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("SERVER_NAME", TUXAPI_servername, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("REQUEST_URI", SG(request_info).request_uri, track_vars_array TSRMLS_CC PLS_CC);
+ php_register_variable("PATH_TRANSLATED", SG(request_info).path_translated, track_vars_array TSRMLS_CC PLS_CC);
p = inet_ntoa(TG(req)->client_host);
/* string representation of IPs are never larger than 512 bytes */
@@ -222,7 +222,7 @@ static void sapi_tux_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS
#define CONDADD(name, field) \
if (TG(req)->field[0]) { \
- php_register_variable(#name, TG(req)->field, track_vars_array ELS_CC PLS_C); \
+ php_register_variable(#name, TG(req)->field, track_vars_array TSRMLS_CC PLS_C); \
}
CONDADD(HTTP_REFERER, referer);
@@ -242,7 +242,7 @@ static void sapi_tux_register_variables(zval *track_vars_array ELS_DC SLS_DC PLS
#if 0
if (TG(hc)->authorization[0])
- php_register_variable("AUTH_TYPE", "Basic", track_vars_array ELS_CC PLS_C);
+ php_register_variable("AUTH_TYPE", "Basic", track_vars_array TSRMLS_CC PLS_C);
#endif
}
@@ -282,7 +282,7 @@ static void tux_module_main(TLS_D SLS_DC)
{
zend_file_handle file_handle;
CLS_FETCH();
- ELS_FETCH();
+ TSRMLS_FETCH();
PLS_FETCH();
file_handle.type = ZEND_HANDLE_FILENAME;
@@ -290,11 +290,11 @@ static void tux_module_main(TLS_D SLS_DC)
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
+ if (php_request_startup(CLS_C TSRMLS_CC PLS_CC SLS_CC) == FAILURE) {
return;
}
- php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
+ php_execute_script(&file_handle CLS_CC TSRMLS_CC PLS_CC);
php_request_shutdown(NULL);
}