summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-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
43 files changed, 131 insertions, 128 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