Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ext/tokenizer/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ PHP_ARG_ENABLE([tokenizer],
[yes])

if test "$PHP_TOKENIZER" != "no"; then
PHP_NEW_EXTENSION([tokenizer], [tokenizer.c tokenizer_data.c], [$ext_shared])
PHP_NEW_EXTENSION([tokenizer], [tokenizer.c tokenizer_data.c], [$ext_shared],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
PHP_ADD_MAKEFILE_FRAGMENT
fi
2 changes: 1 addition & 1 deletion ext/tokenizer/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
ARG_ENABLE("tokenizer", "tokenizer support", "yes");

if (PHP_TOKENIZER == "yes") {
EXTENSION("tokenizer", "tokenizer.c tokenizer_data.c");
EXTENSION("tokenizer", "tokenizer.c tokenizer_data.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
}
1 change: 1 addition & 0 deletions ext/tokenizer/php_tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ char *get_token_type_name(int token_type);


PHP_MINIT_FUNCTION(tokenizer);
PHP_RINIT_FUNCTION(tokenizer);
PHP_MINFO_FUNCTION(tokenizer);

#endif /* PHP_TOKENIZER_H */
16 changes: 15 additions & 1 deletion ext/tokenizer/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ zend_module_entry tokenizer_module_entry = {
ext_functions,
PHP_MINIT(tokenizer),
NULL,
NULL,
PHP_RINIT(tokenizer),
NULL,
PHP_MINFO(tokenizer),
PHP_TOKENIZER_VERSION,
Expand All @@ -53,6 +53,9 @@ zend_module_entry tokenizer_module_entry = {
/* }}} */

#ifdef COMPILE_DL_TOKENIZER
#ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE()
#endif
ZEND_GET_MODULE(tokenizer)
#endif

Expand Down Expand Up @@ -252,6 +255,17 @@ PHP_MINIT_FUNCTION(tokenizer)
}
/* }}} */

/* {{{ PHP_RINIT_FUNCTION */

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arnaud said we can leave these out for new functions, but I stayed consistent with the rest of the file for now.

PHP_RINIT_FUNCTION(tokenizer)
{
#if defined(ZTS) && defined(COMPILE_DL_TOKENIZER)
ZEND_TSRMLS_CACHE_UPDATE();
#endif

return SUCCESS;
}
/* }}} */

/* {{{ PHP_MINFO_FUNCTION */
PHP_MINFO_FUNCTION(tokenizer)
{
Expand Down
Loading