summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2012-08-09 14:02:33 -0400
committerRob Richards <rrichards@php.net>2012-08-09 14:02:33 -0400
commitc4b26cc1b0b0521c75e653fffec2a9e3b4bf8cbb (patch)
treeebc299e5dc089d08be5a1a6a85451bf3cbd8d712
parented793b2a3f857fd49c0c1b036062140da5b3e674 (diff)
downloadphp-git-c4b26cc1b0b0521c75e653fffec2a9e3b4bf8cbb.tar.gz
Update to work with libxml 2.9.0
-rw-r--r--ext/dom/documenttype.c4
-rw-r--r--ext/dom/node.c8
-rw-r--r--ext/simplexml/simplexml.c4
3 files changed, 16 insertions, 0 deletions
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index d61ba796ab..eee3b5f887 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -205,7 +205,11 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
xmlOutputBufferFlush(buff);
+#ifdef LIBXML2_NEW_BUFFER
+ ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
+#else
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
+#endif
(void)xmlOutputBufferClose(buff);
return SUCCESS;
}
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 5bcb234762..727d1bcef3 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
RETVAL_FALSE;
} else {
if (mode == 0) {
+#ifdef LIBXML2_NEW_BUFFER
+ ret = xmlOutputBufferGetSize(buf);
+#else
ret = buf->buffer->use;
+#endif
if (ret > 0) {
+#ifdef LIBXML2_NEW_BUFFER
+ RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);
+#else
RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);
+#endif
} else {
RETVAL_EMPTY_STRING();
}
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index a379111021..236859686f 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1387,7 +1387,11 @@ SXE_METHOD(asXML)
xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding);
xmlOutputBufferFlush(outbuf);
+#ifdef LIBXML2_NEW_BUFFER
+ RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf), xmlOutputBufferGetSize(outbuf), 1);
+#else
RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1);
+#endif
xmlOutputBufferClose(outbuf);
}
} else {