summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-16 13:47:43 +0200
committerAnatol Belski <ab@php.net>2014-10-16 13:47:43 +0200
commit7f1107de9167ab1443a13491f5b70aa3f10fd323 (patch)
treeb3650174f95295198e6233c17adcbdf61b827329
parent0e7682c63c10e374d76a4f93974f7e64716cf234 (diff)
downloadphp-git-7f1107de9167ab1443a13491f5b70aa3f10fd323.tar.gz
converted ext/ereg, ext/phar and ext/pgsql for static tsrmls usage
-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/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
11 files changed, 28 insertions, 9 deletions
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/pgsql/config.m4 b/ext/pgsql/config.m4
index 186469861f..bd3470eac5 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 207764b165..3645e0a897 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -771,6 +771,9 @@ zend_module_entry pgsql_module_entry = {
/* }}} */
#ifdef COMPILE_DL_PGSQL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(pgsql)
#endif
@@ -1090,6 +1093,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..1ba7ecdef1 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 cdc61fee88..5e0ccb57b3 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
@@ -3335,6 +3338,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 ed5fedd547..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_get_ls_cache()))[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)