Skip to content

Commit c56bd7e

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Cleanup unused module globals
2 parents 403033d + 5aa1176 commit c56bd7e

File tree

10 files changed

+1
-104
lines changed

10 files changed

+1
-104
lines changed

ext/enchant/php_enchant.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,4 @@ PHP_FUNCTION(enchant_dict_get_error);
6161
PHP_FUNCTION(enchant_dict_describe);
6262
PHP_FUNCTION(enchant_dict_quick_check);
6363

64-
#ifdef ZTS
65-
#define ENCHANT_G(v) TSRMG(enchant_globals_id, zend_enchant_globals *, v)
66-
#else
67-
#define ENCHANT_G(v) (enchant_globals.v)
68-
#endif
69-
7064
#endif /* PHP_ENCHANT_H */

ext/fileinfo/php_fileinfo.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,4 @@ PHP_FUNCTION(finfo_file);
4343
PHP_FUNCTION(finfo_buffer);
4444
PHP_FUNCTION(mime_content_type);
4545

46-
#ifdef ZTS
47-
#define FILEINFO_G(v) TSRMG(fileinfo_globals_id, zend_fileinfo_globals *, v)
48-
#else
49-
#define FILEINFO_G(v) (fileinfo_globals.v)
50-
#endif
51-
5246
#endif /* PHP_FILEINFO_H */

ext/pdo/pdo.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce;
3737
/* for exceptional circumstances */
3838
zend_class_entry *pdo_exception_ce;
3939

40-
ZEND_DECLARE_MODULE_GLOBALS(pdo)
41-
static PHP_GINIT_FUNCTION(pdo);
42-
4340
/* True global resources - no need for thread safety here */
4441

4542
/* the registry of PDO drivers */
@@ -132,11 +129,7 @@ zend_module_entry pdo_module_entry = {
132129
NULL,
133130
PHP_MINFO(pdo),
134131
PHP_PDO_VERSION,
135-
PHP_MODULE_GLOBALS(pdo),
136-
PHP_GINIT(pdo),
137-
NULL,
138-
NULL,
139-
STANDARD_MODULE_PROPERTIES_EX
132+
STANDARD_MODULE_PROPERTIES
140133
};
141134
/* }}} */
142135

@@ -147,13 +140,6 @@ zend_module_entry pdo_module_entry = {
147140
ZEND_GET_MODULE(pdo)
148141
#endif
149142

150-
/* {{{ PHP_GINIT_FUNCTION */
151-
static PHP_GINIT_FUNCTION(pdo)
152-
{
153-
pdo_globals->global_value = 0;
154-
}
155-
/* }}} */
156-
157143
PDO_API int php_pdo_register_driver(const pdo_driver_t *driver) /* {{{ */
158144
{
159145
if (driver->api_version != PDO_DRIVER_API) {

ext/pdo/php_pdo.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,6 @@ PHP_MINIT_FUNCTION(pdo);
4949
PHP_MSHUTDOWN_FUNCTION(pdo);
5050
PHP_MINFO_FUNCTION(pdo);
5151

52-
ZEND_BEGIN_MODULE_GLOBALS(pdo)
53-
zend_long global_value;
54-
ZEND_END_MODULE_GLOBALS(pdo)
55-
56-
#ifdef ZTS
57-
# define PDOG(v) TSRMG(pdo_globals_id, zend_pdo_globals *, v)
58-
#else
59-
# define PDOG(v) (pdo_globals.v)
60-
#endif
61-
6252
#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \
6353
zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (zend_long)value);
6454

ext/pdo_odbc/php_pdo_odbc.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,4 @@ PHP_RINIT_FUNCTION(pdo_odbc);
3535
PHP_RSHUTDOWN_FUNCTION(pdo_odbc);
3636
PHP_MINFO_FUNCTION(pdo_odbc);
3737

38-
/*
39-
Declare any global variables you may need between the BEGIN
40-
and END macros here:
41-
42-
ZEND_BEGIN_MODULE_GLOBALS(pdo_odbc)
43-
long global_value;
44-
char *global_string;
45-
ZEND_END_MODULE_GLOBALS(pdo_odbc)
46-
*/
47-
48-
#ifdef ZTS
49-
#define PDO_ODBC_G(v) TSRMG(pdo_odbc_globals_id, zend_pdo_odbc_globals *, v)
50-
#else
51-
#define PDO_ODBC_G(v) (pdo_odbc_globals.v)
52-
#endif
53-
5438
#endif /* PHP_PDO_ODBC_H */

ext/pdo_sqlite/php_pdo_sqlite.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,4 @@ PHP_RINIT_FUNCTION(pdo_sqlite);
3535
PHP_RSHUTDOWN_FUNCTION(pdo_sqlite);
3636
PHP_MINFO_FUNCTION(pdo_sqlite);
3737

38-
/*
39-
Declare any global variables you may need between the BEGIN
40-
and END macros here:
41-
42-
ZEND_BEGIN_MODULE_GLOBALS(pdo_sqlite)
43-
long global_value;
44-
char *global_string;
45-
ZEND_END_MODULE_GLOBALS(pdo_sqlite)
46-
*/
47-
48-
#ifdef ZTS
49-
#define PDO_SQLITE_G(v) TSRMG(pdo_sqlite_globals_id, zend_pdo_sqlite_globals *, v)
50-
#else
51-
#define PDO_SQLITE_G(v) (pdo_sqlite_globals.v)
52-
#endif
53-
5438
#endif /* PHP_PDO_SQLITE_H */

ext/simplexml/php_simplexml.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ typedef struct {
6969
zend_object zo;
7070
} php_sxe_object;
7171

72-
#ifdef ZTS
73-
#define SIMPLEXML_G(v) TSRMG(simplexml_globals_id, zend_simplexml_globals *, v)
74-
#else
75-
#define SIMPLEXML_G(v) (simplexml_globals.v)
76-
#endif
77-
7872
#ifdef PHP_WIN32
7973
# ifdef PHP_SIMPLEXML_EXPORTS
8074
# define PHP_SXE_API __declspec(dllexport)

ext/tokenizer/php_tokenizer.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,4 @@ PHP_MINFO_FUNCTION(tokenizer);
3939
PHP_FUNCTION(token_get_all);
4040
PHP_FUNCTION(token_name);
4141

42-
#ifdef ZTS
43-
#define TOKENIZER_G(v) TSRMG(tokenizer_globals_id, zend_tokenizer_globals *, v)
44-
#else
45-
#define TOKENIZER_G(v) (tokenizer_globals.v)
46-
#endif
47-
4842
#endif /* PHP_TOKENIZER_H */

ext/xmlreader/php_xmlreader.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,4 @@ PHP_MINFO_FUNCTION(xmlreader);
6262
#define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \
6363
zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (zend_long)value);
6464

65-
#ifdef ZTS
66-
#define XMLREADER_G(v) TSRMG(xmlreader_globals_id, zend_xmlreader_globals *, v)
67-
#else
68-
#define XMLREADER_G(v) (xmlreader_globals.v)
69-
#endif
70-
7165
#endif /* PHP_XMLREADER_H */

ext/xsl/php_xsl.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,4 @@ PHP_RINIT_FUNCTION(xsl);
102102
PHP_RSHUTDOWN_FUNCTION(xsl);
103103
PHP_MINFO_FUNCTION(xsl);
104104

105-
106-
/*
107-
Declare any global variables you may need between the BEGIN
108-
and END macros here:
109-
110-
ZEND_BEGIN_MODULE_GLOBALS(xsl)
111-
long global_value;
112-
char *global_string;
113-
ZEND_END_MODULE_GLOBALS(xsl)
114-
*/
115-
116-
#ifdef ZTS
117-
#define XSL_G(v) TSRMG(xsl_globals_id, zend_xsl_globals *, v)
118-
#else
119-
#define XSL_G(v) (xsl_globals.v)
120-
#endif
121-
122105
#endif /* PHP_XSL_H */

0 commit comments

Comments
 (0)