Patch for libxml 2.12 support for PHP 5.6 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -27,6 +27,7 @@ #if HAVE_LIBXML && HAVE_DOM #include "php_dom.h" #include +#include #ifdef LIBXML_SCHEMAS_ENABLED #include #include --- a/ext/libxml/php_libxml.h +++ b/ext/libxml/php_libxml.h @@ -36,6 +36,7 @@ extern zend_module_entry libxml_module_entry; #include "ext/standard/php_smart_str.h" #include +#include #define LIBXML_SAVE_NOEMPTYTAG 1<<2 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -470,7 +470,11 @@ return 1; } -static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg) +#if LIBXML_VERSION >= 21200 +static void _php_list_set_error_structure(const xmlError *error, const char *msg) +#else +static void _php_list_set_error_structure(xmlError *error, const char *msg) +#endif { xmlError error_copy; int ret; @@ -728,7 +732,11 @@ va_end(args); } +#if LIBXML_VERSION >= 21200 +PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, const xmlError *error) +#else PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error) +#endif { _php_list_set_error_structure(error, NULL); @@ -1001,9 +1009,7 @@ Retrieve last error from libxml */ static PHP_FUNCTION(libxml_get_last_error) { - xmlErrorPtr error; - - error = xmlGetLastError(); + const xmlError *error = xmlGetLastError(); if (error) { object_init_ex(return_value, libxmlerror_class_entry); --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -334,7 +334,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include) sdl_restore_uri_credentials(ctx TSRMLS_CC); if (!wsdl) { - xmlErrorPtr xmlErrorPtr = xmlGetLastError(); + const xmlError *xmlErrorPtr = xmlGetLastError(); if (xmlErrorPtr) { soap_error2(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message);