mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Add stubs for SAPIs
Closes GH-5295.
This commit is contained in:
parent
db43a93fc2
commit
f328594072
@ -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,
|
||||
|
12
sapi/cgi/cgi_main.stub.php
Normal file
12
sapi/cgi/cgi_main.stub.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/** @generate-function-entries */
|
||||
|
||||
function apache_child_terminate(): void {}
|
||||
|
||||
function apache_request_headers(): array {}
|
||||
|
||||
/** @alias apache_request_headers */
|
||||
function getallheaders(): array {}
|
||||
|
||||
function apache_response_headers(): array {}
|
26
sapi/cgi/cgi_main_arginfo.h
Normal file
26
sapi/cgi/cgi_main_arginfo.h
Normal file
@ -0,0 +1,26 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: ccb32ad91944af15fe1fcb44b97c28a79c1aad86 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_apache_child_terminate, 0, 0, IS_VOID, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_apache_request_headers, 0, 0, IS_ARRAY, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_getallheaders arginfo_apache_request_headers
|
||||
|
||||
#define arginfo_apache_response_headers arginfo_apache_request_headers
|
||||
|
||||
|
||||
ZEND_FUNCTION(apache_child_terminate);
|
||||
ZEND_FUNCTION(apache_request_headers);
|
||||
ZEND_FUNCTION(apache_response_headers);
|
||||
|
||||
|
||||
static const zend_function_entry ext_functions[] = {
|
||||
ZEND_FE(apache_child_terminate, arginfo_apache_child_terminate)
|
||||
ZEND_FE(apache_request_headers, arginfo_apache_request_headers)
|
||||
ZEND_FALIAS(getallheaders, apache_request_headers, arginfo_getallheaders)
|
||||
ZEND_FE(apache_response_headers, arginfo_apache_response_headers)
|
||||
ZEND_FE_END
|
||||
};
|
@ -54,6 +54,7 @@
|
||||
#include "php_main.h"
|
||||
#include "fopen_wrappers.h"
|
||||
#include "ext/standard/php_standard.h"
|
||||
#include "ext/standard/dl_arginfo.h"
|
||||
#include "cli.h"
|
||||
#ifdef PHP_WIN32
|
||||
#include <io.h>
|
||||
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
5
sapi/cli/php_cli_process_title.stub.php
Normal file
5
sapi/cli/php_cli_process_title.stub.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
function cli_set_process_title(string $title): bool {}
|
||||
|
||||
function cli_get_process_title(): ?string {}
|
9
sapi/cli/php_cli_process_title_arginfo.h
Normal file
9
sapi/cli/php_cli_process_title_arginfo.h
Normal file
@ -0,0 +1,9 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: ee776e0c54fe4b66a98b3a0203af11c5f3082e38 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cli_set_process_title, 0, 1, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, title, IS_STRING, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cli_get_process_title, 0, 0, IS_STRING, 1)
|
||||
ZEND_END_ARG_INFO()
|
@ -91,9 +91,11 @@
|
||||
|
||||
#include "php_http_parser.h"
|
||||
#include "php_cli_server.h"
|
||||
#include "php_cli_server_arginfo.h"
|
||||
#include "mime_type_map.h"
|
||||
|
||||
#include "php_cli_process_title.h"
|
||||
#include "php_cli_process_title_arginfo.h"
|
||||
|
||||
#define OUTPUT_NOT_CHECKED -1
|
||||
#define OUTPUT_IS_TTY 1
|
||||
@ -479,15 +481,12 @@ zend_module_entry cli_server_module_entry = {
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_no_args, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
const zend_function_entry server_additional_functions[] = {
|
||||
PHP_FE(cli_set_process_title, arginfo_cli_set_process_title)
|
||||
PHP_FE(cli_get_process_title, arginfo_cli_get_process_title)
|
||||
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(cli_set_process_title, arginfo_cli_set_process_title)
|
||||
PHP_FE(cli_get_process_title, arginfo_cli_get_process_title)
|
||||
PHP_FE(apache_request_headers, arginfo_apache_request_headers)
|
||||
PHP_FE(apache_response_headers, arginfo_apache_response_headers)
|
||||
PHP_FALIAS(getallheaders, apache_request_headers, arginfo_getallheaders)
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
|
7
sapi/cli/php_cli_server.stub.php
Normal file
7
sapi/cli/php_cli_server.stub.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
function apache_request_headers(): array {}
|
||||
|
||||
function apache_response_headers(): array {}
|
||||
|
||||
function getallheaders(): array {}
|
9
sapi/cli/php_cli_server_arginfo.h
Normal file
9
sapi/cli/php_cli_server_arginfo.h
Normal file
@ -0,0 +1,9 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 60cd531d36a34fe7c51982e9ec40b45d2a2a4ce7 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_apache_request_headers, 0, 0, IS_ARRAY, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_apache_response_headers arginfo_apache_request_headers
|
||||
|
||||
#define arginfo_getallheaders arginfo_apache_request_headers
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include "php_embed.h"
|
||||
#include "ext/standard/php_standard.h"
|
||||
#include "ext/standard/dl_arginfo.h"
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#include <io.h>
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user