From f328594072136b243c83ee8d70f81332f84e87da Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Wed, 25 Mar 2020 11:53:06 +0100 Subject: [PATCH] Add stubs for SAPIs Closes GH-5295. --- sapi/cgi/cgi_main.c | 21 +++---------------- sapi/cgi/cgi_main.stub.php | 12 +++++++++++ sapi/cgi/cgi_main_arginfo.h | 26 ++++++++++++++++++++++++ sapi/cli/php_cli.c | 8 ++------ sapi/cli/php_cli_process_title.h | 7 ------- sapi/cli/php_cli_process_title.stub.php | 5 +++++ sapi/cli/php_cli_process_title_arginfo.h | 9 ++++++++ sapi/cli/php_cli_server.c | 15 +++++++------- sapi/cli/php_cli_server.stub.php | 7 +++++++ sapi/cli/php_cli_server_arginfo.h | 9 ++++++++ sapi/embed/php_embed.c | 7 +------ 11 files changed, 81 insertions(+), 45 deletions(-) create mode 100644 sapi/cgi/cgi_main.stub.php create mode 100644 sapi/cgi/cgi_main_arginfo.h create mode 100644 sapi/cli/php_cli_process_title.stub.php create mode 100644 sapi/cli/php_cli_process_title_arginfo.h create mode 100644 sapi/cli/php_cli_server.stub.php create mode 100644 sapi/cli/php_cli_server_arginfo.h diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index acbe69a7a9..8048085ebe 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -63,6 +63,7 @@ #include "fopen_wrappers.h" #include "http_status_codes.h" #include "ext/standard/php_standard.h" +#include "ext/standard/dl_arginfo.h" #include "ext/standard/url.h" #ifdef PHP_WIN32 @@ -83,6 +84,7 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS; #include "php_getopt.h" #include "fastcgi.h" +#include "cgi_main_arginfo.h" #if defined(PHP_WIN32) && defined(HAVE_OPENSSL) # include "openssl/applink.c" @@ -1006,12 +1008,6 @@ static sapi_module_struct cgi_sapi_module = { }; /* }}} */ -/* {{{ arginfo ext/standard/dl.c */ -ZEND_BEGIN_ARG_INFO(arginfo_dl, 0) - ZEND_ARG_INFO(0, extension_filename) -ZEND_END_ARG_INFO() -/* }}} */ - static const zend_function_entry additional_functions[] = { ZEND_FE(dl, arginfo_dl) PHP_FE_END @@ -1704,21 +1700,10 @@ PHP_FUNCTION(apache_response_headers) /* {{{ */ } /* }}} */ -ZEND_BEGIN_ARG_INFO(arginfo_no_args, 0) -ZEND_END_ARG_INFO() - -static const zend_function_entry cgi_functions[] = { - PHP_FE(apache_child_terminate, arginfo_no_args) - PHP_FE(apache_request_headers, arginfo_no_args) - PHP_FE(apache_response_headers, arginfo_no_args) - PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args) - PHP_FE_END -}; - static zend_module_entry cgi_module_entry = { STANDARD_MODULE_HEADER, "cgi-fcgi", - cgi_functions, + ext_functions, PHP_MINIT(cgi), PHP_MSHUTDOWN(cgi), NULL, diff --git a/sapi/cgi/cgi_main.stub.php b/sapi/cgi/cgi_main.stub.php new file mode 100644 index 0000000000..8273cffdc2 --- /dev/null +++ b/sapi/cgi/cgi_main.stub.php @@ -0,0 +1,12 @@ + @@ -78,6 +79,7 @@ #include "ps_title.h" #include "php_cli_process_title.h" +#include "php_cli_process_title_arginfo.h" #ifndef PHP_WIN32 # define php_select(m, r, w, e, t) select(m, r, w, e, t) @@ -457,12 +459,6 @@ static sapi_module_struct cli_sapi_module = { }; /* }}} */ -/* {{{ arginfo ext/standard/dl.c */ -ZEND_BEGIN_ARG_INFO(arginfo_dl, 0) - ZEND_ARG_INFO(0, extension_filename) -ZEND_END_ARG_INFO() -/* }}} */ - static const zend_function_entry additional_functions[] = { ZEND_FE(dl, arginfo_dl) PHP_FE(cli_set_process_title, arginfo_cli_set_process_title) diff --git a/sapi/cli/php_cli_process_title.h b/sapi/cli/php_cli_process_title.h index 74766491d7..c286f401c7 100644 --- a/sapi/cli/php_cli_process_title.h +++ b/sapi/cli/php_cli_process_title.h @@ -17,13 +17,6 @@ #ifndef PHP_PS_TITLE_HEADER #define PHP_PS_TITLE_HEADER -ZEND_BEGIN_ARG_INFO(arginfo_cli_set_process_title, 0) - ZEND_ARG_INFO(0, title) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_cli_get_process_title, 0) -ZEND_END_ARG_INFO() - PHP_FUNCTION(cli_set_process_title); PHP_FUNCTION(cli_get_process_title); diff --git a/sapi/cli/php_cli_process_title.stub.php b/sapi/cli/php_cli_process_title.stub.php new file mode 100644 index 0000000000..97dc8b2770 --- /dev/null +++ b/sapi/cli/php_cli_process_title.stub.php @@ -0,0 +1,5 @@ + @@ -142,12 +143,6 @@ EMBED_SAPI_API sapi_module_struct php_embed_module = { }; /* }}} */ -/* {{{ arginfo ext/standard/dl.c */ -ZEND_BEGIN_ARG_INFO(arginfo_dl, 0) - ZEND_ARG_INFO(0, extension_filename) -ZEND_END_ARG_INFO() -/* }}} */ - static const zend_function_entry additional_functions[] = { ZEND_FE(dl, arginfo_dl) ZEND_FE_END -- 2.40.0