Released Oct 2009, part of RHEL 6.
- Intl:
. The Intl extension now requires at least ICU 50.1.
+- Libxml:
+ . All libxml based extensions now require libxml 2.7.6 or newer.
+
- Reflection:
. Numeric value of class, property, function and constant modifiers was
changed. Don't filter methods and properties through
set $libxml_full_version
IFS=$ac_IFS
LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
- if test "$LIBXML_VERSION" -ge "2006011"; then
+ if test "$LIBXML_VERSION" -ge "2007006"; then
found_libxml=yes
LIBXML_LIBS=`$XML2_CONFIG --libs`
LIBXML_INCS=`$XML2_CONFIG --cflags`
else
- AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.])
+ AC_MSG_ERROR([libxml2 version 2.7.6 or greater required.])
fi
fi
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
-#if LIBXML_VERSION < 20627
-/* Implement logic from libxml xmlTextConcat to add support for comments and PI */
- if ((nodep->content == (xmlChar *) &(nodep->properties)) ||
- ((nodep->doc != NULL) && (nodep->doc->dict != NULL) &&
- xmlDictOwns(nodep->doc->dict, nodep->content))) {
- nodep->content = xmlStrncatNew(nodep->content, arg, arg_len);
- } else {
- nodep->content = xmlStrncat(nodep->content, arg, arg_len);
- }
- nodep->properties = NULL;
-#else
xmlTextConcat(nodep, (xmlChar *) arg, arg_len);
-#endif
RETURN_TRUE;
}
/* }}} end dom_characterdata_append_data */
RETURN_FALSE;
}
-#if LIBXML_VERSION >= 20614
if (flags & XML_SCHEMA_VAL_VC_I_CREATE) {
valid_opts |= XML_SCHEMA_VAL_VC_I_CREATE;
}
-#endif
xmlSchemaSetValidOptions(vptr, valid_opts);
xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr);
xmlBufferFree(buf);
} else {
int size = 0;
-#if LIBXML_VERSION >= 20623
htmlDocDumpMemoryFormat(docp, &mem, &size, format);
-#else
- htmlDocDumpMemory(docp, &mem, &size);
-#endif
if (!size || !mem) {
RETVAL_FALSE;
} else {
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
-<?php if (LIBXML_VERSION < 20701) die("skip: libxml2 2.7.1+ required"); ?>
--ENV--
XML_FILE=/not_well_formed4.xml
LOAD_OPTIONS=0
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
-<?php if (LIBXML_VERSION < 20701) die("skip: libxml2 2.7.1+ required"); ?>
--ENV--
XML_FILE=/not_well_formed4.xml
LOAD_OPTIONS=0
REGISTER_LONG_CONSTANT("LIBXML_NOCDATA", XML_PARSE_NOCDATA, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("LIBXML_NONET", XML_PARSE_NONET, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("LIBXML_PEDANTIC", XML_PARSE_PEDANTIC, CONST_CS | CONST_PERSISTENT);
-#if LIBXML_VERSION >= 20621
REGISTER_LONG_CONSTANT("LIBXML_COMPACT", XML_PARSE_COMPACT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("LIBXML_NOXMLDECL", XML_SAVE_NO_DECL, CONST_CS | CONST_PERSISTENT);
-#endif
-#if LIBXML_VERSION >= 20703
REGISTER_LONG_CONSTANT("LIBXML_PARSEHUGE", XML_PARSE_HUGE, CONST_CS | CONST_PERSISTENT);
-#endif
#if LIBXML_VERSION >= 20900
REGISTER_LONG_CONSTANT("LIBXML_BIGLINES", XML_PARSE_BIG_LINES, CONST_CS | CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("LIBXML_NOEMPTYTAG", LIBXML_SAVE_NOEMPTYTAG, CONST_CS | CONST_PERSISTENT);
/* Schema validation options */
-#if defined(LIBXML_SCHEMAS_ENABLED) && LIBXML_VERSION >= 20614
+#if defined(LIBXML_SCHEMAS_ENABLED)
REGISTER_LONG_CONSTANT("LIBXML_SCHEMA_CREATE", XML_SCHEMA_VAL_VC_I_CREATE, CONST_CS | CONST_PERSISTENT);
#endif
ctxt->sax->warning = NULL;
ctxt->sax->error = NULL;
/*ctxt->sax->fatalError = NULL;*/
-#if LIBXML_VERSION >= 20703
ctxt->options |= XML_PARSE_HUGE;
-#endif
old = php_libxml_disable_entity_loader(1);
xmlParseDocument(ctxt);
php_libxml_disable_entity_loader(old);
ctxt->sax->warning = NULL;
ctxt->sax->error = NULL;
/*ctxt->sax->fatalError = NULL;*/
-#if LIBXML_VERSION >= 20703
ctxt->options |= XML_PARSE_HUGE;
-#endif
old = php_libxml_disable_entity_loader(1);
xmlParseDocument(ctxt);
php_libxml_disable_entity_loader(old);
efree(parser);
return NULL;
}
-#if LIBXML_VERSION <= 20617
- /* for older versions of libxml2, allow correct detection of
- * charset in documents with a BOM: */
- parser->parser->charset = XML_CHAR_ENCODING_NONE;
-#endif
-#if LIBXML_VERSION >= 20703
xmlCtxtUseOptions(parser->parser, XML_PARSE_OLDSAX);
-#endif
parser->parser->replaceEntities = 1;
parser->parser->wellFormed = 0;
{
int error;
-/* The following is a hack to keep BC with PHP 4 while avoiding
-the inifite loop in libxml <= 2.6.17 which occurs when no encoding
-has been defined and none can be detected */
-#if LIBXML_VERSION <= 20617
- if (parser->parser->charset == XML_CHAR_ENCODING_NONE) {
- if (data_len >= 4 || (parser->parser->input->buf->buffer->use + data_len >= 4)) {
- xmlChar start[4];
- int char_count;
-
- char_count = parser->parser->input->buf->buffer->use;
- if (char_count > 4) {
- char_count = 4;
- }
-
- memcpy(start, parser->parser->input->buf->buffer->content, (size_t)char_count);
- memcpy(start + char_count, data, (size_t)(4 - char_count));
-
- if (xmlDetectCharEncoding(&start[0], 4) == XML_CHAR_ENCODING_NONE) {
- parser->parser->charset = XML_CHAR_ENCODING_UTF8;
- }
- }
- }
-#endif
-
if (parser->parser->lastError.level >= XML_ERR_WARNING) {
return 0;
}
pefree(Z_PTR_P(el), 1);
} /* }}} */
-#if LIBXML_VERSION >= 20620
/* {{{ php_xmlreader_no_arg_string */
static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_char_t internal_function) {
zval *id;
}
}
/* }}} */
-#endif
/* {{{ php_xmlreader_set_relaxng_schema */
static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int type) {
id = getThis();
intern = Z_XMLREADER_P(id);
if (intern != NULL && intern->ptr != NULL) {
-#if LIBXML_VERSION <= 20617
- /* Bug in libxml prevents a next in certain cases when positioned on end of element */
- if (xmlTextReaderNodeType(intern->ptr) == XML_READER_TYPE_END_ELEMENT) {
- retval = xmlTextReaderRead(intern->ptr);
- } else
-#endif
retval = xmlTextReaderNext(intern->ptr);
while (name != NULL && retval == 1) {
if (xmlStrEqual(xmlTextReaderConstLocalName(intern->ptr), (xmlChar *)name)) {
}
*/
-#if LIBXML_VERSION >= 20620
/* {{{ proto string XMLReader::readInnerXml()
Reads the contents of the current node, including child nodes and markup. */
PHP_METHOD(xmlreader, readInnerXml)
#endif
}
/* }}} */
-#endif
/* {{{ proto bool XMLReader::setParserProperty(int property, bool value)
Sets parser property (one of the parser option constants).
reader = xmlNewTextReader(inputbfr, uri);
if (reader != NULL) {
-#if LIBXML_VERSION >= 20628
ret = xmlTextReaderSetup(reader, NULL, uri, encoding, options);
-#endif
if (ret == 0) {
if (id == NULL) {
object_init_ex(return_value, xmlreader_class_entry);
PHP_ME(xmlreader, open, arginfo_xmlreader_open, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
PHP_ME(xmlreader, read, arginfo_xmlreader_read, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, next, arginfo_xmlreader_next, ZEND_ACC_PUBLIC)
-#if LIBXML_VERSION >= 20620
PHP_ME(xmlreader, readInnerXml, arginfo_xmlreader_readInnerXml, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, readOuterXml, arginfo_xmlreader_readOuterXml, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, readString, arginfo_xmlreader_readString, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, setSchema, arginfo_xmlreader_setSchema, ZEND_ACC_PUBLIC)
-#endif
/* Not Yet Implemented though defined in libxml as of 2.6.9dev
PHP_ME(xmlreader, resetState, NULL, ZEND_ACC_PUBLIC)
*/
--TEST--
Bug #42139 (XMLReader option constants are broken using XML())
--SKIPIF--
-<?php if (!extension_loaded("xmlreader")) print "skip";
-if (LIBXML_VERSION < 20628) die("skip: libxml2 2.6.28+ required");
-?>
+<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
--FILE--
<?php
static PHP_FUNCTION(xmlwriter_start_attribute);
static PHP_FUNCTION(xmlwriter_end_attribute);
static PHP_FUNCTION(xmlwriter_write_attribute);
-#if LIBXML_VERSION > 20617
static PHP_FUNCTION(xmlwriter_start_attribute_ns);
static PHP_FUNCTION(xmlwriter_write_attribute_ns);
-#endif
static PHP_FUNCTION(xmlwriter_start_element);
static PHP_FUNCTION(xmlwriter_end_element);
static PHP_FUNCTION(xmlwriter_full_end_element);
PHP_FE(xmlwriter_start_attribute, arginfo_xmlwriter_start_attribute)
PHP_FE(xmlwriter_end_attribute, arginfo_xmlwriter_resource)
PHP_FE(xmlwriter_write_attribute, arginfo_xmlwriter_write_attribute)
-#if LIBXML_VERSION > 20617
PHP_FE(xmlwriter_start_attribute_ns,arginfo_xmlwriter_start_attribute_ns)
PHP_FE(xmlwriter_write_attribute_ns,arginfo_xmlwriter_write_attribute_ns)
-#endif
PHP_FE(xmlwriter_start_element, arginfo_xmlwriter_start_element)
PHP_FE(xmlwriter_end_element, arginfo_xmlwriter_resource)
PHP_FE(xmlwriter_full_end_element, arginfo_xmlwriter_resource)
PHP_ME_MAPPING(startAttribute, xmlwriter_start_attribute, arginfo_xmlwriter_method_start_attribute, 0)
PHP_ME_MAPPING(endAttribute, xmlwriter_end_attribute, arginfo_xmlwriter_void, 0)
PHP_ME_MAPPING(writeAttribute, xmlwriter_write_attribute, arginfo_xmlwriter_method_write_attribute, 0)
-#if LIBXML_VERSION > 20617
PHP_ME_MAPPING(startAttributeNs, xmlwriter_start_attribute_ns,arginfo_xmlwriter_method_start_attribute_ns, 0)
PHP_ME_MAPPING(writeAttributeNs, xmlwriter_write_attribute_ns,arginfo_xmlwriter_method_write_attribute_ns, 0)
-#endif
PHP_ME_MAPPING(startElement, xmlwriter_start_element, arginfo_xmlwriter_method_start_element, 0)
PHP_ME_MAPPING(endElement, xmlwriter_end_element, arginfo_xmlwriter_void, 0)
PHP_ME_MAPPING(fullEndElement, xmlwriter_full_end_element, arginfo_xmlwriter_void, 0)
}
/* }}} */
-#if LIBXML_VERSION > 20617
/* {{{ proto bool xmlwriter_start_attribute_ns(resource xmlwriter, string prefix, string name, string uri)
Create start namespaced attribute - returns FALSE on error */
static PHP_FUNCTION(xmlwriter_start_attribute_ns)
RETURN_FALSE;
}
/* }}} */
-#endif
/* {{{ proto bool xmlwriter_write_attribute(resource xmlwriter, string name, string content)
Write full attribute - returns FALSE on error */
}
/* }}} */
-#if LIBXML_VERSION > 20617
/* {{{ proto bool xmlwriter_write_attribute_ns(resource xmlwriter, string prefix, string name, string uri, string content)
Write full namespaced attribute - returns FALSE on error */
static PHP_FUNCTION(xmlwriter_write_attribute_ns)
RETURN_FALSE;
}
/* }}} */
-#endif
/* {{{ proto bool xmlwriter_start_element(resource xmlwriter, string name)
Create start element tag - returns FALSE on error */
--SKIPIF--
<?php
if (!extension_loaded("xmlwriter")) die("skip");
-if (LIBXML_VERSION < 20629) die("skip: libxml2 2.6.29+ required");
?>
--FILE--
<?php
--SKIPIF--
<?php
if (!extension_loaded("xmlwriter")) die("skip");
-if (LIBXML_VERSION < 20701) die("skip: libxml2 2.7.1+ required");
?>
--FILE--
<?php
--SKIPIF--
<?php
if (!extension_loaded("xmlwriter")) die("skip");
-if (LIBXML_VERSION < 20701) die("skip: libxml2 2.7.1+ required");
?>
--FILE--
<?php
--SKIPIF--
<?php
if (!extension_loaded("xmlwriter")) die("skip");
-if (LIBXML_VERSION < 20629) die("skip: libxml2 2.6.29+ required");
?>
--FILE--
<?php
--SKIPIF--
<?php
if (!extension_loaded("xmlwriter")) die("skip");
-if (LIBXML_VERSION < 20701) die("skip: libxml2 2.7.1+ required");
?>
--FILE--
<?php
--SKIPIF--
<?php
if (!extension_loaded("xmlwriter")) die("skip");
-if (LIBXML_VERSION < 20701) die("skip: libxml2 2.7.1+ required");
?>
--FILE--
<?php