php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65968 Missing libxml option constants
Submitted: 2013-10-25 20:36 UTC Modified: 2013-10-25 23:02 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: ruud at vanmelick dot com Assigned:
Status: Open Package: *XML functions
PHP Version: 5.5.5 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ruud at vanmelick dot com
New email:
PHP Version: OS:

 

 [2013-10-25 20:36 UTC] ruud at vanmelick dot com
Description:
------------
From manual page: http://www.php.net/libxml.constants

Looking at the libxml2 source file /include/libxml/parser.h, there seem to be some libxml constants missing in the documentation and in PHP itself as well
 
LIBXML_RECOVER = 1<<0 = 1 : Recover on errors
LIBXML_PEDANTIC = 1<<7 = 128 : Pedantic error reporting
LIBXML_SAX1 = 1<<9 = 512 : Use the SAX1 interface internally
LIBXML_NODICT = 1<<12 = 4096 : Do not reuse the context dictionnary
LIBXML_NOXINCNODE = 1<<15 = 32768 : Do not generate XINCLUDE START/END nodes
LIBXML_OLD10 = 1<<17 = 131072 : Parse using XML-1.0 before update 5
LIBXML_NOBASEFIX = 1<<18 = 262144 : Do not fixup XINCLUDE xml:base uris
LIBXML_OLDSAX = 1<<20 = 1048576 : Parse using SAX2 interface before 2.7.0 (libxml >= 2.7.3)
LIBXML_IGNORE_ENC = 1<<21 = 2097152 : Ignore internal document encoding hint (libxml >= 2.8.0)
LIBXML_BIG_LINES = 1<<22 = 4194304 : Enable support for big line numbers in error reporting (libxml >= 2.9)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-25 23:02 UTC] ruud at vanmelick dot com
-PHP Version: Irrelevant +PHP Version: 5.5.5
 [2013-10-25 23:02 UTC] ruud at vanmelick dot com
I tried adding a patch, but got an error message (Cannot create patch storage for Bug ...), so I'll include it inline:

--- libxml.c.orig	2013-10-15 15:49:47.000000000 +0200
+++ libxml.c	2013-10-26 00:52:34.251111883 +0200
@@ -778,24 +778,37 @@
 	REGISTER_STRING_CONSTANT("LIBXML_LOADED_VERSION",	(char *)xmlParserVersion,		CONST_CS | CONST_PERSISTENT);
 
 	/* For use with loading xml */
+	REGISTER_LONG_CONSTANT("LIBXML_RECOVER",	XML_PARSE_RECOVER,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_NOENT",		XML_PARSE_NOENT,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_DTDLOAD",	XML_PARSE_DTDLOAD,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_DTDATTR",	XML_PARSE_DTDATTR,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_DTDVALID",	XML_PARSE_DTDVALID,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_NOERROR",	XML_PARSE_NOERROR,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_NOWARNING",	XML_PARSE_NOWARNING,	CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("LIBXML_PEDANTIC",	XML_PARSE_PEDANTIC,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_NOBLANKS",	XML_PARSE_NOBLANKS,		CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("LIBXML_SAX1",		XML_PARSE_SAX1,			CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_XINCLUDE",	XML_PARSE_XINCLUDE,		CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("LIBXML_NONET",		XML_PARSE_NONET,		CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("LIBXML_NODICT",		XML_PARSE_NODICT,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_NSCLEAN",	XML_PARSE_NSCLEAN,		CONST_CS | CONST_PERSISTENT);
 	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);
+	REGISTER_LONG_CONSTANT("LIBXML_NOXINCNODE",	XML_PARSE_NOXINCNODE,	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_OLD10",		XML_PARSE_OLD10,		CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("LIBXML_NOBASEFIX",	XML_PARSE_NOBASEFIX,	CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("LIBXML_PARSEHUGE",	XML_PARSE_HUGE,			CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("LIBXML_OLDSAX",		XML_PARSE_OLDSAX,		CONST_CS | CONST_PERSISTENT);
+#endif
+#if LIBXML_VERSION >= 20800
+	REGISTER_LONG_CONSTANT("LIBXML_IGNORE_ENC",	XML_PARSE_IGNORE_ENC,	CONST_CS | CONST_PERSISTENT);
+#endif
+#if LIBXML_VERSION >= 20900
+	REGISTER_LONG_CONSTANT("LIBXML_BIG_LINES",	XML_PARSE_BIG_LINES,	CONST_CS | CONST_PERSISTENT);
 #endif
 	REGISTER_LONG_CONSTANT("LIBXML_NOEMPTYTAG",	LIBXML_SAVE_NOEMPTYTAG,	CONST_CS | CONST_PERSISTENT);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC