For apache2handler, fpm, litespeed, phpdbg, specifically.
Partially implements GH-5295
#endif
#endif /* defined(HAVE_LIBDL) */
-/* {{{ proto int dl(string extension_filename)
+/* {{{ proto bool dl(string extension_filename)
Load a PHP extension at runtime */
PHPAPI PHP_FUNCTION(dl)
{
--- /dev/null
+<?php
+
+function dl(string $extension_filename): bool {}
--- /dev/null
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dl, 0, 1, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO(0, extension_filename, IS_STRING, 0)
+ZEND_END_ARG_INFO()
}
}
-static const zend_function_entry apache_functions[] = {
- PHP_FE(apache_lookup_uri, arginfo_apache_lookup_uri)
- PHP_FE(virtual, arginfo_virtual)
- PHP_FE(apache_request_headers, arginfo_apache_request_headers)
- PHP_FE(apache_response_headers, arginfo_apache_response_headers)
- PHP_FE(apache_setenv, arginfo_apache_setenv)
- PHP_FE(apache_getenv, arginfo_apache_getenv)
- PHP_FE(apache_note, arginfo_apache_note)
- PHP_FE(apache_get_version, arginfo_apache_get_version)
- PHP_FE(apache_get_modules, arginfo_apache_get_modules)
- PHP_FALIAS(getallheaders, apache_request_headers, arginfo_getallheaders)
- {NULL, NULL, NULL}
-};
-
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateBool, xbithack, php_apache2_info_struct, php_apache2_info)
STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateBool, engine, php_apache2_info_struct, php_apache2_info)
zend_module_entry php_apache_module = {
STANDARD_MODULE_HEADER,
"apache2handler",
- apache_functions,
+ ext_functions,
PHP_MINIT(apache),
PHP_MSHUTDOWN(apache),
NULL,
<?php
+/** @generate-function-entries */
+
function apache_lookup_uri(string $filename): object|false {}
function virtual(string $uri): bool {}
function apache_request_headers(): array {}
+/** @alias apache_request_headers */
function getallheaders(): array {}
function apache_response_headers(): array {}
ZEND_END_ARG_INFO()
#define arginfo_apache_get_modules arginfo_apache_request_headers
+
+
+ZEND_FUNCTION(apache_lookup_uri);
+ZEND_FUNCTION(virtual);
+ZEND_FUNCTION(apache_request_headers);
+ZEND_FUNCTION(apache_response_headers);
+ZEND_FUNCTION(apache_note);
+ZEND_FUNCTION(apache_setenv);
+ZEND_FUNCTION(apache_getenv);
+ZEND_FUNCTION(apache_get_version);
+ZEND_FUNCTION(apache_get_modules);
+
+
+static const zend_function_entry ext_functions[] = {
+ ZEND_FE(apache_lookup_uri, arginfo_apache_lookup_uri)
+ ZEND_FE(virtual, arginfo_virtual)
+ 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(apache_note, arginfo_apache_note)
+ ZEND_FE(apache_setenv, arginfo_apache_setenv)
+ ZEND_FE(apache_getenv, arginfo_apache_getenv)
+ ZEND_FE(apache_get_version, arginfo_apache_get_version)
+ ZEND_FE(apache_get_modules, arginfo_apache_get_modules)
+ ZEND_FE_END
+};
#include <php_config.h>
#include "fpm.h"
+#include "fpm_main_arginfo.h"
#include "fpm_request.h"
#include "fpm_status.h"
#include "fpm_signals.h"
}
/* }}} */
-ZEND_BEGIN_ARG_INFO(cgi_fcgi_sapi_no_arginfo, 0)
-ZEND_END_ARG_INFO()
-
PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
{
fcgi_request *request = (fcgi_request*) SG(server_context);
}
/* }}} */
-static const zend_function_entry cgi_fcgi_sapi_functions[] = {
- PHP_FE(fastcgi_finish_request, cgi_fcgi_sapi_no_arginfo)
- PHP_FE(fpm_get_status, cgi_fcgi_sapi_no_arginfo)
- PHP_FE(apache_request_headers, cgi_fcgi_sapi_no_arginfo)
- PHP_FALIAS(getallheaders, apache_request_headers, cgi_fcgi_sapi_no_arginfo)
- PHP_FE_END
-};
-
static zend_module_entry cgi_module_entry = {
STANDARD_MODULE_HEADER,
"cgi-fcgi",
- cgi_fcgi_sapi_functions,
+ ext_functions,
PHP_MINIT(cgi),
PHP_MSHUTDOWN(cgi),
NULL,
--- /dev/null
+<?php
+
+/** @generate-function-entries */
+
+function fastcgi_finish_request(): bool {}
+
+function apache_request_headers(): array {}
+
+/** @alias apache_request_headers */
+function getallheaders(): array {}
+
+function fpm_get_status(): array|false {}
--- /dev/null
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fastcgi_finish_request, 0, 0, _IS_BOOL, 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
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fpm_get_status, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
+ZEND_END_ARG_INFO()
+
+
+ZEND_FUNCTION(fastcgi_finish_request);
+ZEND_FUNCTION(apache_request_headers);
+ZEND_FUNCTION(fpm_get_status);
+
+
+static const zend_function_entry ext_functions[] = {
+ ZEND_FE(fastcgi_finish_request, arginfo_fastcgi_finish_request)
+ ZEND_FE(apache_request_headers, arginfo_apache_request_headers)
+ ZEND_FALIAS(getallheaders, apache_request_headers, arginfo_getallheaders)
+ ZEND_FE(fpm_get_status, arginfo_fpm_get_status)
+ ZEND_FE_END
+};
#include "ext/standard/basic_functions.h"
#include "ext/standard/info.h"
#include "lsapilib.h"
+#include "lsapi_main_arginfo.h"
#include <stdio.h>
#include <stdlib.h>
/* LiteSpeed PHP module starts here */
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO(arginfo_litespeed__void, 0)
-ZEND_END_ARG_INFO()
-/* }}} */
-
PHP_FUNCTION(litespeed_request_headers);
PHP_FUNCTION(litespeed_response_headers);
PHP_FUNCTION(apache_get_modules);
PHP_MINFO_FUNCTION(litespeed);
-static const zend_function_entry litespeed_functions[] = {
- PHP_FE(litespeed_request_headers, arginfo_litespeed__void)
- PHP_FE(litespeed_response_headers, arginfo_litespeed__void)
- PHP_FE(apache_get_modules, arginfo_litespeed__void)
- PHP_FE(litespeed_finish_request, arginfo_litespeed__void)
- PHP_FALIAS(getallheaders, litespeed_request_headers, arginfo_litespeed__void)
- PHP_FALIAS(apache_request_headers, litespeed_request_headers, arginfo_litespeed__void)
- PHP_FALIAS(apache_response_headers, litespeed_response_headers, arginfo_litespeed__void)
- {NULL, NULL, NULL}
-};
-
static PHP_MINIT_FUNCTION(litespeed)
{
user_config_cache_init();
zend_module_entry litespeed_module_entry = {
STANDARD_MODULE_HEADER,
"litespeed",
- litespeed_functions,
+ ext_functions,
PHP_MINIT(litespeed),
PHP_MSHUTDOWN(litespeed),
NULL,
Fetch all HTTP request headers */
PHP_FUNCTION(litespeed_request_headers)
{
- /* TODO: */
- if (ZEND_NUM_ARGS() > 0) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
}
+
array_init(return_value);
LSAPI_ForeachOrgHeader( add_associate_array, return_value );
-
}
/* }}} */
int len;
char headerBuf[SAPI_LSAPI_MAX_HEADER_LENGTH];
- if (ZEND_NUM_ARGS() > 0) {
- WRONG_PARAM_COUNT;
- }
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
if (!&SG(sapi_headers).headers) {
RETURN_FALSE;
"mod_rewrite", "mod_mime", "mod_headers", "mod_expires", "mod_auth_basic", NULL
};
const char **name = mod_names;
- /* TODO: */
- if (ZEND_NUM_ARGS() > 0) {
- WRONG_PARAM_COUNT;
- }
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
+
array_init(return_value);
while( *name )
{
/* }}} */
-/* {{{ proto array litespeed_finish_request(void)
+/* {{{ proto bool litespeed_finish_request(void)
Flushes all response data to the client */
PHP_FUNCTION(litespeed_finish_request)
{
- if (ZEND_NUM_ARGS() > 0) {
- WRONG_PARAM_COUNT;
- }
+ if (zend_parse_parameters_none() == FAILURE) {
+ RETURN_THROWS();
+ }
php_output_end_all();
php_header();
--- /dev/null
+<?php
+
+/** @generate-function-entries */
+
+function litespeed_request_headers(): array {}
+
+/** @alias litespeed_request_headers */
+function getallheaders(): array {}
+
+/** @alias litespeed_request_headers */
+function apache_request_headers(): array {}
+
+function litespeed_response_headers(): array|false {}
+
+/** @alias litespeed_response_headers */
+function apache_response_headers(): array|false {}
+
+function apache_get_modules(): array {}
+
+function litespeed_finish_request(): bool {}
--- /dev/null
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_litespeed_request_headers, 0, 0, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_getallheaders arginfo_litespeed_request_headers
+
+#define arginfo_apache_request_headers arginfo_litespeed_request_headers
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_litespeed_response_headers, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
+ZEND_END_ARG_INFO()
+
+#define arginfo_apache_response_headers arginfo_litespeed_response_headers
+
+#define arginfo_apache_get_modules arginfo_litespeed_request_headers
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_litespeed_finish_request, 0, 0, _IS_BOOL, 0)
+ZEND_END_ARG_INFO()
+
+
+ZEND_FUNCTION(litespeed_request_headers);
+ZEND_FUNCTION(litespeed_response_headers);
+ZEND_FUNCTION(apache_get_modules);
+ZEND_FUNCTION(litespeed_finish_request);
+
+
+static const zend_function_entry ext_functions[] = {
+ ZEND_FE(litespeed_request_headers, arginfo_litespeed_request_headers)
+ ZEND_FALIAS(getallheaders, litespeed_request_headers, arginfo_getallheaders)
+ ZEND_FALIAS(apache_request_headers, litespeed_request_headers, arginfo_apache_request_headers)
+ ZEND_FE(litespeed_response_headers, arginfo_litespeed_response_headers)
+ ZEND_FALIAS(apache_response_headers, litespeed_response_headers, arginfo_apache_response_headers)
+ ZEND_FE(apache_get_modules, arginfo_apache_get_modules)
+ ZEND_FE(litespeed_finish_request, arginfo_litespeed_finish_request)
+ ZEND_FE_END
+};
If the execution context was set previously it is returned
If the execution context was not set previously boolean true is returned
If the request to set the context fails, boolean false is returned, and an E_WARNING raised */
-static PHP_FUNCTION(phpdbg_exec)
+PHP_FUNCTION(phpdbg_exec)
{
zend_string *exec;
/* {{{ proto void phpdbg_break()
instructs phpdbg to insert a breakpoint at the next opcode */
-static PHP_FUNCTION(phpdbg_break_next)
+PHP_FUNCTION(phpdbg_break_next)
{
zend_execute_data *ex;
} /* }}} */
/* {{{ proto void phpdbg_break_file(string file, int line) */
-static PHP_FUNCTION(phpdbg_break_file)
+PHP_FUNCTION(phpdbg_break_file)
{
char *file;
size_t flen;
} /* }}} */
/* {{{ proto void phpdbg_break_method(string class, string method) */
-static PHP_FUNCTION(phpdbg_break_method)
+PHP_FUNCTION(phpdbg_break_method)
{
char *class, *method;
size_t clen, mlen;
} /* }}} */
/* {{{ proto void phpdbg_break_function(string function) */
-static PHP_FUNCTION(phpdbg_break_function)
+PHP_FUNCTION(phpdbg_break_function)
{
char *function;
size_t function_len;
/* {{{ proto void phpdbg_clear(void)
instructs phpdbg to clear breakpoints */
-static PHP_FUNCTION(phpdbg_clear)
+PHP_FUNCTION(phpdbg_clear)
{
if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS();
} /* }}} */
/* {{{ proto void phpdbg_color(int element, string color) */
-static PHP_FUNCTION(phpdbg_color)
+PHP_FUNCTION(phpdbg_color)
{
zend_long element;
char *color;
} /* }}} */
/* {{{ proto void phpdbg_prompt(string prompt) */
-static PHP_FUNCTION(phpdbg_prompt)
+PHP_FUNCTION(phpdbg_prompt)
{
char *prompt = NULL;
size_t prompt_len = 0;
} /* }}} */
/* {{{ proto void phpdbg_start_oplog() */
-static PHP_FUNCTION(phpdbg_start_oplog)
+PHP_FUNCTION(phpdbg_start_oplog)
{
phpdbg_oplog_list *prev;
}
/* {{{ proto void phpdbg_get_executable() */
-static PHP_FUNCTION(phpdbg_get_executable)
+PHP_FUNCTION(phpdbg_get_executable)
{
HashTable *options = NULL;
zval *option_buffer;
}
/* {{{ proto void phpdbg_end_oplog() */
-static PHP_FUNCTION(phpdbg_end_oplog)
+PHP_FUNCTION(phpdbg_end_oplog)
{
phpdbg_oplog_entry *cur;
phpdbg_oplog_list *prev;
}
}
-static const zend_function_entry phpdbg_user_functions[] = {
- PHP_FE(phpdbg_clear, arginfo_phpdbg_clear)
- PHP_FE(phpdbg_break_next, arginfo_phpdbg_break_next)
- PHP_FE(phpdbg_break_file, arginfo_phpdbg_break_file)
- PHP_FE(phpdbg_break_method, arginfo_phpdbg_break_method)
- PHP_FE(phpdbg_break_function, arginfo_phpdbg_break_function)
- PHP_FE(phpdbg_exec, arginfo_phpdbg_exec)
- PHP_FE(phpdbg_color, arginfo_phpdbg_color)
- PHP_FE(phpdbg_prompt, arginfo_phpdbg_prompt)
- PHP_FE(phpdbg_start_oplog, arginfo_phpdbg_start_oplog)
- PHP_FE(phpdbg_end_oplog, arginfo_phpdbg_end_oplog)
- PHP_FE(phpdbg_get_executable, arginfo_phpdbg_get_executable)
-#ifdef PHP_FE_END
- PHP_FE_END
-#else
- {NULL,NULL,NULL}
-#endif
-};
-
static zend_module_entry sapi_phpdbg_module_entry = {
STANDARD_MODULE_HEADER,
PHPDBG_NAME,
- phpdbg_user_functions,
+ ext_functions,
PHP_MINIT(phpdbg),
PHP_MSHUTDOWN(phpdbg),
PHP_RINIT(phpdbg),
<?php
+/** @generate-function-entries */
+
function phpdbg_break_next(): void {}
function phpdbg_break_file(string $file, int $line): void {}
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phpdbg_get_executable, 0, 0, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
+
+
+ZEND_FUNCTION(phpdbg_break_next);
+ZEND_FUNCTION(phpdbg_break_file);
+ZEND_FUNCTION(phpdbg_break_method);
+ZEND_FUNCTION(phpdbg_break_function);
+ZEND_FUNCTION(phpdbg_color);
+ZEND_FUNCTION(phpdbg_prompt);
+ZEND_FUNCTION(phpdbg_exec);
+ZEND_FUNCTION(phpdbg_clear);
+ZEND_FUNCTION(phpdbg_start_oplog);
+ZEND_FUNCTION(phpdbg_end_oplog);
+ZEND_FUNCTION(phpdbg_get_executable);
+
+
+static const zend_function_entry ext_functions[] = {
+ ZEND_FE(phpdbg_break_next, arginfo_phpdbg_break_next)
+ ZEND_FE(phpdbg_break_file, arginfo_phpdbg_break_file)
+ ZEND_FE(phpdbg_break_method, arginfo_phpdbg_break_method)
+ ZEND_FE(phpdbg_break_function, arginfo_phpdbg_break_function)
+ ZEND_FE(phpdbg_color, arginfo_phpdbg_color)
+ ZEND_FE(phpdbg_prompt, arginfo_phpdbg_prompt)
+ ZEND_FE(phpdbg_exec, arginfo_phpdbg_exec)
+ ZEND_FE(phpdbg_clear, arginfo_phpdbg_clear)
+ ZEND_FE(phpdbg_start_oplog, arginfo_phpdbg_start_oplog)
+ ZEND_FE(phpdbg_end_oplog, arginfo_phpdbg_end_oplog)
+ ZEND_FE(phpdbg_get_executable, arginfo_phpdbg_get_executable)
+ ZEND_FE_END
+};