Skip to content

Declare XML_SAX_IMPL constant in stubs #9732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2022
Merged
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
6 changes: 6 additions & 0 deletions ext/xml/php_xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,10 @@ enum php_xml_option {
PHP_XML_OPTION_SKIP_WHITE
};

#ifdef LIBXML_EXPAT_COMPAT
#define PHP_XML_SAX_IMPL "libxml"
#else
#define PHP_XML_SAX_IMPL "expat"
#endif

#endif /* PHP_XML_H */
6 changes: 0 additions & 6 deletions ext/xml/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,6 @@ PHP_MINIT_FUNCTION(xml)
php_xml_mem_hdlrs.realloc_fcn = php_xml_realloc_wrapper;
php_xml_mem_hdlrs.free_fcn = php_xml_free_wrapper;

#ifdef LIBXML_EXPAT_COMPAT
REGISTER_STRING_CONSTANT("XML_SAX_IMPL", "libxml", CONST_CS|CONST_PERSISTENT);
#else
REGISTER_STRING_CONSTANT("XML_SAX_IMPL", "expat", CONST_CS|CONST_PERSISTENT);
#endif

return SUCCESS;
}

Expand Down
6 changes: 6 additions & 0 deletions ext/xml/xml.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@
*/
const XML_OPTION_SKIP_WHITE = UNKNOWN;

/**
* @var string
* @cvalue PHP_XML_SAX_IMPL
*/
const XML_SAX_IMPL = UNKNOWN;

function xml_parser_create(?string $encoding = null): XMLParser {}

function xml_parser_create_ns(?string $encoding = null, string $separator = ":"): XMLParser {}
Expand Down
3 changes: 2 additions & 1 deletion ext/xml/xml_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.