summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-17 14:31:17 +0200
committerAnatol Belski <ab@php.net>2014-10-17 14:31:17 +0200
commit5749b4a9979cd3ff85996323bed9adc1bd182f76 (patch)
treeaa14675bcd4d43bd6c7d7ba2dff595cb970b54b0
parentfea10f6a5e5ff4d22adea5fd04476a88d4f76db8 (diff)
downloadphp-git-5749b4a9979cd3ff85996323bed9adc1bd182f76.tar.gz
ext/libxml, ext/xml and ext/soap use static tsrmls pointer
-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/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/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
12 files changed, 36 insertions, 9 deletions
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..74dc6cb252 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 d9e92541e9..b95757a215 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/soap/config.m4 b/ext/soap/config.m4
index 7fa8c6f0ec..eab37970ab 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 6d36792981..bab2ded046 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 2b37622a7a..18397dace3 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/xml/config.m4 b/ext/xml/config.m4
index ebfc0471e0..1019d91a1a 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";
}