mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
feat: add stub PHP functions (#10)
This commit is contained in:
22
frankenphp.c
22
frankenphp.c
@@ -16,6 +16,7 @@
|
||||
#include "C-Thread-Pool/thpool.h"
|
||||
#include "C-Thread-Pool/thpool.c"
|
||||
|
||||
#include "frankenphp_arginfo.h"
|
||||
#include "_cgo_export.h"
|
||||
|
||||
#if defined(PHP_WIN32) && defined(ZTS)
|
||||
@@ -118,10 +119,6 @@ int frankenphp_worker_request_startup() {
|
||||
return retval;
|
||||
}
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_frankenphp_handle_request, 0, 0, 1)
|
||||
ZEND_ARG_CALLABLE_INFO(false, handler, false)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
PHP_FUNCTION(frankenphp_handle_request) {
|
||||
zend_fcall_info fci;
|
||||
zend_fcall_info_cache fcc;
|
||||
@@ -193,20 +190,15 @@ PHP_FUNCTION(frankenphp_handle_request) {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
static const zend_function_entry frankenphp_ext_functions[] = {
|
||||
PHP_FE(frankenphp_handle_request, arginfo_frankenphp_handle_request)
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
static zend_module_entry frankenphp_module = {
|
||||
STANDARD_MODULE_HEADER,
|
||||
"frankenphp",
|
||||
frankenphp_ext_functions, /* function table */
|
||||
NULL, /* initialization */
|
||||
NULL, /* shutdown */
|
||||
NULL, /* request initialization */
|
||||
NULL, /* request shutdown */
|
||||
NULL, /* information */
|
||||
ext_functions, /* function table */
|
||||
NULL, /* initialization */
|
||||
NULL, /* shutdown */
|
||||
NULL, /* request initialization */
|
||||
NULL, /* request shutdown */
|
||||
NULL, /* information */
|
||||
"dev",
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
5
frankenphp.stub.php
Normal file
5
frankenphp.stub.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
/** @generate-class-entries */
|
||||
|
||||
function frankenphp_handle_request(callable $callback): bool {}
|
||||
15
frankenphp_arginfo.h
Normal file
15
frankenphp_arginfo.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: f2e8375a3acb3080fc6c329eafc47155f0702c85 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_frankenphp_handle_request, 0, 1, _IS_BOOL, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
|
||||
ZEND_FUNCTION(frankenphp_handle_request);
|
||||
|
||||
|
||||
static const zend_function_entry ext_functions[] = {
|
||||
ZEND_FE(frankenphp_handle_request, arginfo_frankenphp_handle_request)
|
||||
ZEND_FE_END
|
||||
};
|
||||
Reference in New Issue
Block a user