Skip to content

Commit fc11a8a

Browse files
authored
Declare XML_SAX_IMPL constant in stubs (php#9732)
1 parent fd3d311 commit fc11a8a

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

ext/xml/php_xml.h

+6
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,10 @@ enum php_xml_option {
4646
PHP_XML_OPTION_SKIP_WHITE
4747
};
4848

49+
#ifdef LIBXML_EXPAT_COMPAT
50+
#define PHP_XML_SAX_IMPL "libxml"
51+
#else
52+
#define PHP_XML_SAX_IMPL "expat"
53+
#endif
54+
4955
#endif /* PHP_XML_H */

ext/xml/xml.c

-6
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,6 @@ PHP_MINIT_FUNCTION(xml)
264264
php_xml_mem_hdlrs.realloc_fcn = php_xml_realloc_wrapper;
265265
php_xml_mem_hdlrs.free_fcn = php_xml_free_wrapper;
266266

267-
#ifdef LIBXML_EXPAT_COMPAT
268-
REGISTER_STRING_CONSTANT("XML_SAX_IMPL", "libxml", CONST_CS|CONST_PERSISTENT);
269-
#else
270-
REGISTER_STRING_CONSTANT("XML_SAX_IMPL", "expat", CONST_CS|CONST_PERSISTENT);
271-
#endif
272-
273267
return SUCCESS;
274268
}
275269

ext/xml/xml.stub.php

+6
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@
134134
*/
135135
const XML_OPTION_SKIP_WHITE = UNKNOWN;
136136

137+
/**
138+
* @var string
139+
* @cvalue PHP_XML_SAX_IMPL
140+
*/
141+
const XML_SAX_IMPL = UNKNOWN;
142+
137143
function xml_parser_create(?string $encoding = null): XMLParser {}
138144

139145
function xml_parser_create_ns(?string $encoding = null, string $separator = ":"): XMLParser {}

ext/xml/xml_arginfo.h

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)