summaryrefslogtreecommitdiff
path: root/sapi/apache2handler
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-05-14 13:31:52 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-05-14 13:35:12 +0200
commit68527a7834eec98dc33af2fe053c31ce64e745c6 (patch)
tree5694ae624bddc1515889f85b4db2375de92139b4 /sapi/apache2handler
parent161ee110bf6a0abb673cdf7429868be62236207d (diff)
downloadphp-git-68527a7834eec98dc33af2fe053c31ce64e745c6.tar.gz
Add stubs for some SAPIs
For apache2handler, fpm, litespeed, phpdbg, specifically. Partially implements GH-5295
Diffstat (limited to 'sapi/apache2handler')
-rw-r--r--sapi/apache2handler/php_functions.c16
-rw-r--r--sapi/apache2handler/php_functions.stub.php3
-rw-r--r--sapi/apache2handler/php_functions_arginfo.h26
3 files changed, 30 insertions, 15 deletions
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index d1aa2d587c..5c9e03a1f8 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -476,20 +476,6 @@ PHP_MINFO_FUNCTION(apache)
}
}
-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)
@@ -514,7 +500,7 @@ static PHP_MSHUTDOWN_FUNCTION(apache)
zend_module_entry php_apache_module = {
STANDARD_MODULE_HEADER,
"apache2handler",
- apache_functions,
+ ext_functions,
PHP_MINIT(apache),
PHP_MSHUTDOWN(apache),
NULL,
diff --git a/sapi/apache2handler/php_functions.stub.php b/sapi/apache2handler/php_functions.stub.php
index 5b2835ac3a..391600be6c 100644
--- a/sapi/apache2handler/php_functions.stub.php
+++ b/sapi/apache2handler/php_functions.stub.php
@@ -1,11 +1,14 @@
<?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 {}
diff --git a/sapi/apache2handler/php_functions_arginfo.h b/sapi/apache2handler/php_functions_arginfo.h
index a99296abb0..739afbbc8b 100644
--- a/sapi/apache2handler/php_functions_arginfo.h
+++ b/sapi/apache2handler/php_functions_arginfo.h
@@ -35,3 +35,29 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_apache_get_version, 0, 0, MAY_BE
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
+};