diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-12 01:49:13 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-12 10:18:21 +0200 |
commit | 68a56483ea5794ac0d683968457dec9fa8a85b5f (patch) | |
tree | e6d56d144513f1416874084a50b3bdd02694e59b | |
parent | e088836bbc755a2bb1d827d4de6206222b0ca792 (diff) | |
download | php-git-68a56483ea5794ac0d683968457dec9fa8a85b5f.tar.gz |
Generate method entries for ext/xsl
Closes GH-5372
-rw-r--r-- | ext/xsl/php_xsl.c | 3 | ||||
-rw-r--r-- | ext/xsl/php_xsl.h | 1 | ||||
-rw-r--r-- | ext/xsl/php_xsl.stub.php (renamed from ext/xsl/xsltprocessor.stub.php) | 2 | ||||
-rw-r--r-- | ext/xsl/php_xsl_arginfo.h (renamed from ext/xsl/xsltprocessor_arginfo.h) | 31 | ||||
-rw-r--r-- | ext/xsl/xsl_fe.h | 36 | ||||
-rw-r--r-- | ext/xsl/xsltprocessor.c | 24 |
6 files changed, 35 insertions, 62 deletions
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index da67e9ea64..63974643bc 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -22,6 +22,7 @@ #include "php_ini.h" #include "ext/standard/info.h" #include "php_xsl.h" +#include "php_xsl_arginfo.h" zend_class_entry *xsl_xsltprocessor_class_entry; static zend_object_handlers xsl_object_handlers; @@ -129,7 +130,7 @@ PHP_MINIT_FUNCTION(xsl) xsl_object_handlers.clone_obj = NULL; xsl_object_handlers.free_obj = xsl_objects_free_storage; - REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, php_xsl_xsltprocessor_class_functions, xsl_xsltprocessor_class_entry); + REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, class_XSLTProcessor_methods, xsl_xsltprocessor_class_entry); #if HAVE_XSL_EXSLT exsltRegisterAll(); #endif diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h index 0d105ce2a0..94d4409b36 100644 --- a/ext/xsl/php_xsl.h +++ b/ext/xsl/php_xsl.h @@ -38,7 +38,6 @@ extern zend_module_entry xsl_module_entry; #endif #include "../dom/xml_common.h" -#include "xsl_fe.h" #include <libxslt/extensions.h> #include <libxml/xpathInternals.h> diff --git a/ext/xsl/xsltprocessor.stub.php b/ext/xsl/php_xsl.stub.php index 8b4dcd1697..23f187fbdd 100644 --- a/ext/xsl/xsltprocessor.stub.php +++ b/ext/xsl/php_xsl.stub.php @@ -1,5 +1,7 @@ <?php +/** @generate-function-entries */ + class XSLTProcessor { /** @return bool */ diff --git a/ext/xsl/xsltprocessor_arginfo.h b/ext/xsl/php_xsl_arginfo.h index 50ed54c8d0..e9cc9009ae 100644 --- a/ext/xsl/xsltprocessor_arginfo.h +++ b/ext/xsl/php_xsl_arginfo.h @@ -47,3 +47,34 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setSecurityPrefs, 0, 0, 1) ZEND_END_ARG_INFO() #define arginfo_class_XSLTProcessor_getSecurityPrefs arginfo_class_XSLTProcessor_hasExsltSupport + + +ZEND_METHOD(XSLTProcessor, importStylesheet); +ZEND_METHOD(XSLTProcessor, transformToDoc); +ZEND_METHOD(XSLTProcessor, transformToUri); +ZEND_METHOD(XSLTProcessor, transformToXml); +ZEND_METHOD(XSLTProcessor, setParameter); +ZEND_METHOD(XSLTProcessor, getParameter); +ZEND_METHOD(XSLTProcessor, removeParameter); +ZEND_METHOD(XSLTProcessor, hasExsltSupport); +ZEND_METHOD(XSLTProcessor, registerPHPFunctions); +ZEND_METHOD(XSLTProcessor, setProfiling); +ZEND_METHOD(XSLTProcessor, setSecurityPrefs); +ZEND_METHOD(XSLTProcessor, getSecurityPrefs); + + +static const zend_function_entry class_XSLTProcessor_methods[] = { + ZEND_ME(XSLTProcessor, importStylesheet, arginfo_class_XSLTProcessor_importStylesheet, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, transformToDoc, arginfo_class_XSLTProcessor_transformToDoc, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, transformToUri, arginfo_class_XSLTProcessor_transformToUri, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, transformToXml, arginfo_class_XSLTProcessor_transformToXml, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, setParameter, arginfo_class_XSLTProcessor_setParameter, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, getParameter, arginfo_class_XSLTProcessor_getParameter, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, removeParameter, arginfo_class_XSLTProcessor_removeParameter, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, hasExsltSupport, arginfo_class_XSLTProcessor_hasExsltSupport, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, registerPHPFunctions, arginfo_class_XSLTProcessor_registerPHPFunctions, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, setProfiling, arginfo_class_XSLTProcessor_setProfiling, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, setSecurityPrefs, arginfo_class_XSLTProcessor_setSecurityPrefs, ZEND_ACC_PUBLIC) + ZEND_ME(XSLTProcessor, getSecurityPrefs, arginfo_class_XSLTProcessor_getSecurityPrefs, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h deleted file mode 100644 index dd81681863..0000000000 --- a/ext/xsl/xsl_fe.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Christian Stocker <chregu@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifndef XSL_FE_H -#define XSL_FE_H - -extern const zend_function_entry php_xsl_xsltprocessor_class_functions[]; -extern zend_class_entry *xsl_xsltprocessor_class_entry; - -PHP_METHOD(XSLTProcessor, importStylesheet); -PHP_METHOD(XSLTProcessor, transformToDoc); -PHP_METHOD(XSLTProcessor, transformToUri); -PHP_METHOD(XSLTProcessor, transformToXml); -PHP_METHOD(XSLTProcessor, setParameter); -PHP_METHOD(XSLTProcessor, getParameter); -PHP_METHOD(XSLTProcessor, removeParameter); -PHP_METHOD(XSLTProcessor, hasExsltSupport); -PHP_METHOD(XSLTProcessor, registerPHPFunctions); -PHP_METHOD(XSLTProcessor, setProfiling); -PHP_METHOD(XSLTProcessor, setSecurityPrefs); -PHP_METHOD(XSLTProcessor, getSecurityPrefs); - -#endif diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 539fe39e61..1ced2b7b74 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -21,32 +21,8 @@ #include "php.h" #include "php_xsl.h" -#include "xsltprocessor_arginfo.h" #include "ext/libxml/php_libxml.h" -/* -* class xsl_xsltprocessor -* -* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# -* Since: -*/ - -const zend_function_entry php_xsl_xsltprocessor_class_functions[] = { - PHP_ME(XSLTProcessor, importStylesheet, arginfo_class_XSLTProcessor_importStylesheet, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, transformToDoc, arginfo_class_XSLTProcessor_transformToDoc, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, transformToUri, arginfo_class_XSLTProcessor_transformToUri, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, transformToXml, arginfo_class_XSLTProcessor_transformToXml, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, setParameter, arginfo_class_XSLTProcessor_setParameter, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, getParameter, arginfo_class_XSLTProcessor_getParameter, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, removeParameter, arginfo_class_XSLTProcessor_removeParameter, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, hasExsltSupport, arginfo_class_XSLTProcessor_hasExsltSupport, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, registerPHPFunctions, arginfo_class_XSLTProcessor_registerPHPFunctions, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, setProfiling, arginfo_class_XSLTProcessor_setProfiling, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, setSecurityPrefs, arginfo_class_XSLTProcessor_setSecurityPrefs, ZEND_ACC_PUBLIC) - PHP_ME(XSLTProcessor, getSecurityPrefs, arginfo_class_XSLTProcessor_getSecurityPrefs, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - /* {{{ php_xsl_xslt_string_to_xpathexpr() Translates a string to a XPath Expression */ static char *php_xsl_xslt_string_to_xpathexpr(const char *str) |