Skip to content

Commit 8be3426

Browse files
authored
Add missing ext/libxml dependency to ext/xmlwriter (#14327)
This adds the libxml extension to required dependencies for xmlwriter during the configuration phase (PHP_ADD_EXTENSION_DEP) and the runtime (ZEND_MOD_REQUIRED). The libxml is technically not a required extension in this case but it necessary to make it work properly (i.e. have proper error reporting, etc.). Added due to prior libxml requirement in documentation and build system.
1 parent 36a58b3 commit 8be3426

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

ext/xmlwriter/config.m4

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ PHP_ARG_ENABLE([xmlwriter],
55
[yes])
66

77
if test "$PHP_XMLWRITER" != "no"; then
8-
9-
if test "$PHP_LIBXML" = "no"; then
10-
AC_MSG_ERROR([XMLWriter extension requires LIBXML extension, add --with-libxml])
11-
fi
12-
138
PHP_SETUP_LIBXML(XMLWRITER_SHARED_LIBADD, [
149
AC_DEFINE(HAVE_XMLWRITER,1,[ ])
1510
PHP_NEW_EXTENSION(xmlwriter, php_xmlwriter.c, $ext_shared)
11+
PHP_ADD_EXTENSION_DEP(xmlwriter, libxml)
1612
PHP_SUBST(XMLWRITER_SHARED_LIBADD)
1713
])
1814
fi

ext/xmlwriter/php_xmlwriter.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,15 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
175175
}
176176
/* }}} */
177177

178+
static const zend_module_dep xmlwriter_deps[] = {
179+
ZEND_MOD_REQUIRED("libxml")
180+
ZEND_MOD_END
181+
};
182+
178183
/* {{{ xmlwriter_module_entry */
179184
zend_module_entry xmlwriter_module_entry = {
180-
STANDARD_MODULE_HEADER,
185+
STANDARD_MODULE_HEADER_EX, NULL,
186+
xmlwriter_deps,
181187
"xmlwriter",
182188
ext_functions,
183189
PHP_MINIT(xmlwriter),

0 commit comments

Comments
 (0)