summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/bcmath/bcmath.c6
-rw-r--r--ext/bcmath/config.m42
-rw-r--r--ext/bcmath/config.w322
-rw-r--r--ext/bcmath/php_bcmath.h5
-rw-r--r--ext/com_dotnet/com_extension.c6
-rw-r--r--ext/com_dotnet/config.w323
-rw-r--r--ext/com_dotnet/php_com_dotnet.h5
-rwxr-xr-xext/date/config.w322
-rw-r--r--ext/date/config0.m42
-rw-r--r--ext/date/php_date.h2
-rw-r--r--ext/ereg/config.w322
-rw-r--r--ext/ereg/config0.m41
-rw-r--r--ext/ereg/php_ereg.h2
-rw-r--r--ext/exif/config.m42
-rw-r--r--ext/exif/config.w322
-rw-r--r--ext/exif/exif.c8
-rw-r--r--ext/filter/config.m42
-rw-r--r--ext/filter/config.w322
-rw-r--r--ext/filter/filter.c6
-rw-r--r--ext/filter/php_filter.h3
-rw-r--r--ext/gmp/config.m42
-rw-r--r--ext/gmp/config.w322
-rw-r--r--ext/gmp/gmp.c6
-rw-r--r--ext/gmp/php_gmp.h5
-rw-r--r--ext/iconv/config.m42
-rw-r--r--ext/iconv/config.w322
-rw-r--r--ext/iconv/iconv.c6
-rw-r--r--ext/iconv/php_iconv.h5
-rw-r--r--ext/intl/config.m42
-rw-r--r--ext/intl/config.w322
-rw-r--r--ext/intl/converter/converter.c12
-rw-r--r--ext/intl/php_intl.c6
-rw-r--r--ext/intl/php_intl.h5
-rw-r--r--ext/json/config.m42
-rw-r--r--ext/json/config.w322
-rw-r--r--ext/json/json.c6
-rw-r--r--ext/json/php_json.h5
-rw-r--r--ext/libxml/config.w322
-rw-r--r--ext/libxml/config0.m42
-rw-r--r--ext/libxml/libxml.c6
-rw-r--r--ext/libxml/php_libxml.h5
-rw-r--r--ext/mbstring/config.m42
-rw-r--r--ext/mbstring/config.w324
-rw-r--r--ext/mbstring/mbstring.c7
-rw-r--r--ext/mbstring/mbstring.h3
-rw-r--r--ext/mysql/config.m42
-rw-r--r--ext/mysql/config.w324
-rw-r--r--ext/mysql/php_mysql.c6
-rw-r--r--ext/mysql/php_mysql_structs.h5
-rw-r--r--ext/mysqli/config.m42
-rw-r--r--ext/mysqli/config.w324
-rw-r--r--ext/mysqli/mysqli.c6
-rw-r--r--ext/mysqli/php_mysqli_structs.h5
-rw-r--r--ext/mysqlnd/config.w322
-rw-r--r--ext/mysqlnd/config9.m42
-rw-r--r--ext/mysqlnd/mysqlnd.h5
-rw-r--r--ext/mysqlnd/mysqlnd_debug.c9
-rw-r--r--ext/mysqlnd/mysqlnd_debug.h3
-rw-r--r--ext/mysqlnd/mysqlnd_driver.c4
-rw-r--r--ext/mysqlnd/php_mysqlnd.c6
-rw-r--r--ext/opcache/ZendAccelerator.c6
-rw-r--r--ext/opcache/ZendAccelerator.h5
-rw-r--r--ext/opcache/config.m42
-rw-r--r--ext/opcache/config.w322
-rw-r--r--ext/pcre/config.w322
-rw-r--r--ext/pcre/config0.m44
-rw-r--r--ext/pcre/php_pcre.h2
-rwxr-xr-xext/pdo_mysql/config.m42
-rw-r--r--ext/pdo_mysql/config.w322
-rw-r--r--ext/pdo_mysql/pdo_mysql.c6
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_int.h5
-rw-r--r--ext/pgsql/config.m42
-rw-r--r--ext/pgsql/config.w322
-rw-r--r--ext/pgsql/pgsql.c6
-rw-r--r--ext/pgsql/php_pgsql.h5
-rw-r--r--ext/phar/config.m42
-rw-r--r--ext/phar/config.w322
-rw-r--r--ext/phar/phar.c6
-rw-r--r--ext/phar/phar_internal.h7
-rwxr-xr-xext/reflection/config.m42
-rwxr-xr-xext/reflection/config.w324
-rw-r--r--ext/reflection/php_reflection.c2
-rw-r--r--ext/session/config.m42
-rw-r--r--ext/session/config.w322
-rw-r--r--ext/session/php_session.h5
-rw-r--r--ext/session/session.c7
-rw-r--r--ext/soap/config.m42
-rw-r--r--ext/soap/config.w322
-rw-r--r--ext/soap/php_soap.h5
-rw-r--r--ext/soap/soap.c6
-rw-r--r--ext/sockets/config.m42
-rw-r--r--ext/sockets/config.w322
-rw-r--r--ext/sockets/php_sockets.h2
-rw-r--r--ext/sockets/sockets.c9
-rwxr-xr-xext/spl/config.m42
-rw-r--r--ext/spl/config.w322
-rw-r--r--ext/spl/php_spl.h2
-rw-r--r--ext/sqlite3/config.w322
-rw-r--r--ext/sqlite3/config0.m42
-rw-r--r--ext/sqlite3/php_sqlite3.h3
-rw-r--r--ext/sqlite3/sqlite3.c6
-rw-r--r--ext/standard/assert.c2
-rw-r--r--ext/standard/basic_functions.h2
-rw-r--r--ext/standard/browscap.c2
-rw-r--r--ext/standard/config.m43
-rw-r--r--ext/standard/config.w323
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/file.h2
-rw-r--r--ext/standard/php_array.h2
-rw-r--r--ext/standard/php_lcg.h2
-rw-r--r--ext/tidy/config.m42
-rw-r--r--ext/tidy/config.w321
-rw-r--r--ext/tidy/php_tidy.h5
-rw-r--r--ext/tidy/tidy.c7
-rw-r--r--ext/xml/config.m42
-rw-r--r--ext/xml/config.w322
-rw-r--r--ext/xml/php_xml.h5
-rw-r--r--ext/xml/xml.c6
-rw-r--r--ext/zlib/config.w322
-rw-r--r--ext/zlib/config0.m42
-rw-r--r--ext/zlib/php_zlib.h2
-rw-r--r--ext/zlib/zlib.c7
122 files changed, 314 insertions, 125 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 5c4e8740e4..11f30e47c3 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -127,6 +127,9 @@ zend_module_entry bcmath_module_entry = {
};
#ifdef COMPILE_DL_BCMATH
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(bcmath)
#endif
@@ -140,6 +143,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(bcmath)
{
+#if defined(COMPILE_DL_BCMATH) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
bcmath_globals->bc_precision = 0;
bc_init_numbers(TSRMLS_C);
}
diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4
index 3a4ad8c3b3..bc126454b4 100644
--- a/ext/bcmath/config.m4
+++ b/ext/bcmath/config.m4
@@ -11,7 +11,7 @@ libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c,
- $ext_shared,,-I@ext_srcdir@/libbcmath/src)
+ $ext_shared,,-I@ext_srcdir@/libbcmath/src -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src)
AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath])
fi
diff --git a/ext/bcmath/config.w32 b/ext/bcmath/config.w32
index 3579eadfae..3973c10cbf 100644
--- a/ext/bcmath/config.w32
+++ b/ext/bcmath/config.w32
@@ -4,7 +4,7 @@
ARG_ENABLE("bcmath", "bc style precision math functions", "yes");
if (PHP_BCMATH == "yes") {
- EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src");
+ EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \
outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \
num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \
diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h
index 12098cff89..6647894bf0 100644
--- a/ext/bcmath/php_bcmath.h
+++ b/ext/bcmath/php_bcmath.h
@@ -49,7 +49,10 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath)
ZEND_END_MODULE_GLOBALS(bcmath)
#ifdef ZTS
-# define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
+# define BCG(v) ZEND_TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
+# ifdef COMPILE_DL_BCMATH
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define BCG(v) (bcmath_globals.v)
#endif
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index e4ed4916af..35fda89963 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -254,6 +254,9 @@ zend_module_entry com_dotnet_module_entry = {
/* }}} */
#ifdef COMPILE_DL_COM_DOTNET
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(com_dotnet)
#endif
@@ -337,6 +340,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(com_dotnet)
{
+#if defined(COMPILE_DL_COM_DOTNET) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(com_dotnet_globals, 0, sizeof(*com_dotnet_globals));
com_dotnet_globals->code_page = CP_ACP;
}
diff --git a/ext/com_dotnet/config.w32 b/ext/com_dotnet/config.w32
index 1526392c24..3ae2328427 100644
--- a/ext/com_dotnet/config.w32
+++ b/ext/com_dotnet/config.w32
@@ -7,7 +7,8 @@ if (PHP_COM_DOTNET == "yes") {
CHECK_LIB('oleaut32.lib', 'com_dotnet');
EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \
com_handlers.c com_iterator.c com_misc.c com_olechar.c \
- com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c");
+ com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c",
+ null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support');
CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET');
}
diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h
index cb60083289..5066a044ff 100644
--- a/ext/com_dotnet/php_com_dotnet.h
+++ b/ext/com_dotnet/php_com_dotnet.h
@@ -53,7 +53,10 @@ ZEND_BEGIN_MODULE_GLOBALS(com_dotnet)
ZEND_END_MODULE_GLOBALS(com_dotnet)
#ifdef ZTS
-# define COMG(v) TSRMG(com_dotnet_globals_id, zend_com_dotnet_globals *, v)
+# define COMG(v) ZEND_TSRMG(com_dotnet_globals_id, zend_com_dotnet_globals *, v)
+# ifdef COMPILE_DL_COM_DOTNET
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define COMG(v) (com_dotnet_globals.v)
#endif
diff --git a/ext/date/config.w32 b/ext/date/config.w32
index c97df7246c..64a4ae92a1 100755
--- a/ext/date/config.w32
+++ b/ext/date/config.w32
@@ -1,7 +1,7 @@
// $Id$
// vim:ft=javascript
-EXTENSION("date", "php_date.c", false, "-Iext/date/lib");
+EXTENSION("date", "php_date.c", false, "/Iext/date/lib /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/date/lib", "astro.c timelib.c dow.c parse_date.c parse_tz.c tm2unixtime.c unixtime2tm.c parse_iso_intervals.c interval.c", "date");
AC_DEFINE('HAVE_DATE', 1, 'Have date/time support');
diff --git a/ext/date/config0.m4 b/ext/date/config0.m4
index 0b46c6803a..867e891f52 100644
--- a/ext/date/config0.m4
+++ b/ext/date/config0.m4
@@ -4,7 +4,7 @@ dnl config.m4 for date extension
sinclude(ext/date/lib/timelib.m4)
sinclude(lib/timelib.m4)
-PHP_DATE_CFLAGS="-I@ext_builddir@/lib"
+PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index 134beef24d..667a552218 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -200,7 +200,7 @@ ZEND_BEGIN_MODULE_GLOBALS(date)
ZEND_END_MODULE_GLOBALS(date)
#ifdef ZTS
-#define DATEG(v) TSRMG(date_globals_id, zend_date_globals *, v)
+#define DATEG(v) ZEND_TSRMG(date_globals_id, zend_date_globals *, v)
#else
#define DATEG(v) (date_globals.v)
#endif
diff --git a/ext/ereg/config.w32 b/ext/ereg/config.w32
index 18a002b44d..887fb0e5b0 100644
--- a/ext/ereg/config.w32
+++ b/ext/ereg/config.w32
@@ -4,7 +4,7 @@
ARG_WITH("ereg", "POSIX extended regular expressions", "yes");
if (PHP_EREG != "no") {
- EXTENSION("ereg", "ereg.c", PHP_EREG_SHARED, "-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp -Iext/ereg/regex");
+ EXTENSION("ereg", "ereg.c", PHP_EREG_SHARED, "-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp -Iext/ereg/regex /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/ereg/regex", "regcomp.c regexec.c regerror.c regfree.c", "ereg");
AC_DEFINE('REGEX', 1, 'Bundled regex');
AC_DEFINE('HSREGEX', 1, 'Bundled regex');
diff --git a/ext/ereg/config0.m4 b/ext/ereg/config0.m4
index caec39d285..2089f24a46 100644
--- a/ext/ereg/config0.m4
+++ b/ext/ereg/config0.m4
@@ -33,6 +33,7 @@ if test "$REGEX_TYPE" = "php"; then
ereg_regex_headers="regex/"
PHP_EREG_CFLAGS="-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp"
fi
+PHP_EREG_CFLAGS="$PHP_EREG_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_NEW_EXTENSION(ereg, ereg.c $ereg_regex_sources, no,,$PHP_EREG_CFLAGS)
PHP_INSTALL_HEADERS([ext/ereg], [php_ereg.h php_regex.h $ereg_regex_headers])
diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h
index f1c2676772..a1081e2669 100644
--- a/ext/ereg/php_ereg.h
+++ b/ext/ereg/php_ereg.h
@@ -54,7 +54,7 @@ ZEND_END_MODULE_GLOBALS(ereg)
PHP_MINFO_FUNCTION(ereg);
#ifdef ZTS
-#define EREG(v) TSRMG(ereg_globals_id, zend_ereg_globals *, v)
+#define EREG(v) ZEND_TSRMG(ereg_globals_id, zend_ereg_globals *, v)
#else
#define EREG(v) (ereg_globals.v)
#endif
diff --git a/ext/exif/config.m4 b/ext/exif/config.m4
index a3ba9240df..8a3a0d43c2 100644
--- a/ext/exif/config.m4
+++ b/ext/exif/config.m4
@@ -7,5 +7,5 @@ PHP_ARG_ENABLE(exif, whether to enable EXIF (metadata from images) support,
if test "$PHP_EXIF" != "no"; then
AC_DEFINE(HAVE_EXIF, 1, [Whether you want EXIF (metadata from images) support])
- PHP_NEW_EXTENSION(exif, exif.c, $ext_shared)
+ PHP_NEW_EXTENSION(exif, exif.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
fi
diff --git a/ext/exif/config.w32 b/ext/exif/config.w32
index 38466c809c..595e71bda0 100644
--- a/ext/exif/config.w32
+++ b/ext/exif/config.w32
@@ -5,7 +5,7 @@ ARG_ENABLE("exif", "exif", "no");
if (PHP_EXIF == "yes") {
if (ADD_EXTENSION_DEP('exif', 'mbstring')) {
- EXTENSION("exif", "exif.c");
+ EXTENSION("exif", "exif.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_EXIF', 1, 'Have exif');
} else {
WARNING("exif support can't be enabled, libxml is not enabled")
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 06e1dae41a..5d00672c5c 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -156,7 +156,10 @@ ZEND_END_MODULE_GLOBALS(exif)
ZEND_DECLARE_MODULE_GLOBALS(exif)
#ifdef ZTS
-#define EXIF_G(v) TSRMG(exif_globals_id, zend_exif_globals *, v)
+#define EXIF_G(v) ZEND_TSRMG(exif_globals_id, zend_exif_globals *, v)
+#ifdef COMPILE_DL_EXIF
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
#else
#define EXIF_G(v) (exif_globals.v)
#endif
@@ -208,6 +211,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(exif)
{
+#if defined(COMPILE_DL_EXIF) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
exif_globals->encode_unicode = NULL;
exif_globals->decode_unicode_be = NULL;
exif_globals->decode_unicode_le = NULL;
diff --git a/ext/filter/config.m4 b/ext/filter/config.m4
index 676f5d99ef..d589b10078 100644
--- a/ext/filter/config.m4
+++ b/ext/filter/config.m4
@@ -39,7 +39,7 @@ yes
CPPFLAGS=$old_CPPFLAGS
fi
- PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared)
+ PHP_NEW_EXTENSION(filter, filter.c sanitizing_filters.c logical_filters.c callback_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(FILTER_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/filter/php_filter.h])
diff --git a/ext/filter/config.w32 b/ext/filter/config.w32
index b74f3a2fd0..0a9e147569 100644
--- a/ext/filter/config.w32
+++ b/ext/filter/config.w32
@@ -4,6 +4,6 @@
ARG_ENABLE("filter", "Filter Support", "yes");
if (PHP_FILTER == "yes") {
- EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c");
+ EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c", PHP_FILTER_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
PHP_INSTALL_HEADERS("ext/filter", "php_filter.h");
}
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index dec6bfb4ec..d1b2abf2aa 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -153,6 +153,9 @@ zend_module_entry filter_module_entry = {
/* }}} */
#ifdef COMPILE_DL_FILTER
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(filter)
#endif
@@ -192,6 +195,9 @@ PHP_INI_END()
static void php_filter_init_globals(zend_filter_globals *filter_globals) /* {{{ */
{
+#if defined(COMPILE_DL_FILTER) && defined(ZTS)
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
ZVAL_UNDEF(&filter_globals->post_array);
ZVAL_UNDEF(&filter_globals->get_array);
ZVAL_UNDEF(&filter_globals->cookie_array);
diff --git a/ext/filter/php_filter.h b/ext/filter/php_filter.h
index a82b2e6159..7ddb009b87 100644
--- a/ext/filter/php_filter.h
+++ b/ext/filter/php_filter.h
@@ -64,7 +64,8 @@ ZEND_BEGIN_MODULE_GLOBALS(filter)
ZEND_END_MODULE_GLOBALS(filter)
#ifdef ZTS
-#define IF_G(v) TSRMG(filter_globals_id, zend_filter_globals *, v)
+#define IF_G(v) ZEND_TSRMG(filter_globals_id, zend_filter_globals *, v)
+ZEND_TSRMLS_CACHE_EXTERN;
#else
#define IF_G(v) (filter_globals.v)
#endif
diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4
index 0388d548cf..8265fb8dfa 100644
--- a/ext/gmp/config.m4
+++ b/ext/gmp/config.m4
@@ -21,7 +21,7 @@ if test "$PHP_GMP" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/$PHP_LIBDIR, GMP_SHARED_LIBADD)
PHP_ADD_INCLUDE($GMP_DIR/include)
- PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared)
+ PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(GMP_SHARED_LIBADD)
AC_DEFINE(HAVE_GMP, 1, [ ])
fi
diff --git a/ext/gmp/config.w32 b/ext/gmp/config.w32
index 8c863f9bc8..7ea36150b2 100644
--- a/ext/gmp/config.w32
+++ b/ext/gmp/config.w32
@@ -6,7 +6,7 @@ ARG_WITH("gmp", "Include GNU MP support.", "no");
if (PHP_GMP != "no") {
if (CHECK_LIB("mpir_a.lib", "gmp", PHP_GMP) &&
CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP + ";" + PHP_PHP_BUILD + "\\include\\mpir")) {
- EXTENSION("gmp", "gmp.c");
+ EXTENSION("gmp", "gmp.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_GMP', 1, 'GMP support');
AC_DEFINE('HAVE_MPIR', 1, 'MPIR support');
} else {
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index d3bf334640..5d1d1e689e 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -214,6 +214,9 @@ zend_module_entry gmp_module_entry = {
/* }}} */
#ifdef COMPILE_DL_GMP
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(gmp)
#endif
@@ -630,6 +633,9 @@ exit:
*/
static ZEND_GINIT_FUNCTION(gmp)
{
+#if defined(COMPILE_DL_GMP) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
gmp_globals->rand_initialized = 0;
}
/* }}} */
diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h
index 0fdc1510f9..27d621bb39 100644
--- a/ext/gmp/php_gmp.h
+++ b/ext/gmp/php_gmp.h
@@ -93,7 +93,10 @@ ZEND_BEGIN_MODULE_GLOBALS(gmp)
ZEND_END_MODULE_GLOBALS(gmp)
#ifdef ZTS
-#define GMPG(v) TSRMG(gmp_globals_id, zend_gmp_globals *, v)
+#define GMPG(v) ZEND_TSRMG(gmp_globals_id, zend_gmp_globals *, v)
+#ifdef COMPILE_DL_GMP
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define GMPG(v) (gmp_globals.v)
#endif
diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
index 10d21ccc6d..88e5abf97e 100644
--- a/ext/iconv/config.m4
+++ b/ext/iconv/config.m4
@@ -171,7 +171,7 @@ int main() {
AC_MSG_RESULT([no])
])
- PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\"])
+ PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
PHP_SUBST(ICONV_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/iconv/])
else
diff --git a/ext/iconv/config.w32 b/ext/iconv/config.w32
index 00ab272423..989a477fa5 100644
--- a/ext/iconv/config.w32
+++ b/ext/iconv/config.w32
@@ -8,7 +8,7 @@ if (PHP_ICONV != "no") {
CHECK_LIB("iconv_a.lib", "iconv", PHP_ICONV) || CHECK_LIB("iconv.lib", "iconv", PHP_ICONV)) &&
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_ICONV", PHP_ICONV)) {
- EXTENSION("iconv", "iconv.c");
+ EXTENSION("iconv", "iconv.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_ICONV", 1, "Define if iconv extension is enabled");
AC_DEFINE("HAVE_LIBICONV", 1, "Define if libiconv is available");
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index a4581e9fad..c8dcc15e99 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -164,12 +164,18 @@ zend_module_entry iconv_module_entry = {
/* }}} */
#ifdef COMPILE_DL_ICONV
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(iconv)
#endif
/* {{{ PHP_GINIT_FUNCTION */
static PHP_GINIT_FUNCTION(iconv)
{
+#if defined(COMPILE_DL_ICONV) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
iconv_globals->input_encoding = NULL;
iconv_globals->output_encoding = NULL;
iconv_globals->internal_encoding = NULL;
diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h
index 1a8330ae24..b2440fc03a 100644
--- a/ext/iconv/php_iconv.h
+++ b/ext/iconv/php_iconv.h
@@ -73,7 +73,10 @@ ZEND_BEGIN_MODULE_GLOBALS(iconv)
ZEND_END_MODULE_GLOBALS(iconv)
#ifdef ZTS
-# define ICONVG(v) TSRMG(iconv_globals_id, zend_iconv_globals *, v)
+# define ICONVG(v) ZEND_TSRMG(iconv_globals_id, zend_iconv_globals *, v)
+# ifdef COMPILE_DL_ICONV
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define ICONVG(v) (iconv_globals.v)
#endif
diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
index 5afee4809e..0fbbd0f786 100644
--- a/ext/intl/config.m4
+++ b/ext/intl/config.m4
@@ -85,7 +85,7 @@ if test "$PHP_INTL" != "no"; then
breakiterator/codepointiterator_internal.cpp \
breakiterator/codepointiterator_methods.cpp \
idn/idn.c \
- $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS)
+ $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR($ext_builddir/collator)
PHP_ADD_BUILD_DIR($ext_builddir/converter)
PHP_ADD_BUILD_DIR($ext_builddir/common)
diff --git a/ext/intl/config.w32 b/ext/intl/config.w32
index 22cde6bd6d..4628e434f7 100644
--- a/ext/intl/config.w32
+++ b/ext/intl/config.w32
@@ -8,7 +8,7 @@ if (PHP_INTL != "no") {
CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
// always build as shared - zend_strtod.c/ICU type conflict
EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,
- "/I \"" + configure_module_dirname + "\"");
+ "/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname + "/collator", "\
collator.c \
collator_attr.c \
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index b27652aa9a..eb37ce00f1 100644
--- a/ext/intl/converter/converter.c
+++ b/ext/intl/converter/converter.c
@@ -24,9 +24,6 @@
#include "../intl_error.h"
typedef struct _php_converter_object {
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
UConverter *src, *dest;
zend_fcall_info to_cb, from_cb;
zend_fcall_info_cache to_cache, from_cache;
@@ -229,9 +226,6 @@ static void php_converter_to_u_callback(const void *context,
php_converter_object *objval = (php_converter_object*)context;
zval retval;
zval zargs[4];
-#ifdef ZTS
- TSRMLS_D = objval->tsrm_ls;
-#endif
ZVAL_LONG(&zargs[0], reason);
ZVAL_STRINGL(&zargs[1], args->source, args->sourceLimit - args->source);
@@ -308,9 +302,6 @@ static void php_converter_from_u_callback(const void *context,
zval retval;
zval zargs[4];
int i;
-#ifdef ZTS
- TSRMLS_D = objval->tsrm_ls;
-#endif
ZVAL_LONG(&zargs[0], reason);
array_init(&zargs[1]);
@@ -1045,9 +1036,6 @@ static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converte
objval = ecalloc(1, sizeof(php_converter_object) + sizeof(zval) * (ce->default_properties_count - 1));
zend_object_std_init(&objval->obj, ce TSRMLS_CC );
-#ifdef ZTS
- objval->tsrm_ls = TSRMLS_C;
-#endif
intl_error_init(&(objval->error) TSRMLS_CC);
objval->obj.handlers = &php_converter_object_handlers;
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 2c5e74809d..15f058d2b4 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -893,12 +893,18 @@ zend_module_entry intl_module_entry = {
/* }}} */
#ifdef COMPILE_DL_INTL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE( intl )
#endif
/* {{{ intl_init_globals */
static PHP_GINIT_FUNCTION(intl)
{
+#if defined(COMPILE_DL_INTL) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset( intl_globals, 0, sizeof(zend_intl_globals) );
}
/* }}} */
diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h
index 3625c4fdcc..265cdb7b9e 100644
--- a/ext/intl/php_intl.h
+++ b/ext/intl/php_intl.h
@@ -56,7 +56,10 @@ ZEND_END_MODULE_GLOBALS(intl)
/* Macro to access request-wide global variables. */
#ifdef ZTS
-#define INTL_G(v) TSRMG(intl_globals_id, zend_intl_globals *, v)
+#define INTL_G(v) ZEND_TSRMG(intl_globals_id, zend_intl_globals *, v)
+#ifdef COMPILE_DL_INTL
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define INTL_G(v) (intl_globals.v)
#endif
diff --git a/ext/json/config.m4 b/ext/json/config.m4
index 26c43a0e3f..9c83a5d893 100644
--- a/ext/json/config.m4
+++ b/ext/json/config.m4
@@ -9,7 +9,7 @@ if test "$PHP_JSON" != "no"; then
AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support])
AC_HEADER_STDC
- PHP_NEW_EXTENSION(json, json.c utf8_decode.c JSON_parser.c, $ext_shared)
+ PHP_NEW_EXTENSION(json, json.c utf8_decode.c JSON_parser.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/json], [php_json.h])
PHP_SUBST(JSON_SHARED_LIBADD)
fi
diff --git a/ext/json/config.w32 b/ext/json/config.w32
index cedbf42829..60ccf91630 100644
--- a/ext/json/config.w32
+++ b/ext/json/config.w32
@@ -4,7 +4,7 @@
ARG_ENABLE("json", "JavaScript Object Serialization support", "yes");
if (PHP_JSON != "no") {
- EXTENSION('json', 'json.c', PHP_JSON_SHARED, "");
+ EXTENSION('json', 'json.c', PHP_JSON_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname, "JSON_parser.c utf8_decode.c", "json");
PHP_INSTALL_HEADERS("ext/json/", "php_json.h");
}
diff --git a/ext/json/json.c b/ext/json/json.c
index 8f4f281ef1..91bedcace9 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -125,6 +125,9 @@ static PHP_MINIT_FUNCTION(json)
*/
static PHP_GINIT_FUNCTION(json)
{
+#if defined(COMPILE_DL_JSON) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
json_globals->encoder_depth = 0;
json_globals->error_code = 0;
json_globals->encode_max_depth = 0;
@@ -153,6 +156,9 @@ zend_module_entry json_module_entry = {
/* }}} */
#ifdef COMPILE_DL_JSON
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(json)
#endif
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index 5b2dc127dd..64ad811bc7 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -44,7 +44,10 @@ ZEND_BEGIN_MODULE_GLOBALS(json)
ZEND_END_MODULE_GLOBALS(json)
#ifdef ZTS
-# define JSON_G(v) TSRMG(json_globals_id, zend_json_globals *, v)
+# define JSON_G(v) ZEND_TSRMG(json_globals_id, zend_json_globals *, v)
+# ifdef COMPILE_DL_JSON
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define JSON_G(v) (json_globals.v)
#endif
diff --git a/ext/libxml/config.w32 b/ext/libxml/config.w32
index 92144f9ad0..e6ad0dc1ab 100644
--- a/ext/libxml/config.w32
+++ b/ext/libxml/config.w32
@@ -9,7 +9,7 @@ if (PHP_LIBXML == "yes") {
CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_LIBXML") &&
ADD_EXTENSION_DEP('libxml', 'iconv')) {
- EXTENSION("libxml", "libxml.c", false /* never shared */);
+ EXTENSION("libxml", "libxml.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC /D LIBXML_STATIC_FOR_DLL /D HAVE_WIN32_THREADS ");
if (!PHP_LIBXML_SHARED) {
diff --git a/ext/libxml/config0.m4 b/ext/libxml/config0.m4
index 14f5868493..79e94a40ad 100644
--- a/ext/libxml/config0.m4
+++ b/ext/libxml/config0.m4
@@ -17,7 +17,7 @@ if test "$PHP_LIBXML" != "no"; then
PHP_SETUP_LIBXML(LIBXML_SHARED_LIBADD, [
AC_DEFINE(HAVE_LIBXML,1,[ ])
- PHP_NEW_EXTENSION(libxml, [libxml.c], $ext_shared)
+ PHP_NEW_EXTENSION(libxml, [libxml.c], $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/libxml/php_libxml.h])
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 3e4fb60825..ad12e3464d 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -79,6 +79,9 @@ static zend_class_entry *libxmlerror_class_entry;
/* {{{ dynamically loadable module stuff */
#ifdef COMPILE_DL_LIBXML
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(libxml)
#endif /* COMPILE_DL_LIBXML */
/* }}} */
@@ -268,6 +271,9 @@ static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
/* {{{ startup, shutdown and info functions */
static PHP_GINIT_FUNCTION(libxml)
{
+#if defined(COMPILE_DL_LIBXML) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
ZVAL_UNDEF(&libxml_globals->stream_context);
libxml_globals->error_buffer.s = NULL;
libxml_globals->error_list = NULL;
diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h
index cccc83f8db..ed5a5a70db 100644
--- a/ext/libxml/php_libxml.h
+++ b/ext/libxml/php_libxml.h
@@ -113,7 +113,10 @@ PHP_LIBXML_API void php_libxml_initialize(void);
PHP_LIBXML_API void php_libxml_shutdown(void);
#ifdef ZTS
-#define LIBXML(v) TSRMG(libxml_globals_id, zend_libxml_globals *, v)
+#define LIBXML(v) ZEND_TSRMG(libxml_globals_id, zend_libxml_globals *, v)
+#ifdef COMPILE_DL_LIBXML
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define LIBXML(v) (libxml_globals.v)
#endif
diff --git a/ext/mbstring/config.m4 b/ext/mbstring/config.m4
index 25bf238761..bd88ee4b63 100644
--- a/ext/mbstring/config.m4
+++ b/ext/mbstring/config.m4
@@ -31,7 +31,7 @@ AC_DEFUN([PHP_MBSTRING_ADD_INSTALL_HEADERS], [
])
AC_DEFUN([PHP_MBSTRING_EXTENSION], [
- PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS)
+ PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(MBSTRING_SHARED_LIBADD)
for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do
diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32
index cf6143699b..ca1fbcdf28 100644
--- a/ext/mbstring/config.w32
+++ b/ext/mbstring/config.w32
@@ -19,7 +19,7 @@ if (PHP_MBSTRING != "no") {
ADD_FLAG("CFLAGS_MBSTRING", get_define("CFLAGS_LIBMBFL") +
" /I ext/mbstring/oniguruma /D NOT_RUBY=1 \
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_STDLIB_H \
- /D HAVE_STRICMP /D EXPORT");
+ /D HAVE_STRICMP /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h");
} else {
@@ -28,7 +28,7 @@ if (PHP_MBSTRING != "no") {
ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
-Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
- /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT")
+ /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
"ext\\mbstring\\libmbfl\\config.h", true);
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 691391ab92..4cc73423d8 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -597,6 +597,9 @@ static sapi_post_entry php_post_entries[] = {
/* }}} */
#ifdef COMPILE_DL_MBSTRING
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mbstring)
#endif
@@ -1491,6 +1494,10 @@ PHP_INI_END()
/* {{{ module global initialize handler */
static PHP_GINIT_FUNCTION(mbstring)
{
+#if defined(COMPILE_DL_MBSTRING) && defined(ZTS)
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
+
mbstring_globals->language = mbfl_no_language_uni;
mbstring_globals->internal_encoding = NULL;
mbstring_globals->current_internal_encoding = mbstring_globals->internal_encoding;
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 0136f8ef7d..bc6434f81f 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -200,7 +200,8 @@ struct mb_overload_def {
};
#ifdef ZTS
-#define MBSTRG(v) TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
+#define MBSTRG(v) ZEND_TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
+ZEND_TSRMLS_CACHE_EXTERN;
#else
#define MBSTRG(v) (mbstring_globals.v)
#endif
diff --git a/ext/mysql/config.m4 b/ext/mysql/config.m4
index fd7f52ef3a..70bfd7110b 100644
--- a/ext/mysql/config.m4
+++ b/ext/mysql/config.m4
@@ -158,7 +158,7 @@ if test "$PHP_MYSQL" != "no"; then
fi
AC_DEFINE(HAVE_MYSQL, 1, [Whether you have MySQL])
- PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared)
+ PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(MYSQL_SHARED_LIBADD)
if test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL" = "mysqlnd"; then
diff --git a/ext/mysql/config.w32 b/ext/mysql/config.w32
index 2a929b4165..0af94d9623 100644
--- a/ext/mysql/config.w32
+++ b/ext/mysql/config.w32
@@ -10,7 +10,7 @@ if (PHP_MYSQL != "no") {
PHP_MYSQL = "no";
WARNING("mysql not enabled; mysqlnd is not enabled");
} else {
- EXTENSION("mysql", "php_mysql.c");
+ EXTENSION("mysql", "php_mysql.c", PHP_MYSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library');
MESSAGE("\tusing mysqlnd build");
}
@@ -18,7 +18,7 @@ if (PHP_MYSQL != "no") {
if (CHECK_LIB("libmysql.lib", "mysql", PHP_MYSQL) &&
CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQL",
PHP_MYSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\mysql;" + PHP_MYSQL)) {
- EXTENSION("mysql", "php_mysql.c");
+ EXTENSION("mysql", "php_mysql.c", PHP_MYSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_MYSQL', 1, 'Have MySQL library');
MESSAGE("\tusing libmysql");
} else {
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 4fcc9ca83a..384ce9a6ba 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -352,6 +352,9 @@ zend_module_entry mysql_module_entry = {
/* }}} */
#ifdef COMPILE_DL_MYSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mysql)
#endif
@@ -512,6 +515,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(mysql)
{
+#if defined(COMPILE_DL_MYSQL) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
mysql_globals->num_persistent = 0;
mysql_globals->default_socket = NULL;
mysql_globals->default_host = NULL;
diff --git a/ext/mysql/php_mysql_structs.h b/ext/mysql/php_mysql_structs.h
index 8eb9aa1d29..214a5c689b 100644
--- a/ext/mysql/php_mysql_structs.h
+++ b/ext/mysql/php_mysql_structs.h
@@ -127,7 +127,10 @@ ZEND_BEGIN_MODULE_GLOBALS(mysql)
ZEND_END_MODULE_GLOBALS(mysql)
#ifdef ZTS
-# define MySG(v) TSRMG(mysql_globals_id, zend_mysql_globals *, v)
+# define MySG(v) ZEND_TSRMG(mysql_globals_id, zend_mysql_globals *, v)
+# ifdef COMPILE_DL_MYSQL
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define MySG(v) (mysql_globals.v)
#endif
diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4
index f6c86e762b..dedd1bc4a7 100644
--- a/ext/mysqli/config.m4
+++ b/ext/mysqli/config.m4
@@ -75,7 +75,7 @@ if test "$PHP_MYSQLI" != "no"; then
mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \
mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \
mysqli_exception.c mysqli_result_iterator.c $mysqli_extra_sources"
- PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared)
+ PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(MYSQLI_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/mysqli/php_mysqli_structs.h])
diff --git a/ext/mysqli/config.w32 b/ext/mysqli/config.w32
index ab8bcd0087..9213931393 100644
--- a/ext/mysqli/config.w32
+++ b/ext/mysqli/config.w32
@@ -23,7 +23,7 @@ if (PHP_MYSQLI != "no") {
"mysqli_warning.c";
if (PHP_MYSQLI == "yes" || PHP_MYSQLI == "mysqlnd") {
- EXTENSION("mysqli", mysqli_source);
+ EXTENSION("mysqli", mysqli_source, PHP_MYSQLI_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('MYSQLI_USE_MYSQLND', 1, 'Using MySQL native driver');
AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
ADD_EXTENSION_DEP('mysqli', 'mysqlnd', true);
@@ -34,7 +34,7 @@ if (PHP_MYSQLI != "no") {
CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI +
"\\include;" + PHP_PHP_BUILD +
"\\include\\mysql;" + PHP_MYSQLI)) {
- EXTENSION("mysqli", mysqli_source);
+ EXTENSION("mysqli", mysqli_source, PHP_MYSQLI_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
MESSAGE("\tlibmysql build");
PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 6d7210fe59..88b79451b2 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -537,6 +537,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(mysqli)
{
+#if defined(COMPILE_DL_MYSQLI) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
mysqli_globals->num_links = 0;
mysqli_globals->num_active_persistent = 0;
mysqli_globals->num_inactive_persistent = 0;
@@ -1030,6 +1033,9 @@ zend_module_entry mysqli_module_entry = {
/* }}} */
#ifdef COMPILE_DL_MYSQLI
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mysqli)
#endif
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index d815df3eee..cf12c5bba5 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -344,7 +344,10 @@ ZEND_END_MODULE_GLOBALS(mysqli)
#ifdef ZTS
-#define MyG(v) TSRMG(mysqli_globals_id, zend_mysqli_globals *, v)
+#define MyG(v) ZEND_TSRMG(mysqli_globals_id, zend_mysqli_globals *, v)
+#ifdef COMPILE_DL_MYSQLI
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define MyG(v) (mysqli_globals.v)
#endif
diff --git a/ext/mysqlnd/config.w32 b/ext/mysqlnd/config.w32
index b13a81530a..ff102310dd 100644
--- a/ext/mysqlnd/config.w32
+++ b/ext/mysqlnd/config.w32
@@ -25,7 +25,7 @@ if (PHP_MYSQLND != "no") {
"mysqlnd_statistics.c " +
"mysqlnd_wireprotocol.c " +
"php_mysqlnd.c ";
- EXTENSION("mysqlnd", mysqlnd_source, false);
+ EXTENSION("mysqlnd", mysqlnd_source, false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
if ((((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "mysqlnd", PHP_MYSQLND))) ||
(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "mysqlnd", PHP_MYSQLND)) ||
(PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4
index 1a0136d8db..756a325014 100644
--- a/ext/mysqlnd/config9.m4
+++ b/ext/mysqlnd/config9.m4
@@ -41,7 +41,7 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes"; then
fi
mysqlnd_sources="$mysqlnd_base_sources $mysqlnd_ps_sources"
- PHP_NEW_EXTENSION(mysqlnd, $mysqlnd_sources, $ext_shared)
+ PHP_NEW_EXTENSION(mysqlnd, $mysqlnd_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR([ext/mysqlnd], 1)
PHP_INSTALL_HEADERS([ext/mysqlnd/])
fi
diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h
index aab977d24c..2e45740abb 100644
--- a/ext/mysqlnd/mysqlnd.h
+++ b/ext/mysqlnd/mysqlnd.h
@@ -288,7 +288,10 @@ ZEND_END_MODULE_GLOBALS(mysqlnd)
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd)
#ifdef ZTS
-#define MYSQLND_G(v) TSRMG(mysqlnd_globals_id, zend_mysqlnd_globals *, v)
+#define MYSQLND_G(v) ZEND_TSRMG(mysqlnd_globals_id, zend_mysqlnd_globals *, v)
+#ifdef COMPILE_DL_MYSQLND
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define MYSQLND_G(v) (mysqlnd_globals.v)
#endif
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c
index f1fde4efbb..c8f682b8e2 100644
--- a/ext/mysqlnd/mysqlnd_debug.c
+++ b/ext/mysqlnd/mysqlnd_debug.c
@@ -39,8 +39,6 @@ static const char * const mysqlnd_debug_empty_string = "";
static enum_func_status
MYSQLND_METHOD(mysqlnd_debug, open)(MYSQLND_DEBUG * self, zend_bool reopen)
{
- MYSQLND_ZTS(self);
-
if (!self->file_name) {
return FAIL;
}
@@ -67,7 +65,6 @@ MYSQLND_METHOD(mysqlnd_debug, log)(MYSQLND_DEBUG * self,
unsigned int flags = self->flags;
char pid_buffer[10], time_buffer[30], file_buffer[200],
line_buffer[6], level_buffer[7];
- MYSQLND_ZTS(self);
if (!self->stream && FAIL == self->m->open(self, FALSE)) {
return FAIL;
@@ -165,7 +162,6 @@ MYSQLND_METHOD(mysqlnd_debug, log_va)(MYSQLND_DEBUG *self,
unsigned int flags = self->flags;
char pid_buffer[10], time_buffer[30], file_buffer[200],
line_buffer[6], level_buffer[7];
- MYSQLND_ZTS(self);
if (!self->stream && FAIL == self->m->open(self, FALSE)) {
return FAIL;
@@ -436,7 +432,6 @@ MYSQLND_METHOD(mysqlnd_debug, func_leave)(MYSQLND_DEBUG * self, unsigned int lin
static enum_func_status
MYSQLND_METHOD(mysqlnd_debug, close)(MYSQLND_DEBUG * self)
{
- MYSQLND_ZTS(self);
if (self->stream) {
#ifndef MYSQLND_PROFILING_DISABLED
if (!(self->flags & MYSQLND_DEBUG_FLUSH) && (self->flags & MYSQLND_DEBUG_PROFILE_CALLS)) {
@@ -718,9 +713,7 @@ PHPAPI MYSQLND_DEBUG *
mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC)
{
MYSQLND_DEBUG *ret = calloc(1, sizeof(MYSQLND_DEBUG));
-#ifdef ZTS
- ret->TSRMLS_C = TSRMLS_C;
-#endif
+
ret->nest_level_limit = 0;
ret->pid = getpid();
zend_stack_init(&ret->call_stack, sizeof(char *));
diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h
index bb4ff3e895..e8dfeb6c4a 100644
--- a/ext/mysqlnd/mysqlnd_debug.h
+++ b/ext/mysqlnd/mysqlnd_debug.h
@@ -45,9 +45,6 @@ struct st_mysqlnd_debug_methods
struct st_mysqlnd_debug
{
php_stream *stream;
-#ifdef ZTS
- TSRMLS_D;
-#endif
unsigned int flags;
unsigned int nest_level_limit;
int pid;
diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c
index e67d023edb..a35474b9e6 100644
--- a/ext/mysqlnd/mysqlnd_driver.c
+++ b/ext/mysqlnd/mysqlnd_driver.c
@@ -99,9 +99,7 @@ static void
mysqlnd_error_list_pdtor(void * pDest)
{
MYSQLND_ERROR_LIST_ELEMENT * element = (MYSQLND_ERROR_LIST_ELEMENT *) pDest;
-#ifdef ZTS
- TSRMLS_FETCH();
-#endif
+
DBG_ENTER("mysqlnd_error_list_pdtor");
if (element->error) {
mnd_pefree(element->error, TRUE);
diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c
index a16018f6ba..71512e8d46 100644
--- a/ext/mysqlnd/php_mysqlnd.c
+++ b/ext/mysqlnd/php_mysqlnd.c
@@ -179,6 +179,9 @@ PHPAPI ZEND_DECLARE_MODULE_GLOBALS(mysqlnd)
*/
static PHP_GINIT_FUNCTION(mysqlnd)
{
+#if defined(COMPILE_DL_MYSQLND) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
mysqlnd_globals->collect_statistics = TRUE;
mysqlnd_globals->collect_memory_statistics = FALSE;
mysqlnd_globals->debug = NULL; /* The actual string */
@@ -357,6 +360,9 @@ zend_module_entry mysqlnd_module_entry = {
/* {{{ COMPILE_DL_MYSQLND */
#ifdef COMPILE_DL_MYSQLND
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mysqlnd)
#endif
/* }}} */
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 34b5b47808..486cb39a17 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -90,6 +90,9 @@ ZEND_EXTENSION();
zend_accel_globals accel_globals;
#else
int accel_globals_id;
+#if defined(COMPILE_DL_OPCACHE)
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
#endif
/* Points to the structure shared across all PHP processes */
@@ -2232,6 +2235,9 @@ static int zend_accel_init_shm(TSRMLS_D)
static void accel_globals_ctor(zend_accel_globals *accel_globals TSRMLS_DC)
{
+#if defined(COMPILE_DL_OPCACHE) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(accel_globals, 0, sizeof(zend_accel_globals));
zend_hash_init(&accel_globals->function_table, zend_hash_num_elements(CG(function_table)), NULL, ZEND_FUNCTION_DTOR, 1);
zend_accel_copy_internal_functions(TSRMLS_C);
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 619ade025d..119148aa27 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -284,8 +284,11 @@ extern zend_accel_shared_globals *accel_shared_globals;
#define ZCSG(element) (accel_shared_globals->element)
#ifdef ZTS
-# define ZCG(v) TSRMG(accel_globals_id, zend_accel_globals *, v)
+# define ZCG(v) ZEND_TSRMG(accel_globals_id, zend_accel_globals *, v)
extern int accel_globals_id;
+# ifdef COMPILE_DL_OPCACHE
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define ZCG(v) (accel_globals.v)
extern zend_accel_globals accel_globals;
diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
index 793105b966..be2f0feab7 100644
--- a/ext/opcache/config.m4
+++ b/ext/opcache/config.m4
@@ -385,7 +385,7 @@ fi
Optimizer/optimize_temp_vars_5.c \
Optimizer/nop_removal.c \
Optimizer/compact_literals.c,
- shared,,,,yes)
+ shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes)
PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1)
fi
diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32
index 9a0713d608..921f0ed9b4 100644
--- a/ext/opcache/config.w32
+++ b/ext/opcache/config.w32
@@ -14,7 +14,7 @@ if (PHP_OPCACHE != "no") {
zend_persist.c \
zend_persist_calc.c \
zend_shared_alloc.c \
- shared_alloc_win32.c", true);
+ shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname + "/Optimizer", "zend_optimizer.c pass1_5.c pass2.c pass3.c optimize_func_calls.c block_pass.c optimize_temp_vars_5.c nop_removal.c compact_literals.c", "opcache", "OptimizerObj");
diff --git a/ext/pcre/config.w32 b/ext/pcre/config.w32
index 594b1cb474..1fe4b687f6 100644
--- a/ext/pcre/config.w32
+++ b/ext/pcre/config.w32
@@ -2,7 +2,7 @@
// vim:ft=javascript
EXTENSION("pcre", "php_pcre.c", false /* never shared */,
- "-Iext/pcre/pcrelib");
+ "-Iext/pcre/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucd.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c pcre_jit_compile.c", "pcre");
ADD_DEF_FILE("ext\\pcre\\php_pcre.def");
diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4
index bfe2009aa0..7749bb68df 100644
--- a/ext/pcre/config0.m4
+++ b/ext/pcre/config0.m4
@@ -47,7 +47,7 @@ PHP_ARG_WITH(pcre-regex,,
AC_DEFINE(HAVE_PCRE, 1, [ ])
PHP_ADD_INCLUDE($PCRE_INCDIR)
- PHP_NEW_EXTENSION(pcre, php_pcre.c, no)
+ PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
else
AC_MSG_CHECKING([for PCRE library to use])
@@ -60,7 +60,7 @@ PHP_ARG_WITH(pcre-regex,,
pcrelib/pcre_tables.c pcrelib/pcre_valid_utf8.c \
pcrelib/pcre_version.c pcrelib/pcre_xclass.c \
pcrelib/pcre_jit_compile.c"
- PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib"
+ PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index a8523cff9c..5ed39deaea 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -79,7 +79,7 @@ ZEND_BEGIN_MODULE_GLOBALS(pcre)
ZEND_END_MODULE_GLOBALS(pcre)
#ifdef ZTS
-# define PCRE_G(v) TSRMG(pcre_globals_id, zend_pcre_globals *, v)
+# define PCRE_G(v) ZEND_TSRMG(pcre_globals_id, zend_pcre_globals *, v)
#else
# define PCRE_G(v) (pcre_globals.v)
#endif
diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4
index f237f413be..95ae6ca7ed 100755
--- a/ext/pdo_mysql/config.m4
+++ b/ext/pdo_mysql/config.m4
@@ -144,7 +144,7 @@ if test "$PHP_PDO_MYSQL" != "no"; then
fi
dnl fix after renaming to pdo_mysql
- PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -I)
+ PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -I -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
ifdef([PHP_ADD_EXTENSION_DEP],
[
PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
diff --git a/ext/pdo_mysql/config.w32 b/ext/pdo_mysql/config.w32
index da085dc569..f150916b2a 100644
--- a/ext/pdo_mysql/config.w32
+++ b/ext/pdo_mysql/config.w32
@@ -12,7 +12,7 @@ if (PHP_PDO_MYSQL != "no") {
} else {
if (CHECK_LIB("libmysql.lib", "pdo_mysql", PHP_PDO_MYSQL) &&
CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_PDO_MYSQL", PHP_PHP_BUILD + "\\include\\mysql;" + PHP_PDO_MYSQL)) {
- EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c");
+ EXTENSION("pdo_mysql", "pdo_mysql.c mysql_driver.c mysql_statement.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
} else {
WARNING("pdo_mysql not enabled; libraries and headers not found");
}
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
index 87ff61f6de..0e997b1dc7 100644
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -32,6 +32,9 @@
#include "php_pdo_mysql_int.h"
#ifdef COMPILE_DL_PDO_MYSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(pdo_mysql)
#endif
@@ -206,6 +209,9 @@ static PHP_RSHUTDOWN_FUNCTION(pdo_mysql)
*/
static PHP_GINIT_FUNCTION(pdo_mysql)
{
+#if defined(COMPILE_DL_PDO_MYSQL) && defined(ZTS)
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
#ifndef PHP_WIN32
pdo_mysql_globals->default_socket = NULL;
#endif
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
index c9e091f414..9493fda6f8 100644
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -83,7 +83,10 @@ ZEND_END_MODULE_GLOBALS(pdo_mysql)
ZEND_EXTERN_MODULE_GLOBALS(pdo_mysql)
#ifdef ZTS
-#define PDO_MYSQL_G(v) TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
+#define PDO_MYSQL_G(v) ZEND_TSRMG(pdo_mysql_globals_id, zend_pdo_mysql_globals *, v)
+# ifdef COMPILE_DL_PDO_MYSQL
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
#define PDO_MYSQL_G(v) (pdo_mysql_globals.v)
#endif
diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4
index 186469861f..0ec34c4c25 100644
--- a/ext/pgsql/config.m4
+++ b/ext/pgsql/config.m4
@@ -105,7 +105,7 @@ if test "$PHP_PGSQL" != "no"; then
PHP_ADD_INCLUDE($PGSQL_INCLUDE)
- PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared)
+ PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
fi
diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32
index d38048d90b..5775dfa023 100644
--- a/ext/pgsql/config.w32
+++ b/ext/pgsql/config.w32
@@ -6,7 +6,7 @@ ARG_WITH("pgsql", "PostgreSQL support", "no");
if (PHP_PGSQL != "no") {
if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) &&
CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;" + PHP_PGSQL)) {
- EXTENSION("pgsql", "pgsql.c");
+ EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library');
ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS /D HAVE_PQEXECPARAMS /D HAVE_PQPREPARE /D HAVE_PQEXECPREPARED /D HAVE_PQRESULTERRORFIELD /D HAVE_PQSENDQUERYPARAMS /D HAVE_PQSENDPREPARE /D HAVE_PQSENDQUERYPREPARED /D HAVE_PQPUTCOPYDATA /D HAVE_PQPUTCOPYEND /D HAVE_PQGETCOPYDATA /D HAVE_PQSETERRORVERBOSITY /D HAVE_PQUNESCAPEBYTEA /D HAVE_PQFTABLE /D HAVE_PQESCAPE_CONN /D HAVE_PQESCAPE_BYTEA_CONN /D HAVE_PQFREEMEM /D HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT /D HAVE_PQPROTOCOLVERSION /D HAVE_PG_LO_CREATE /D HAVE_PG_LO_IMPORT_WITH_OID /D HAVE_PG_LO_TRUNCATE /D HAVE_PG_LO64 /D HAVE_PQESCAPELITERAL /D HAVE_PQOIDVALUE");
} else {
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 119a47f24c..7916afc3fc 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -772,6 +772,9 @@ zend_module_entry pgsql_module_entry = {
/* }}} */
#ifdef COMPILE_DL_PGSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(pgsql)
#endif
@@ -1091,6 +1094,9 @@ PHP_INI_END()
*/
static PHP_GINIT_FUNCTION(pgsql)
{
+#if defined(COMPILE_DL_PGSQL) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(pgsql_globals, 0, sizeof(zend_pgsql_globals));
/* Initilize notice message hash at MINIT only */
zend_hash_init_ex(&pgsql_globals->notices, 0, NULL, PHP_PGSQL_NOTICE_PTR_DTOR, 1, 0);
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index 661c02f77f..18f1bbe77f 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -322,7 +322,10 @@ ZEND_END_MODULE_GLOBALS(pgsql)
ZEND_EXTERN_MODULE_GLOBALS(pgsql)
#ifdef ZTS
-# define PGG(v) TSRMG(pgsql_globals_id, zend_pgsql_globals *, v)
+# define PGG(v) ZEND_TSRMG(pgsql_globals_id, zend_pgsql_globals *, v)
+# ifdef COMPILE_DL_PGSQL
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define PGG(v) (pgsql_globals.v)
#endif
diff --git a/ext/phar/config.m4 b/ext/phar/config.m4
index 614d672eab..8b91caaedc 100644
--- a/ext/phar/config.m4
+++ b/ext/phar/config.m4
@@ -5,7 +5,7 @@ PHP_ARG_ENABLE(phar, for phar archive support,
[ --disable-phar Disable phar support], yes)
if test "$PHP_PHAR" != "no"; then
- PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c, $ext_shared)
+ PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
AC_MSG_CHECKING([for phar openssl support])
if test "$PHP_HASH_SHARED" != "yes"; then
if test "$PHP_HASH" != "no"; then
diff --git a/ext/phar/config.w32 b/ext/phar/config.w32
index 93504f61fb..6dba20affb 100644
--- a/ext/phar/config.w32
+++ b/ext/phar/config.w32
@@ -9,7 +9,7 @@ if (PHP_PHAR_NATIVE_SSL != "no") {
}
if (PHP_PHAR != "no") {
- EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c util.c zip.c");
+ EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c util.c zip.c", PHP_PHAR_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
if (PHP_PHAR_SHARED || (PHP_PHAR_NATIVE_SSL_SHARED && PHP_SNAPSHOT_BUILD == "no")) {
ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_PHAR ");
}
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 0903f6c952..ec64f09c09 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -3228,6 +3228,9 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
/* }}} */
#ifdef COMPILE_DL_PHAR
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(phar)
#endif
@@ -3336,6 +3339,9 @@ static void mime_type_dtor(zval *zv)
PHP_GINIT_FUNCTION(phar) /* {{{ */
{
+#if defined(COMPILE_DL_PHAR) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
phar_mime_type mime;
memset(phar_globals, 0, sizeof(zend_phar_globals));
diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h
index f49143bc8c..7fe647b97d 100644
--- a/ext/phar/phar_internal.h
+++ b/ext/phar/phar_internal.h
@@ -196,8 +196,11 @@ ZEND_EXTERN_MODULE_GLOBALS(phar)
#ifdef ZTS
# include "TSRM.h"
-# define PHAR_G(v) TSRMG(phar_globals_id, zend_phar_globals *, v)
-# define PHAR_GLOBALS ((zend_phar_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(phar_globals_id)])
+# ifdef COMPILE_DL_PHAR
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
+# define PHAR_G(v) ZEND_TSRMG(phar_globals_id, zend_phar_globals *, v)
+# define PHAR_GLOBALS ((zend_phar_globals *) (*((void ***) ZEND_TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(phar_globals_id)])
#else
# define PHAR_G(v) (phar_globals.v)
# define PHAR_GLOBALS (&phar_globals)
diff --git a/ext/reflection/config.m4 b/ext/reflection/config.m4
index 702663677b..08f8e1ef5d 100755
--- a/ext/reflection/config.m4
+++ b/ext/reflection/config.m4
@@ -2,4 +2,4 @@ dnl $Id$
dnl config.m4 for extension reflection
AC_DEFINE(HAVE_REFLECTION, 1, [Whether Reflection is enabled])
-PHP_NEW_EXTENSION(reflection, php_reflection.c, no)
+PHP_NEW_EXTENSION(reflection, php_reflection.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
diff --git a/ext/reflection/config.w32 b/ext/reflection/config.w32
index 724bf7bde4..2eb33c66ee 100755
--- a/ext/reflection/config.w32
+++ b/ext/reflection/config.w32
@@ -1,6 +1,6 @@
// $Id$
// vim:ft=javascript
-EXTENSION("reflection", "php_reflection.c", false /* never shared */);
+EXTENSION("reflection", "php_reflection.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_REFLECTION', 1, 'Reflection support enabled');
-PHP_REFLECTION="yes"; \ No newline at end of file
+PHP_REFLECTION="yes";
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 026680cd6d..3ff63b8d69 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -70,7 +70,7 @@ ZEND_END_MODULE_GLOBALS(reflection)
#ifdef ZTS
# define REFLECTION_G(v) \
- TSRMG(reflection_globals_id, zend_reflection_globals*, v)
+ ZEND_TSRMG(reflection_globals_id, zend_reflection_globals*, v)
extern int reflection_globals_id;
#else
# define REFLECTION_G(v) (reflection_globals.v)
diff --git a/ext/session/config.m4 b/ext/session/config.m4
index 1c3ba78368..949306c026 100644
--- a/ext/session/config.m4
+++ b/ext/session/config.m4
@@ -11,7 +11,7 @@ PHP_ARG_WITH(mm,for mm support,
if test "$PHP_SESSION" != "no"; then
PHP_PWRITE_TEST
PHP_PREAD_TEST
- PHP_NEW_EXTENSION(session, mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c, $ext_shared)
+ PHP_NEW_EXTENSION(session, mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_EXTENSION_DEP(session, hash, true)
PHP_ADD_EXTENSION_DEP(session, spl)
PHP_SUBST(SESSION_SHARED_LIBADD)
diff --git a/ext/session/config.w32 b/ext/session/config.w32
index c8b217aad9..942f595da1 100644
--- a/ext/session/config.w32
+++ b/ext/session/config.w32
@@ -4,7 +4,7 @@
ARG_ENABLE("session", "session support", "yes");
if (PHP_SESSION == "yes") {
- EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */);
+ EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
PHP_INSTALL_HEADERS("ext/session/", "mod_mm.h php_session.h mod_files.h mod_user.h");
}
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 9fb6477056..1bd6d561b7 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -189,7 +189,10 @@ extern zend_module_entry session_module_entry;
#define phpext_session_ptr &session_module_entry
#ifdef ZTS
-#define PS(v) TSRMG(ps_globals_id, php_ps_globals *, v)
+#define PS(v) ZEND_TSRMG(ps_globals_id, php_ps_globals *, v)
+#ifdef COMPILE_DL_SESSION
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define PS(v) (ps_globals.v)
#endif
diff --git a/ext/session/session.c b/ext/session/session.c
index 8d112c3a18..12564fa5b9 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2377,6 +2377,10 @@ static PHP_GINIT_FUNCTION(ps) /* {{{ */
{
int i;
+#if defined(COMPILE_DL_SESSION) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
+
ps_globals->save_path = NULL;
ps_globals->session_name = NULL;
ps_globals->id = NULL;
@@ -2803,6 +2807,9 @@ zend_module_entry session_module_entry = {
};
#ifdef COMPILE_DL_SESSION
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(session)
#endif
diff --git a/ext/soap/config.m4 b/ext/soap/config.m4
index 7fa8c6f0ec..5fcb8bd447 100644
--- a/ext/soap/config.m4
+++ b/ext/soap/config.m4
@@ -17,7 +17,7 @@ if test "$PHP_SOAP" != "no"; then
PHP_SETUP_LIBXML(SOAP_SHARED_LIBADD, [
AC_DEFINE(HAVE_SOAP,1,[ ])
- PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared)
+ PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(SOAP_SHARED_LIBADD)
], [
AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
diff --git a/ext/soap/config.w32 b/ext/soap/config.w32
index 7aa73b5838..bb26a90471 100644
--- a/ext/soap/config.w32
+++ b/ext/soap/config.w32
@@ -5,7 +5,7 @@ ARG_ENABLE("soap", "SOAP support", "no");
if (PHP_SOAP != "no") {
if (PHP_LIBXML == "yes" && ADD_EXTENSION_DEP('soap', 'libxml')) {
- EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c');
+ EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c', null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_PHP_SOAP', 1, "SOAP support");
if (!PHP_SOAP_SHARED) {
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index f32555cd93..e636ef39e7 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -193,7 +193,10 @@ extern zend_module_entry soap_module_entry;
ZEND_EXTERN_MODULE_GLOBALS(soap)
#ifdef ZTS
-# define SOAP_GLOBAL(v) TSRMG(soap_globals_id, zend_soap_globals *, v)
+# define SOAP_GLOBAL(v) ZEND_TSRMG(soap_globals_id, zend_soap_globals *, v)
+# ifdef COMPILE_DL_SOAP
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define SOAP_GLOBAL(v) (soap_globals.v)
#endif
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 0e7d004564..cf409cedf2 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -466,6 +466,9 @@ zend_module_entry soap_module_entry = {
};
#ifdef COMPILE_DL_SOAP
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(soap)
#endif
@@ -602,6 +605,9 @@ PHP_MSHUTDOWN_FUNCTION(soap)
PHP_RINIT_FUNCTION(soap)
{
+#if defined(COMPILE_DL_SOAP) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
SOAP_GLOBAL(typemap) = NULL;
SOAP_GLOBAL(use_soap_error_handler) = 0;
SOAP_GLOBAL(error_code) = NULL;
diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4
index a5a63dfb61..cea27000cf 100644
--- a/ext/sockets/config.m4
+++ b/ext/sockets/config.m4
@@ -56,6 +56,6 @@ if test "$PHP_SOCKETS" != "no"; then
AC_DEFINE(HAVE_AI_V4MAPPED,1,[Whether you have AI_V4MAPPED])
fi
- PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared])
+ PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c], [$ext_shared],, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
fi
diff --git a/ext/sockets/config.w32 b/ext/sockets/config.w32
index aeaa8ed425..d3455b05dd 100644
--- a/ext/sockets/config.w32
+++ b/ext/sockets/config.w32
@@ -7,7 +7,7 @@ if (PHP_SOCKETS != "no") {
if (CHECK_LIB("ws2_32.lib", "sockets", PHP_SOCKETS)
&& CHECK_LIB("Iphlpapi.lib", "sockets", PHP_SOCKETS)
&& CHECK_HEADER_ADD_INCLUDE("winsock.h", "CFLAGS_SOCKETS")) {
- EXTENSION('sockets', 'sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c');
+ EXTENSION('sockets', 'sockets.c multicast.c conversions.c sockaddr_conv.c sendrecvmsg.c', PHP_SOCKETS_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_SOCKETS', 1);
PHP_INSTALL_HEADERS("ext/sockets", "php_sockets.h");
} else {
diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h
index 209b4d1659..98c36cd1ad 100644
--- a/ext/sockets/php_sockets.h
+++ b/ext/sockets/php_sockets.h
@@ -91,7 +91,7 @@ ZEND_BEGIN_MODULE_GLOBALS(sockets)
ZEND_END_MODULE_GLOBALS(sockets)
#ifdef ZTS
-#define SOCKETS_G(v) TSRMG(sockets_globals_id, zend_sockets_globals *, v)
+#define SOCKETS_G(v) ZEND_TSRMG(sockets_globals_id, zend_sockets_globals *, v)
#else
#define SOCKETS_G(v) (sockets_globals.v)
#endif
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 584d98576f..afd67b3bd4 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -370,6 +370,9 @@ zend_module_entry sockets_module_entry = {
#ifdef COMPILE_DL_SOCKETS
+#ifdef ZTS
+ ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(sockets)
#endif
@@ -600,6 +603,9 @@ char *sockets_strerror(int error TSRMLS_DC) /* {{{ */
/* {{{ PHP_GINIT_FUNCTION */
static PHP_GINIT_FUNCTION(sockets)
{
+#if defined(COMPILE_DL_SOCKETS) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
sockets_globals->last_error = 0;
sockets_globals->strerror_buf = NULL;
}
@@ -609,6 +615,9 @@ static PHP_GINIT_FUNCTION(sockets)
*/
static PHP_MINIT_FUNCTION(sockets)
{
+#if defined(COMPILE_DL_SOCKETS) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
le_socket = zend_register_list_destructors_ex(php_destroy_socket, NULL, le_socket_name, module_number);
REGISTER_LONG_CONSTANT("AF_UNIX", AF_UNIX, CONST_CS | CONST_PERSISTENT);
diff --git a/ext/spl/config.m4 b/ext/spl/config.m4
index a0f0d1a06d..869e542ef4 100755
--- a/ext/spl/config.m4
+++ b/ext/spl/config.m4
@@ -22,6 +22,6 @@ int main(int argc, char **argv) {
CPPFLAGS=$old_CPPFLAGS
AC_DEFINE_UNQUOTED(HAVE_PACKED_OBJECT_VALUE, $ac_result, [Whether struct _zend_object_value is packed])
AC_DEFINE(HAVE_SPL, 1, [Whether you want SPL (Standard PHP Library) support])
- PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c, no)
+ PHP_NEW_EXTENSION(spl, php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/spl], [php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h])
PHP_ADD_EXTENSION_DEP(spl, pcre, true)
diff --git a/ext/spl/config.w32 b/ext/spl/config.w32
index 77cbd20346..56c466c220 100644
--- a/ext/spl/config.w32
+++ b/ext/spl/config.w32
@@ -1,7 +1,7 @@
// $Id$
// vim:ft=javascript
-EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */);
+EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_SPL', 1);
PHP_SPL="yes";
PHP_INSTALL_HEADERS("ext/spl", "php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h");
diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h
index 534a03885e..8db6f09e6d 100644
--- a/ext/spl/php_spl.h
+++ b/ext/spl/php_spl.h
@@ -67,7 +67,7 @@ ZEND_BEGIN_MODULE_GLOBALS(spl)
ZEND_END_MODULE_GLOBALS(spl)
#ifdef ZTS
-# define SPL_G(v) TSRMG(spl_globals_id, zend_spl_globals *, v)
+# define SPL_G(v) ZEND_TSRMG(spl_globals_id, zend_spl_globals *, v)
extern int spl_globals_id;
#else
# define SPL_G(v) (spl_globals.v)
diff --git a/ext/sqlite3/config.w32 b/ext/sqlite3/config.w32
index 8ddb6b9ac8..60dd2fae52 100644
--- a/ext/sqlite3/config.w32
+++ b/ext/sqlite3/config.w32
@@ -5,7 +5,7 @@ ARG_WITH("sqlite3", "SQLite 3 support", "no");
if (PHP_SQLITE3 != "no") {
ADD_FLAG("CFLAGS_SQLITE3", "/D SQLITE_THREADSAFE=" + (PHP_ZTS == "yes" ? "1" : "0") + " /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /D SQLITE_API=__declspec(dllexport) ");
- EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname);
+ EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname + " /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3");
diff --git a/ext/sqlite3/config0.m4 b/ext/sqlite3/config0.m4
index 6959a6f916..bbb1133fe4 100644
--- a/ext/sqlite3/config0.m4
+++ b/ext/sqlite3/config0.m4
@@ -8,7 +8,7 @@ PHP_ARG_WITH(sqlite3, whether to enable the SQLite3 extension,
if test $PHP_SQLITE3 != "no"; then
sqlite3_extra_sources=""
- PHP_SQLITE3_CFLAGS=""
+ PHP_SQLITE3_CFLAGS=" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 "
dnl when running phpize enable_maintainer_zts is not available
if test -z "$enable_maintainer_zts"; then
diff --git a/ext/sqlite3/php_sqlite3.h b/ext/sqlite3/php_sqlite3.h
index 5c7dfcfa5a..8f1c500211 100644
--- a/ext/sqlite3/php_sqlite3.h
+++ b/ext/sqlite3/php_sqlite3.h
@@ -32,6 +32,9 @@ ZEND_END_MODULE_GLOBALS(sqlite3)
#ifdef ZTS
# define SQLITE3G(v) TSRMG(sqlite3_globals_id, zend_sqlite3_globals *, v)
+# ifdef COMPILE_DL_SQLITE3
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define SQLITE3G(v) (sqlite3_globals.v)
#endif
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index af3dec0681..a98b303547 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -2271,6 +2271,9 @@ PHP_MINFO_FUNCTION(sqlite3)
*/
static PHP_GINIT_FUNCTION(sqlite3)
{
+#if defined(COMPILE_DL_SQLITE3) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset(sqlite3_globals, 0, sizeof(*sqlite3_globals));
}
/* }}} */
@@ -2296,6 +2299,9 @@ zend_module_entry sqlite3_module_entry = {
/* }}} */
#ifdef COMPILE_DL_SQLITE3
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(sqlite3)
#endif
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index fa5ccfc12f..9fa5a1178c 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -36,7 +36,7 @@ ZEND_END_MODULE_GLOBALS(assert)
ZEND_DECLARE_MODULE_GLOBALS(assert)
#ifdef ZTS
-#define ASSERTG(v) TSRMG(assert_globals_id, zend_assert_globals *, v)
+#define ASSERTG(v) ZEND_TSRMG(assert_globals_id, zend_assert_globals *, v)
#else
#define ASSERTG(v) (assert_globals.v)
#endif
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 5adc9a9a11..c47ee0fb96 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -235,7 +235,7 @@ typedef struct _php_basic_globals {
} php_basic_globals;
#ifdef ZTS
-#define BG(v) TSRMG(basic_globals_id, php_basic_globals *, v)
+#define BG(v) ZEND_TSRMG(basic_globals_id, php_basic_globals *, v)
PHPAPI extern int basic_globals_id;
#else
#define BG(v) (basic_globals.v)
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index a76fb136a3..2ea837ff60 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -46,7 +46,7 @@ ZEND_END_MODULE_GLOBALS(browscap)
ZEND_DECLARE_MODULE_GLOBALS(browscap)
#ifdef ZTS
-#define BROWSCAP_G(v) TSRMG(browscap_globals_id, zend_browscap_globals *, v)
+#define BROWSCAP_G(v) ZEND_TSRMG(browscap_globals_id, zend_browscap_globals *, v)
#else
#define BROWSCAP_G(v) (browscap_globals.v)
#endif
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index 7a5f0effa0..e2ce61f561 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -605,7 +605,8 @@ PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.
incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
var_unserializer.c ftok.c sha1.c user_filters.c uuencode.c \
- filters.c proc_open.c streamsfuncs.c http.c password.c)
+ filters.c proc_open.c streamsfuncs.c http.c password.c,,,
+ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_MAKEFILE_FRAGMENT
PHP_INSTALL_HEADERS([ext/standard/])
diff --git a/ext/standard/config.w32 b/ext/standard/config.w32
index 5f24641b4d..e8b50efc7e 100644
--- a/ext/standard/config.w32
+++ b/ext/standard/config.w32
@@ -20,7 +20,8 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
user_filters.c uuencode.c filters.c proc_open.c password.c \
- streamsfuncs.c http.c flock_compat.c", false /* never shared */);
+ streamsfuncs.c http.c flock_compat.c", false /* never shared */,
+ '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
PHP_INSTALL_HEADERS("", "ext/standard");
if (PHP_MBREGEX != "no") {
CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma")
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 6a09ce3af5..b13f47be69 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -56,7 +56,7 @@ typedef struct {
} php_dir_globals;
#ifdef ZTS
-#define DIRG(v) TSRMG(dir_globals_id, php_dir_globals *, v)
+#define DIRG(v) ZEND_TSRMG(dir_globals_id, php_dir_globals *, v)
int dir_globals_id;
#else
#define DIRG(v) (dir_globals.v)
diff --git a/ext/standard/file.h b/ext/standard/file.h
index ec60b86e99..78cab4f62f 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -132,7 +132,7 @@ typedef struct {
} php_file_globals;
#ifdef ZTS
-#define FG(v) TSRMG(file_globals_id, php_file_globals *, v)
+#define FG(v) ZEND_TSRMG(file_globals_id, php_file_globals *, v)
extern PHPAPI int file_globals_id;
#else
#define FG(v) (file_globals.v)
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index 31955042eb..dee00e6218 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -131,7 +131,7 @@ ZEND_BEGIN_MODULE_GLOBALS(array)
ZEND_END_MODULE_GLOBALS(array)
#ifdef ZTS
-#define ARRAYG(v) TSRMG(array_globals_id, zend_array_globals *, v)
+#define ARRAYG(v) ZEND_TSRMG(array_globals_id, zend_array_globals *, v)
#else
#define ARRAYG(v) (array_globals.v)
#endif
diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h
index dcc82e9511..81d251c513 100644
--- a/ext/standard/php_lcg.h
+++ b/ext/standard/php_lcg.h
@@ -35,7 +35,7 @@ PHP_FUNCTION(lcg_value);
PHP_MINIT_FUNCTION(lcg);
#ifdef ZTS
-#define LCG(v) TSRMG(lcg_globals_id, php_lcg_globals *, v)
+#define LCG(v) ZEND_TSRMG(lcg_globals_id, php_lcg_globals *, v)
#else
#define LCG(v) (lcg_globals.v)
#endif
diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4
index 102f6a827e..ff27bd1aaa 100644
--- a/ext/tidy/config.m4
+++ b/ext/tidy/config.m4
@@ -38,7 +38,7 @@ if test "$PHP_TIDY" != "no"; then
],[],[])
- PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared)
+ PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(TIDY_SHARED_LIBADD)
AC_DEFINE(HAVE_TIDY,1,[ ])
fi
diff --git a/ext/tidy/config.w32 b/ext/tidy/config.w32
index 41f217588d..a87a833f92 100644
--- a/ext/tidy/config.w32
+++ b/ext/tidy/config.w32
@@ -12,6 +12,7 @@ if (PHP_TIDY != "no") {
)) {
EXTENSION("tidy", "tidy.c");
AC_DEFINE('HAVE_TIDY', 1, 'Have TIDY library');
+ ADD_FLAG('CFLAGS_TIDY', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
if (!PHP_TIDY_SHARED) {
ADD_DEF_FILE("ext\\tidy\\php_tidy.def");
}
diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h
index cd78f37a17..77de84de9c 100644
--- a/ext/tidy/php_tidy.h
+++ b/ext/tidy/php_tidy.h
@@ -40,7 +40,10 @@ ZEND_BEGIN_MODULE_GLOBALS(tidy)
ZEND_END_MODULE_GLOBALS(tidy)
#ifdef ZTS
-#define TG(v) TSRMG(tidy_globals_id, zend_tidy_globals *, v)
+#define TG(v) ZEND_TSRMG(tidy_globals_id, zend_tidy_globals *, v)
+#ifdef COMPILE_DL_TIDY
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define TG(v) (tidy_globals.v)
#endif
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index 23531e9ae3..b809fff6e0 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -467,6 +467,9 @@ zend_module_entry tidy_module_entry = {
};
#ifdef COMPILE_DL_TIDY
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(tidy)
#endif
@@ -1055,6 +1058,10 @@ static PHP_MINIT_FUNCTION(tidy)
static PHP_RINIT_FUNCTION(tidy)
{
+#if defined(COMPILE_DL_TIDY) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
+
php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler") TSRMLS_CC);
return SUCCESS;
diff --git a/ext/xml/config.m4 b/ext/xml/config.m4
index ebfc0471e0..812032bc6a 100644
--- a/ext/xml/config.m4
+++ b/ext/xml/config.m4
@@ -52,7 +52,7 @@ if test "$PHP_XML" != "no"; then
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
fi
- PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared)
+ PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(XML_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/xml/])
AC_DEFINE(HAVE_XML, 1, [ ])
diff --git a/ext/xml/config.w32 b/ext/xml/config.w32
index 4ee0bd1602..20b5c8dfe5 100644
--- a/ext/xml/config.w32
+++ b/ext/xml/config.w32
@@ -6,7 +6,7 @@ ARG_WITH("xml", "XML support", "yes");
if (PHP_XML == "yes") {
if (PHP_LIBXML == "yes"
&& ADD_EXTENSION_DEP('xml', 'libxml')) {
- EXTENSION("xml", "xml.c compat.c");
+ EXTENSION("xml", "xml.c compat.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_XML", 1, "XML support");
if (!PHP_XML_SHARED) {
ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC ");
diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h
index cdb08f812e..d7f0d6d046 100644
--- a/ext/xml/php_xml.h
+++ b/ext/xml/php_xml.h
@@ -142,7 +142,10 @@ PHPAPI zend_string *xml_utf8_encode(const char *, size_t, const XML_Char *);
#define phpext_xml_ptr xml_module_ptr
#ifdef ZTS
-#define XML(v) TSRMG(xml_globals_id, zend_xml_globals *, v)
+#define XML(v) ZEND_TSRMG(xml_globals_id, zend_xml_globals *, v)
+#ifdef COMPILE_DL_XML
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define XML(v) (xml_globals.v)
#endif
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index f1a3442b6d..6959424376 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -62,6 +62,9 @@ ZEND_DECLARE_MODULE_GLOBALS(xml)
/* {{{ dynamically loadable module stuff */
#ifdef COMPILE_DL_XML
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(xml)
#endif /* COMPILE_DL_XML */
/* }}} */
@@ -290,6 +293,9 @@ static int le_xml_parser;
/* {{{ startup, shutdown and info functions */
static PHP_GINIT_FUNCTION(xml)
{
+#if defined(COMPILE_DL_XML) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
xml_globals->default_encoding = (XML_Char*)"UTF-8";
}
diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32
index 000b1ccabb..1a57aa6110 100644
--- a/ext/zlib/config.w32
+++ b/ext/zlib/config.w32
@@ -7,7 +7,7 @@ if (PHP_ZLIB == "yes") {
if (CHECK_LIB("zlib_a.lib;zlib.lib", "zlib", PHP_ZLIB) &&
CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)) {
- EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS");
+ EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support");
if (!PHP_ZLIB_SHARED) {
diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4
index ebf67cc001..ab94c15fe0 100644
--- a/ext/zlib/config0.m4
+++ b/ext/zlib/config0.m4
@@ -9,7 +9,7 @@ PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined,
[ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no)
if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" != "no"; then
- PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared)
+ PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(ZLIB_SHARED_LIBADD)
if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index ba829b5888..e5c2f37016 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -68,7 +68,7 @@ extern zend_module_entry php_zlib_module_entry;
#ifdef ZTS
# include "TSRM.h"
-# define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v)
+# define ZLIBG(v) ZEND_TSRMG(zlib_globals_id, zend_zlib_globals *, v)
#else
# define ZLIBG(v) (zlib_globals.v)
#endif
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index c3548eae53..ffde50ba0b 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -496,7 +496,6 @@ static PHP_FUNCTION(ob_gzhandler)
ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init(TSRMLS_C);
}
- TSRMLS_SET_CTX(ctx.tsrm_ls);
ctx.op = flags;
ctx.in.data = in_str;
ctx.in.used = in_len;
@@ -736,6 +735,9 @@ PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE);
/* }}} */
#ifdef COMPILE_DL_ZLIB
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(php_zlib)
#endif
@@ -1020,6 +1022,9 @@ static PHP_MINFO_FUNCTION(zlib)
/* {{{ ZEND_MODULE_GLOBALS_CTOR */
static PHP_GINIT_FUNCTION(zlib)
{
+#if defined(COMPILE_DL_ZLIB) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
zlib_globals->ob_gzhandler = NULL;
zlib_globals->handler_registered = 0;
}