diff options
| author | Anatol Belski <ab@php.net> | 2014-10-15 16:33:40 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2014-10-15 16:33:40 +0200 |
| commit | 8aeffdd74c826b5012c9b052848cfa8e593776ed (patch) | |
| tree | f1ba84465211d50075c5e3a14e9d7eaf08bd95be /sapi/apache2handler | |
| parent | 991a04b068c0b49ed5022d8da735002c5187031b (diff) | |
| download | php-git-8aeffdd74c826b5012c9b052848cfa8e593776ed.tar.gz | |
moved most of the core to use static tsrm ls cache pointer
plus apache2handler, cli and cgi
Diffstat (limited to 'sapi/apache2handler')
| -rw-r--r-- | sapi/apache2handler/config.m4 | 2 | ||||
| -rw-r--r-- | sapi/apache2handler/config.w32 | 6 | ||||
| -rw-r--r-- | sapi/apache2handler/php_apache.h | 3 | ||||
| -rw-r--r-- | sapi/apache2handler/sapi_apache2.c | 6 |
4 files changed, 12 insertions, 5 deletions
diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 index 59e17393dd..2e64b215e5 100644 --- a/sapi/apache2handler/config.m4 +++ b/sapi/apache2handler/config.m4 @@ -56,7 +56,7 @@ if test "$PHP_APXS2" != "no"; then esac done - APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS" + APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" # Test that we're trying to configure with apache 2.x PHP_AP_EXTRACT_VERSION($APXS_HTTPD) diff --git a/sapi/apache2handler/config.w32 b/sapi/apache2handler/config.w32 index d15dcfaf03..8ea1305d4f 100644 --- a/sapi/apache2handler/config.w32 +++ b/sapi/apache2handler/config.w32 @@ -13,7 +13,7 @@ if (PHP_APACHE2HANDLER != "no") { ) { SAPI('apache2handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c', 'php' + PHP_VERSION + 'apache2.dll', - '/D PHP_APACHE2_EXPORTS /I win32'); + '/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); } else { WARNING("Could not find apache2 libraries/headers"); } @@ -31,7 +31,7 @@ if (PHP_APACHE2_2HANDLER != "no") { ) { SAPI('apache2_2handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c', 'php' + PHP_VERSION + 'apache2_2.dll', - '/D PHP_APACHE2_EXPORTS /I win32', + '/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1', 'sapi\\apache2_2handler'); } else { WARNING("Could not find apache2.2 libraries/headers"); @@ -49,7 +49,7 @@ if (PHP_APACHE2_4HANDLER != "no") { ) { SAPI('apache2_4handler', 'mod_php7.c sapi_apache2.c apache_config.c php_functions.c', 'php' + PHP_VERSION + 'apache2_4.dll', - '/D PHP_APACHE2_EXPORTS /I win32', + '/D PHP_APACHE2_EXPORTS /I win32 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1', 'sapi\\apache2handler'); } else { WARNING("Could not find apache 2.4 libraries/headers"); diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h index f6f4f7a7c9..da20072b14 100644 --- a/sapi/apache2handler/php_apache.h +++ b/sapi/apache2handler/php_apache.h @@ -79,7 +79,8 @@ extern zend_module_entry apache2_module_entry; #ifdef ZTS extern int php_apache2_info_id; -#define AP2(v) TSRMG(php_apache2_info_id, php_apache2_info_struct *, v) +#define AP2(v) ZEND_TSRMG(php_apache2_info_id, php_apache2_info_struct *, v) +ZEND_TSRMLS_CACHE_EXTERN; #else extern php_apache2_info_struct php_apache2_info; #define AP2(v) (php_apache2_info.v) diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 6b0ab4876d..1234f91051 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -71,6 +71,9 @@ /* A way to specify the location of the php.ini dir in an apache directive */ char *apache2_php_ini_path_override = NULL; +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif static size_t php_apache_sapi_ub_write(const char *str, size_t str_length TSRMLS_DC) @@ -451,6 +454,8 @@ php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp } #ifdef ZTS tsrm_startup(1, 1, 0, NULL); + (void)ts_resource(0); + ZEND_TSRMLS_CACHE_UPDATE; #endif sapi_startup(&apache2_sapi_module); apache2_sapi_module.startup(&apache2_sapi_module); @@ -543,6 +548,7 @@ static int php_handler(request_rec *r) #ifdef ZTS /* initial resource fetch */ void ***tsrm_ls = ts_resource(0); + ZEND_TSRMLS_CACHE_UPDATE; #endif #define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC); |
