diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 0eaadac3e49a8..0b18c1f146278 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -87,13 +87,6 @@ static zend_class_entry *dir_class_entry_ptr; } \ } -static const zend_function_entry php_dir_class_functions[] = { - PHP_FALIAS(close, closedir, arginfo_class_Directory_close) - PHP_FALIAS(rewind, rewinddir, arginfo_class_Directory_rewind) - PHP_FALIAS(read, readdir, arginfo_class_Directory_read) - PHP_FE_END -}; - static void php_set_default_dir(zend_resource *res) { @@ -119,7 +112,7 @@ PHP_MINIT_FUNCTION(dir) static char dirsep_str[2], pathsep_str[2]; zend_class_entry dir_class_entry; - INIT_CLASS_ENTRY(dir_class_entry, "Directory", php_dir_class_functions); + INIT_CLASS_ENTRY(dir_class_entry, "Directory", class_Directory_methods); dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry); #ifdef ZTS diff --git a/ext/standard/dir.stub.php b/ext/standard/dir.stub.php index 0ffef772856ad..39881f759bf73 100755 --- a/ext/standard/dir.stub.php +++ b/ext/standard/dir.stub.php @@ -1,22 +1,27 @@ ce_flags |= __flags; \ @@ -229,50 +229,6 @@ static PHP_MSHUTDOWN_FUNCTION(tidy); static PHP_RINIT_FUNCTION(tidy); static PHP_MINFO_FUNCTION(tidy); -static PHP_FUNCTION(tidy_getopt); -static PHP_FUNCTION(tidy_parse_string); -static PHP_FUNCTION(tidy_parse_file); -static PHP_FUNCTION(tidy_clean_repair); -static PHP_FUNCTION(tidy_repair_string); -static PHP_FUNCTION(tidy_repair_file); -static PHP_FUNCTION(tidy_diagnose); -static PHP_FUNCTION(tidy_get_output); -static PHP_FUNCTION(tidy_get_error_buffer); -static PHP_FUNCTION(tidy_get_release); -static PHP_FUNCTION(tidy_get_config); -static PHP_FUNCTION(tidy_get_status); -static PHP_FUNCTION(tidy_get_html_ver); -#if HAVE_TIDYOPTGETDOC -static PHP_FUNCTION(tidy_get_opt_doc); -#endif -static PHP_FUNCTION(tidy_is_xhtml); -static PHP_FUNCTION(tidy_is_xml); -static PHP_FUNCTION(tidy_error_count); -static PHP_FUNCTION(tidy_warning_count); -static PHP_FUNCTION(tidy_access_count); -static PHP_FUNCTION(tidy_config_count); - -static PHP_FUNCTION(tidy_get_root); -static PHP_FUNCTION(tidy_get_html); -static PHP_FUNCTION(tidy_get_head); -static PHP_FUNCTION(tidy_get_body); - -static TIDY_DOC_METHOD(__construct); -static TIDY_DOC_METHOD(parseFile); -static TIDY_DOC_METHOD(parseString); - -static TIDY_NODE_METHOD(hasChildren); -static TIDY_NODE_METHOD(hasSiblings); -static TIDY_NODE_METHOD(isComment); -static TIDY_NODE_METHOD(isHtml); -static TIDY_NODE_METHOD(isText); -static TIDY_NODE_METHOD(isJste); -static TIDY_NODE_METHOD(isAsp); -static TIDY_NODE_METHOD(isPhp); -static TIDY_NODE_METHOD(getParent); -static TIDY_NODE_METHOD(__construct); -/* }}} */ - ZEND_DECLARE_MODULE_GLOBALS(tidy) PHP_INI_BEGIN() @@ -280,75 +236,6 @@ STD_PHP_INI_ENTRY("tidy.default_config", "", PHP_INI_SYSTEM, OnUpdateString, STD_PHP_INI_ENTRY("tidy.clean_output", "0", PHP_INI_USER, php_tidy_set_clean_output, clean_output, zend_tidy_globals, tidy_globals) PHP_INI_END() -static const zend_function_entry tidy_functions[] = { - PHP_FE(tidy_getopt, arginfo_tidy_getopt) - PHP_FE(tidy_parse_string, arginfo_tidy_parse_string) - PHP_FE(tidy_parse_file, arginfo_tidy_parse_file) - PHP_FE(tidy_get_output, arginfo_tidy_get_output) - PHP_FE(tidy_get_error_buffer, arginfo_tidy_get_error_buffer) - PHP_FE(tidy_clean_repair, arginfo_tidy_clean_repair) - PHP_FE(tidy_repair_string, arginfo_tidy_repair_string) - PHP_FE(tidy_repair_file, arginfo_tidy_repair_file) - PHP_FE(tidy_diagnose, arginfo_tidy_diagnose) - PHP_FE(tidy_get_release, arginfo_tidy_get_release) - PHP_FE(tidy_get_config, arginfo_tidy_get_config) - PHP_FE(tidy_get_status, arginfo_tidy_get_status) - PHP_FE(tidy_get_html_ver, arginfo_tidy_get_html_ver) - PHP_FE(tidy_is_xhtml, arginfo_tidy_is_xhtml) - PHP_FE(tidy_is_xml, arginfo_tidy_is_xml) - PHP_FE(tidy_error_count, arginfo_tidy_error_count) - PHP_FE(tidy_warning_count, arginfo_tidy_warning_count) - PHP_FE(tidy_access_count, arginfo_tidy_access_count) - PHP_FE(tidy_config_count, arginfo_tidy_config_count) -#if HAVE_TIDYOPTGETDOC - PHP_FE(tidy_get_opt_doc, arginfo_tidy_get_opt_doc) -#endif - PHP_FE(tidy_get_root, arginfo_tidy_get_root) - PHP_FE(tidy_get_head, arginfo_tidy_get_head) - PHP_FE(tidy_get_html, arginfo_tidy_get_html) - PHP_FE(tidy_get_body, arginfo_tidy_get_body) - PHP_FE_END -}; - -static const zend_function_entry tidy_funcs_doc[] = { - TIDY_METHOD_MAP(getOpt, tidy_getopt, arginfo_class_tidy_getOpt) - TIDY_METHOD_MAP(cleanRepair, tidy_clean_repair, arginfo_class_tidy_cleanRepair) - TIDY_DOC_ME(parseFile, arginfo_class_tidy_parseFile) - TIDY_DOC_ME(parseString, arginfo_class_tidy_parseString) - TIDY_METHOD_MAP(repairString, tidy_repair_string, arginfo_class_tidy_repairString) - TIDY_METHOD_MAP(repairFile, tidy_repair_file, arginfo_class_tidy_repairFile) - TIDY_METHOD_MAP(diagnose, tidy_diagnose, arginfo_class_tidy_diagnose) - TIDY_METHOD_MAP(getRelease, tidy_get_release, arginfo_class_tidy_getRelease) - TIDY_METHOD_MAP(getConfig, tidy_get_config, arginfo_class_tidy_getConfig) - TIDY_METHOD_MAP(getStatus, tidy_get_status, arginfo_class_tidy_getStatus) - TIDY_METHOD_MAP(getHtmlVer, tidy_get_html_ver, arginfo_class_tidy_getHtmlVer) -#if HAVE_TIDYOPTGETDOC - TIDY_METHOD_MAP(getOptDoc, tidy_get_opt_doc, arginfo_class_tidy_getOptDoc) -#endif - TIDY_METHOD_MAP(isXhtml, tidy_is_xhtml, arginfo_class_tidy_isXhtml) - TIDY_METHOD_MAP(isXml, tidy_is_xml, arginfo_class_tidy_isXml) - TIDY_METHOD_MAP(root, tidy_get_root, arginfo_class_tidy_root) - TIDY_METHOD_MAP(head, tidy_get_head, arginfo_class_tidy_head) - TIDY_METHOD_MAP(html, tidy_get_html, arginfo_class_tidy_html) - TIDY_METHOD_MAP(body, tidy_get_body, arginfo_class_tidy_body) - TIDY_DOC_ME(__construct, arginfo_class_tidy___construct) - PHP_FE_END -}; - -static const zend_function_entry tidy_funcs_node[] = { - TIDY_NODE_ME(hasChildren, arginfo_class_tidyNode_hasChildren) - TIDY_NODE_ME(hasSiblings, arginfo_class_tidyNode_hasSiblings) - TIDY_NODE_ME(isComment, arginfo_class_tidyNode_isComment) - TIDY_NODE_ME(isHtml, arginfo_class_tidyNode_isHtml) - TIDY_NODE_ME(isText, arginfo_class_tidyNode_isText) - TIDY_NODE_ME(isJste, arginfo_class_tidyNode_isJste) - TIDY_NODE_ME(isAsp, arginfo_class_tidyNode_isAsp) - TIDY_NODE_ME(isPhp, arginfo_class_tidyNode_isPhp) - TIDY_NODE_ME(getParent, arginfo_class_tidyNode_getParent) - TIDY_NODE_PRIVATE_ME(__construct, arginfo_class_tidyNode___construct) - PHP_FE_END -}; - static zend_class_entry *tidy_ce_doc, *tidy_ce_node; static zend_object_handlers tidy_object_handlers_doc; @@ -357,7 +244,7 @@ static zend_object_handlers tidy_object_handlers_node; zend_module_entry tidy_module_entry = { STANDARD_MODULE_HEADER, "tidy", - tidy_functions, + ext_functions, PHP_MINIT(tidy), PHP_MSHUTDOWN(tidy), PHP_RINIT(tidy), @@ -1099,7 +986,7 @@ static int php_tidy_output_handler(void **nothing, php_output_context *output_co /* {{{ proto bool tidy_parse_string(string input [, mixed config_options [, string encoding]]) Parse a document stored in a string */ -static PHP_FUNCTION(tidy_parse_string) +PHP_FUNCTION(tidy_parse_string) { char *enc = NULL; size_t enc_len = 0; @@ -1130,7 +1017,7 @@ static PHP_FUNCTION(tidy_parse_string) /* {{{ proto string tidy_get_error_buffer() Return warnings and errors which occurred parsing the specified document*/ -static PHP_FUNCTION(tidy_get_error_buffer) +PHP_FUNCTION(tidy_get_error_buffer) { TIDY_FETCH_OBJECT; @@ -1144,7 +1031,7 @@ static PHP_FUNCTION(tidy_get_error_buffer) /* {{{ proto string tidy_get_output(tidy tidy) Return a string representing the parsed tidy markup */ -static PHP_FUNCTION(tidy_get_output) +PHP_FUNCTION(tidy_get_output) { TidyBuffer output; TIDY_FETCH_OBJECT; @@ -1159,7 +1046,7 @@ static PHP_FUNCTION(tidy_get_output) /* {{{ proto bool tidy_parse_file(string file [, mixed config_options [, string encoding [, bool use_include_path]]]) Parse markup in file or URI */ -static PHP_FUNCTION(tidy_parse_file) +PHP_FUNCTION(tidy_parse_file) { char *enc = NULL; size_t enc_len = 0; @@ -1200,7 +1087,7 @@ static PHP_FUNCTION(tidy_parse_file) /* {{{ proto bool tidy_clean_repair(tidy tidy) Execute configured cleanup and repair operations on parsed markup */ -static PHP_FUNCTION(tidy_clean_repair) +PHP_FUNCTION(tidy_clean_repair) { TIDY_FETCH_OBJECT; @@ -1215,7 +1102,7 @@ static PHP_FUNCTION(tidy_clean_repair) /* {{{ proto bool tidy_repair_string(string data [, mixed config_file [, string encoding]]) Repair a string using an optionally provided configuration file */ -static PHP_FUNCTION(tidy_repair_string) +PHP_FUNCTION(tidy_repair_string) { php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, FALSE); } @@ -1223,7 +1110,7 @@ static PHP_FUNCTION(tidy_repair_string) /* {{{ proto bool tidy_repair_file(string filename [, mixed config_file [, string encoding [, bool use_include_path]]]) Repair a file using an optionally provided configuration file */ -static PHP_FUNCTION(tidy_repair_file) +PHP_FUNCTION(tidy_repair_file) { php_tidy_quick_repair(INTERNAL_FUNCTION_PARAM_PASSTHRU, TRUE); } @@ -1231,7 +1118,7 @@ static PHP_FUNCTION(tidy_repair_file) /* {{{ proto bool tidy_diagnose() Run configured diagnostics on parsed and repaired markup. */ -static PHP_FUNCTION(tidy_diagnose) +PHP_FUNCTION(tidy_diagnose) { TIDY_FETCH_OBJECT; @@ -1246,7 +1133,7 @@ static PHP_FUNCTION(tidy_diagnose) /* {{{ proto string tidy_get_release() Get release date (version) for Tidy library */ -static PHP_FUNCTION(tidy_get_release) +PHP_FUNCTION(tidy_get_release) { if (zend_parse_parameters_none() == FAILURE) { RETURN_THROWS(); @@ -1264,7 +1151,7 @@ static PHP_FUNCTION(tidy_get_release) #if HAVE_TIDYOPTGETDOC /* {{{ proto string tidy_get_opt_doc(tidy resource, string optname) Returns the documentation for the given option name */ -static PHP_FUNCTION(tidy_get_opt_doc) +PHP_FUNCTION(tidy_get_opt_doc) { PHPTidyObj *obj; char *optval, *optname; @@ -1297,7 +1184,7 @@ static PHP_FUNCTION(tidy_get_opt_doc) /* {{{ proto array tidy_get_config(tidy tidy) Get current Tidy configuration */ -static PHP_FUNCTION(tidy_get_config) +PHP_FUNCTION(tidy_get_config) { TidyIterator itOpt; char *opt_name; @@ -1336,7 +1223,7 @@ static PHP_FUNCTION(tidy_get_config) /* {{{ proto int tidy_get_status(tidy tidy) Get status of specified document. */ -static PHP_FUNCTION(tidy_get_status) +PHP_FUNCTION(tidy_get_status) { TIDY_FETCH_OBJECT; @@ -1346,7 +1233,7 @@ static PHP_FUNCTION(tidy_get_status) /* {{{ proto int tidy_get_html_ver(tidy tidy) Get the Detected HTML version for the specified document. */ -static PHP_FUNCTION(tidy_get_html_ver) +PHP_FUNCTION(tidy_get_html_ver) { TIDY_FETCH_OBJECT; @@ -1356,7 +1243,7 @@ static PHP_FUNCTION(tidy_get_html_ver) /* {{{ proto bool tidy_is_xhtml(tidy tidy) Indicates if the document is a XHTML document. */ -static PHP_FUNCTION(tidy_is_xhtml) +PHP_FUNCTION(tidy_is_xhtml) { TIDY_FETCH_OBJECT; @@ -1366,7 +1253,7 @@ static PHP_FUNCTION(tidy_is_xhtml) /* {{{ proto bool tidy_is_xml(tidy tidy) Indicates if the document is a generic (non HTML/XHTML) XML document. */ -static PHP_FUNCTION(tidy_is_xml) +PHP_FUNCTION(tidy_is_xml) { TIDY_FETCH_OBJECT; @@ -1376,7 +1263,7 @@ static PHP_FUNCTION(tidy_is_xml) /* {{{ proto int tidy_error_count(tidy tidy) Returns the Number of Tidy errors encountered for specified document. */ -static PHP_FUNCTION(tidy_error_count) +PHP_FUNCTION(tidy_error_count) { TIDY_FETCH_OBJECT; @@ -1386,7 +1273,7 @@ static PHP_FUNCTION(tidy_error_count) /* {{{ proto int tidy_warning_count(tidy tidy) Returns the Number of Tidy warnings encountered for specified document. */ -static PHP_FUNCTION(tidy_warning_count) +PHP_FUNCTION(tidy_warning_count) { TIDY_FETCH_OBJECT; @@ -1396,7 +1283,7 @@ static PHP_FUNCTION(tidy_warning_count) /* {{{ proto int tidy_access_count(tidy tidy) Returns the Number of Tidy accessibility warnings encountered for specified document. */ -static PHP_FUNCTION(tidy_access_count) +PHP_FUNCTION(tidy_access_count) { TIDY_FETCH_OBJECT; @@ -1406,7 +1293,7 @@ static PHP_FUNCTION(tidy_access_count) /* {{{ proto int tidy_config_count(tidy tidy) Returns the Number of Tidy configuration errors encountered for specified document. */ -static PHP_FUNCTION(tidy_config_count) +PHP_FUNCTION(tidy_config_count) { TIDY_FETCH_OBJECT; @@ -1416,7 +1303,7 @@ static PHP_FUNCTION(tidy_config_count) /* {{{ proto mixed tidy_getopt(string option) Returns the value of the specified configuration option for the tidy document. */ -static PHP_FUNCTION(tidy_getopt) +PHP_FUNCTION(tidy_getopt) { PHPTidyObj *obj; char *optname; @@ -1466,7 +1353,7 @@ static PHP_FUNCTION(tidy_getopt) } /* }}} */ -static TIDY_DOC_METHOD(__construct) +PHP_METHOD(tidy, __construct) { char *enc = NULL; size_t enc_len = 0; @@ -1503,7 +1390,7 @@ static TIDY_DOC_METHOD(__construct) } } -static TIDY_DOC_METHOD(parseFile) +PHP_METHOD(tidy, parseFile) { char *enc = NULL; size_t enc_len = 0; @@ -1542,7 +1429,7 @@ static TIDY_DOC_METHOD(parseFile) zend_string_release_ex(contents, 0); } -static TIDY_DOC_METHOD(parseString) +PHP_METHOD(tidy, parseString) { char *enc = NULL; size_t enc_len = 0; @@ -1575,7 +1462,7 @@ static TIDY_DOC_METHOD(parseString) /* {{{ proto TidyNode tidy_get_root() Returns a TidyNode Object representing the root of the tidy parse tree */ -static PHP_FUNCTION(tidy_get_root) +PHP_FUNCTION(tidy_get_root) { php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_root_node); } @@ -1583,7 +1470,7 @@ static PHP_FUNCTION(tidy_get_root) /* {{{ proto TidyNode tidy_get_html() Returns a TidyNode Object starting from the tag of the tidy parse tree */ -static PHP_FUNCTION(tidy_get_html) +PHP_FUNCTION(tidy_get_html) { php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_html_node); } @@ -1591,7 +1478,7 @@ static PHP_FUNCTION(tidy_get_html) /* {{{ proto TidyNode tidy_get_head() Returns a TidyNode Object starting from the tag of the tidy parse tree */ -static PHP_FUNCTION(tidy_get_head) +PHP_FUNCTION(tidy_get_head) { php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_head_node); } @@ -1599,7 +1486,7 @@ static PHP_FUNCTION(tidy_get_head) /* {{{ proto TidyNode tidy_get_body(tidy tidy) Returns a TidyNode Object starting from the tag of the tidy parse tree */ -static PHP_FUNCTION(tidy_get_body) +PHP_FUNCTION(tidy_get_body) { php_tidy_create_node(INTERNAL_FUNCTION_PARAM_PASSTHRU, is_body_node); } @@ -1607,7 +1494,7 @@ static PHP_FUNCTION(tidy_get_body) /* {{{ proto bool tidyNode::hasChildren() Returns true if this node has children */ -static TIDY_NODE_METHOD(hasChildren) +PHP_METHOD(tidyNode, hasChildren) { TIDY_FETCH_ONLY_OBJECT; @@ -1621,7 +1508,7 @@ static TIDY_NODE_METHOD(hasChildren) /* {{{ proto bool tidyNode::hasSiblings() Returns true if this node has siblings */ -static TIDY_NODE_METHOD(hasSiblings) +PHP_METHOD(tidyNode, hasSiblings) { TIDY_FETCH_ONLY_OBJECT; @@ -1635,7 +1522,7 @@ static TIDY_NODE_METHOD(hasSiblings) /* {{{ proto bool tidyNode::isComment() Returns true if this node represents a comment */ -static TIDY_NODE_METHOD(isComment) +PHP_METHOD(tidyNode, isComment) { TIDY_FETCH_ONLY_OBJECT; @@ -1649,7 +1536,7 @@ static TIDY_NODE_METHOD(isComment) /* {{{ proto bool tidyNode::isHtml() Returns true if this node is part of a HTML document */ -static TIDY_NODE_METHOD(isHtml) +PHP_METHOD(tidyNode, isHtml) { TIDY_FETCH_ONLY_OBJECT; @@ -1663,7 +1550,7 @@ static TIDY_NODE_METHOD(isHtml) /* {{{ proto bool tidyNode::isText() Returns true if this node represents text (no markup) */ -static TIDY_NODE_METHOD(isText) +PHP_METHOD(tidyNode, isText) { TIDY_FETCH_ONLY_OBJECT; @@ -1677,7 +1564,7 @@ static TIDY_NODE_METHOD(isText) /* {{{ proto bool tidyNode::isJste() Returns true if this node is JSTE */ -static TIDY_NODE_METHOD(isJste) +PHP_METHOD(tidyNode, isJste) { TIDY_FETCH_ONLY_OBJECT; @@ -1691,7 +1578,7 @@ static TIDY_NODE_METHOD(isJste) /* {{{ proto bool tidyNode::isAsp() Returns true if this node is ASP */ -static TIDY_NODE_METHOD(isAsp) +PHP_METHOD(tidyNode, isAsp) { TIDY_FETCH_ONLY_OBJECT; @@ -1705,7 +1592,7 @@ static TIDY_NODE_METHOD(isAsp) /* {{{ proto bool tidyNode::isPhp() Returns true if this node is PHP */ -static TIDY_NODE_METHOD(isPhp) +PHP_METHOD(tidyNode, isPhp) { TIDY_FETCH_ONLY_OBJECT; @@ -1719,7 +1606,7 @@ static TIDY_NODE_METHOD(isPhp) /* {{{ proto tidyNode tidyNode::getParent() Returns the parent node if available or NULL */ -static TIDY_NODE_METHOD(getParent) +PHP_METHOD(tidyNode, getParent) { TidyNode parent_node; PHPTidyObj *newobj; @@ -1743,7 +1630,7 @@ static TIDY_NODE_METHOD(getParent) /* {{{ proto tidyNode::__construct() __constructor for tidyNode. */ -static TIDY_NODE_METHOD(__construct) +PHP_METHOD(tidyNode, __construct) { zend_throw_error(NULL, "You should not create a tidyNode manually"); } diff --git a/ext/tidy/tidy.stub.php b/ext/tidy/tidy.stub.php index 423fecb090244..528fe425c91d8 100644 --- a/ext/tidy/tidy.stub.php +++ b/ext/tidy/tidy.stub.php @@ -1,5 +1,7 @@ create_object = xml_parser_create_object; xml_parser_ce->ce_flags |= ZEND_ACC_FINAL; diff --git a/ext/xml/xml.stub.php b/ext/xml/xml.stub.php index 1c43441b4deb3..9693eeba81623 100644 --- a/ext/xml/xml.stub.php +++ b/ext/xml/xml.stub.php @@ -57,3 +57,7 @@ function xml_parser_free(XmlParser $parser): bool {} function xml_parser_set_option(XmlParser $parser, int $option, $value): bool {} function xml_parser_get_option(XmlParser $parser, int $option): string|int|false {} + +final class XMLParser +{ +} diff --git a/ext/xml/xml_arginfo.h b/ext/xml/xml_arginfo.h index ecd295b55f94f..1e448ac816148 100644 --- a/ext/xml/xml_arginfo.h +++ b/ext/xml/xml_arginfo.h @@ -131,3 +131,8 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(xml_parser_get_option, arginfo_xml_parser_get_option) ZEND_FE_END }; + + +static const zend_function_entry class_XMLParser_methods[] = { + ZEND_FE_END +}; diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 8ba87763c168c..acb39a7fc973a 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -23,13 +23,13 @@ #include "php_ini.h" #include "ext/standard/info.h" #include "php_xmlreader.h" +#include "php_xmlreader_arginfo.h" #ifdef HAVE_DOM #include "ext/dom/xml_common.h" #include "ext/dom/dom_ce.h" #endif #include #include -#include "xmlreader_arginfo.h" zend_class_entry *xmlreader_class_entry; @@ -523,7 +523,7 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t /* {{{ proto bool XMLReader::close() Closes xmlreader - current frees resources until xmlTextReaderClose is fixed in libxml */ -PHP_METHOD(xmlreader, close) +PHP_METHOD(XMLReader, close) { zval *id; xmlreader_object *intern; @@ -545,7 +545,7 @@ PHP_METHOD(xmlreader, close) /* {{{ proto string XMLReader::getAttribute(string name) Get value of an attribute from current element */ -PHP_METHOD(xmlreader, getAttribute) +PHP_METHOD(XMLReader, getAttribute) { php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderGetAttribute); } @@ -553,7 +553,7 @@ PHP_METHOD(xmlreader, getAttribute) /* {{{ proto string XMLReader::getAttributeNo(int index) Get value of an attribute at index from current element */ -PHP_METHOD(xmlreader, getAttributeNo) +PHP_METHOD(XMLReader, getAttributeNo) { zval *id; zend_long attr_pos; @@ -579,7 +579,7 @@ PHP_METHOD(xmlreader, getAttributeNo) /* {{{ proto string XMLReader::getAttributeNs(string name, string namespaceURI) Get value of a attribute via name and namespace from current element */ -PHP_METHOD(xmlreader, getAttributeNs) +PHP_METHOD(XMLReader, getAttributeNs) { zval *id; size_t name_len = 0, ns_uri_len = 0; @@ -610,7 +610,7 @@ PHP_METHOD(xmlreader, getAttributeNs) /* {{{ proto bool XMLReader::getParserProperty(int property) Indicates whether given property (one of the parser option constants) is set or not on parser */ -PHP_METHOD(xmlreader, getParserProperty) +PHP_METHOD(XMLReader, getParserProperty) { zval *id; zend_long property; @@ -640,7 +640,7 @@ PHP_METHOD(xmlreader, getParserProperty) Returns boolean indicating if parsed document is valid or not. Must set XMLREADER_LOADDTD or XMLREADER_VALIDATE parser option prior to the first call to read or this method will always return FALSE */ -PHP_METHOD(xmlreader, isValid) +PHP_METHOD(XMLReader, isValid) { php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderIsValid); } @@ -648,7 +648,7 @@ PHP_METHOD(xmlreader, isValid) /* {{{ proto string XMLReader::lookupNamespace(string prefix) Return namespaceURI for associated prefix on current node */ -PHP_METHOD(xmlreader, lookupNamespace) +PHP_METHOD(XMLReader, lookupNamespace) { php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderLookupNamespace); } @@ -656,7 +656,7 @@ PHP_METHOD(xmlreader, lookupNamespace) /* {{{ proto bool XMLReader::moveToAttribute(string name) Positions reader at specified attribute - Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttribute) +PHP_METHOD(XMLReader, moveToAttribute) { zval *id; size_t name_len = 0; @@ -690,7 +690,7 @@ PHP_METHOD(xmlreader, moveToAttribute) /* {{{ proto bool XMLReader::moveToAttributeNo(int index) Positions reader at attribute at specified index. Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttributeNo) +PHP_METHOD(XMLReader, moveToAttributeNo) { zval *id; zend_long attr_pos; @@ -718,7 +718,7 @@ PHP_METHOD(xmlreader, moveToAttributeNo) /* {{{ proto bool XMLReader::moveToAttributeNs(string name, string namespaceURI) Positions reader at attribute spcified by name and namespaceURI. Returns TRUE on success and FALSE on failure */ -PHP_METHOD(xmlreader, moveToAttributeNs) +PHP_METHOD(XMLReader, moveToAttributeNs) { zval *id; size_t name_len=0, ns_uri_len=0; @@ -751,7 +751,7 @@ PHP_METHOD(xmlreader, moveToAttributeNs) /* {{{ proto bool XMLReader::moveToElement() Moves the position of the current instance to the node that contains the current Attribute node. */ -PHP_METHOD(xmlreader, moveToElement) +PHP_METHOD(XMLReader, moveToElement) { php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToElement); } @@ -759,7 +759,7 @@ PHP_METHOD(xmlreader, moveToElement) /* {{{ proto bool XMLReader::moveToFirstAttribute() Moves the position of the current instance to the first attribute associated with the current node. */ -PHP_METHOD(xmlreader, moveToFirstAttribute) +PHP_METHOD(XMLReader, moveToFirstAttribute) { php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToFirstAttribute); } @@ -767,7 +767,7 @@ PHP_METHOD(xmlreader, moveToFirstAttribute) /* {{{ proto bool XMLReader::moveToNextAttribute() Moves the position of the current instance to the next attribute associated with the current node. */ -PHP_METHOD(xmlreader, moveToNextAttribute) +PHP_METHOD(XMLReader, moveToNextAttribute) { php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderMoveToNextAttribute); } @@ -775,7 +775,7 @@ PHP_METHOD(xmlreader, moveToNextAttribute) /* {{{ proto bool XMLReader::read() Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, read) +PHP_METHOD(XMLReader, read) { zval *id; int retval; @@ -803,7 +803,7 @@ PHP_METHOD(xmlreader, read) /* {{{ proto bool XMLReader::next([string localname]) Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, next) +PHP_METHOD(XMLReader, next) { zval *id; int retval; @@ -839,7 +839,7 @@ PHP_METHOD(xmlreader, next) /* {{{ proto bool XMLReader::open(string URI [, string encoding [, int options]]) Sets the URI that the XMLReader will parse. */ -PHP_METHOD(xmlreader, open) +PHP_METHOD(XMLReader, open) { zval *id; size_t source_len = 0, encoding_len = 0; @@ -895,7 +895,7 @@ PHP_METHOD(xmlreader, open) /* }}} */ /* Not Yet Implemented in libxml - functions exist just not coded -PHP_METHOD(xmlreader, resetState) +PHP_METHOD(XMLReader, resetState) { } @@ -903,7 +903,7 @@ PHP_METHOD(xmlreader, resetState) /* {{{ proto string XMLReader::readInnerXml() Reads the contents of the current node, including child nodes and markup. */ -PHP_METHOD(xmlreader, readInnerXml) +PHP_METHOD(XMLReader, readInnerXml) { php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadInnerXml); } @@ -911,7 +911,7 @@ PHP_METHOD(xmlreader, readInnerXml) /* {{{ proto bool XMLReader::readOuterXml() Reads the contents of the current node, including child nodes and markup. */ -PHP_METHOD(xmlreader, readOuterXml) +PHP_METHOD(XMLReader, readOuterXml) { php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadOuterXml); } @@ -919,7 +919,7 @@ PHP_METHOD(xmlreader, readOuterXml) /* {{{ proto bool XMLReader::readString() Reads the contents of an element or a text node as a string. */ -PHP_METHOD(xmlreader, readString) +PHP_METHOD(XMLReader, readString) { php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, xmlTextReaderReadString); } @@ -927,7 +927,7 @@ PHP_METHOD(xmlreader, readString) /* {{{ proto bool XMLReader::setSchema(string filename) Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). */ -PHP_METHOD(xmlreader, setSchema) +PHP_METHOD(XMLReader, setSchema) { #ifdef LIBXML_SCHEMAS_ENABLED zval *id; @@ -970,7 +970,7 @@ PHP_METHOD(xmlreader, setSchema) /* {{{ proto bool XMLReader::setParserProperty(int property, bool value) Sets parser property (one of the parser option constants). Properties must be set after open() or XML() and before the first read() is called */ -PHP_METHOD(xmlreader, setParserProperty) +PHP_METHOD(XMLReader, setParserProperty) { zval *id; zend_long property; @@ -999,7 +999,7 @@ PHP_METHOD(xmlreader, setParserProperty) /* {{{ proto bool XMLReader::setRelaxNGSchema(string filename) Sets the string that the XMLReader will parse. */ -PHP_METHOD(xmlreader, setRelaxNGSchema) +PHP_METHOD(XMLReader, setRelaxNGSchema) { php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_FILE); } @@ -1007,7 +1007,7 @@ PHP_METHOD(xmlreader, setRelaxNGSchema) /* {{{ proto bool XMLReader::setRelaxNGSchemaSource(string source) Sets the string that the XMLReader will parse. */ -PHP_METHOD(xmlreader, setRelaxNGSchemaSource) +PHP_METHOD(XMLReader, setRelaxNGSchemaSource) { php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAM_PASSTHRU, XMLREADER_LOAD_STRING); } @@ -1021,7 +1021,7 @@ XMLPUBFUN int XMLCALL /* {{{ proto bool XMLReader::XML(string source [, string encoding [, int options]]) Sets the string that the XMLReader will parse. */ -PHP_METHOD(xmlreader, XML) +PHP_METHOD(XMLReader, XML) { zval *id; size_t source_len = 0, encoding_len = 0; @@ -1105,7 +1105,7 @@ PHP_METHOD(xmlreader, XML) /* {{{ proto bool XMLReader::expand() Moves the position of the current instance to the next node in the stream. */ -PHP_METHOD(xmlreader, expand) +PHP_METHOD(XMLReader, expand) { #ifdef HAVE_DOM zval *id, *basenode = NULL; @@ -1153,38 +1153,6 @@ PHP_METHOD(xmlreader, expand) } /* }}} */ -static const zend_function_entry xmlreader_functions[] /* {{{ */ = { - PHP_ME(xmlreader, close, arginfo_class_XMLReader_close, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttribute, arginfo_class_XMLReader_getAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttributeNo, arginfo_class_XMLReader_getAttributeNo, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getAttributeNs, arginfo_class_XMLReader_getAttributeNs, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, getParserProperty, arginfo_class_XMLReader_getParserProperty, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, isValid, arginfo_class_XMLReader_isValid, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, lookupNamespace, arginfo_class_XMLReader_lookupNamespace, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttributeNo, arginfo_class_XMLReader_moveToAttributeNo, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttribute, arginfo_class_XMLReader_moveToAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToAttributeNs, arginfo_class_XMLReader_moveToAttributeNs, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToElement, arginfo_class_XMLReader_moveToElement, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToFirstAttribute, arginfo_class_XMLReader_moveToFirstAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, moveToNextAttribute, arginfo_class_XMLReader_moveToNextAttribute, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, open, arginfo_class_XMLReader_open, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(xmlreader, read, arginfo_class_XMLReader_read, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, next, arginfo_class_XMLReader_next, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readInnerXml, arginfo_class_XMLReader_readInnerXml, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readOuterXml, arginfo_class_XMLReader_readOuterXml, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, readString, arginfo_class_XMLReader_readString, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setSchema, arginfo_class_XMLReader_setSchema, ZEND_ACC_PUBLIC) -/* Not Yet Implemented though defined in libxml as of 2.6.9dev - PHP_ME(xmlreader, resetState, NULL, ZEND_ACC_PUBLIC) -*/ - PHP_ME(xmlreader, setParserProperty, arginfo_class_XMLReader_setParserProperty, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setRelaxNGSchema, arginfo_class_XMLReader_setRelaxNGSchema, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, setRelaxNGSchemaSource, arginfo_class_XMLReader_setRelaxNGSchemaSource, ZEND_ACC_PUBLIC) - PHP_ME(xmlreader, XML, arginfo_class_XMLReader_XML, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(xmlreader, expand, arginfo_class_XMLReader_expand, ZEND_ACC_PUBLIC) - PHP_FE_END -}; /* }}} */ - /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(xmlreader) @@ -1202,7 +1170,7 @@ PHP_MINIT_FUNCTION(xmlreader) xmlreader_object_handlers.get_method = xmlreader_get_method; xmlreader_object_handlers.clone_obj = NULL; - INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions); + INIT_CLASS_ENTRY(ce, "XMLReader", class_XMLReader_methods); ce.create_object = xmlreader_objects_new; xmlreader_class_entry = zend_register_internal_class(&ce); diff --git a/ext/xmlreader/xmlreader.stub.php b/ext/xmlreader/php_xmlreader.stub.php similarity index 89% rename from ext/xmlreader/xmlreader.stub.php rename to ext/xmlreader/php_xmlreader.stub.php index 5cc08651fae4d..cbf7bb1beec45 100644 --- a/ext/xmlreader/xmlreader.stub.php +++ b/ext/xmlreader/php_xmlreader.stub.php @@ -1,5 +1,7 @@