Formatting.

This commit is contained in:
Alliballibaba
2024-11-21 23:42:16 +01:00
parent 83602f0db5
commit 912038e787
2 changed files with 25 additions and 24 deletions

View File

@@ -1178,8 +1178,6 @@ int frankenphp_reset_opcache(void) {
return 0;
}
PHP_FUNCTION(frankenphp_cache_put) /* {{{ */
{
char *key;
@@ -1209,9 +1207,10 @@ PHP_FUNCTION(frankenphp_cache_get) /* {{{ */
Z_PARAM_STRING(key, l_key);
ZEND_PARSE_PARAMETERS_END();
struct go_frankenphp_cache_get_return from_cache = go_frankenphp_cache_get(key);
if(from_cache.r0 == NULL) {
RETURN_NULL();
struct go_frankenphp_cache_get_return from_cache =
go_frankenphp_cache_get(key);
if (from_cache.r0 == NULL) {
RETURN_NULL();
}
RETURN_STRINGL(from_cache.r0, from_cache.r1);
}

View File

@@ -36,17 +36,16 @@ ZEND_FUNCTION(frankenphp_finish_request);
ZEND_FUNCTION(frankenphp_request_headers);
ZEND_FUNCTION(frankenphp_response_headers);
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_frankenphp_cache_put, 0,
0, MAY_BE_BOOL)
// MEMORY CACHE
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_frankenphp_cache_put, 0, 0,
MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 1)
// pass_by_ref, name, type_hint, allow_null, default_value
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ttl, IS_LONG, 0, "-1")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_frankenphp_cache_get, 0,
1, MAY_BE_STRING | MAY_BE_NULL)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_frankenphp_cache_get, 0, 1,
MAY_BE_STRING | MAY_BE_NULL)
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_frankenphp_cache_forget, 0, 0, 0)
@@ -60,17 +59,20 @@ ZEND_FUNCTION(frankenphp_cache_put);
ZEND_FUNCTION(frankenphp_cache_get);
ZEND_FUNCTION(frankenphp_cache_forget);
// clang-format off
static const zend_function_entry ext_functions[] = {
ZEND_FE(frankenphp_handle_request, arginfo_frankenphp_handle_request)
ZEND_FE(headers_send, arginfo_headers_send)
ZEND_FE(frankenphp_finish_request, arginfo_frankenphp_finish_request)
ZEND_FALIAS(fastcgi_finish_request, frankenphp_finish_request, arginfo_fastcgi_finish_request)
ZEND_FE(frankenphp_request_headers, arginfo_frankenphp_request_headers)
ZEND_FALIAS(apache_request_headers, frankenphp_request_headers, arginfo_apache_request_headers)
ZEND_FALIAS(getallheaders, frankenphp_request_headers, arginfo_getallheaders)
ZEND_FE(frankenphp_response_headers, arginfo_frankenphp_response_headers)
ZEND_FALIAS(apache_response_headers, frankenphp_response_headers, arginfo_apache_response_headers)
ZEND_FE(frankenphp_cache_put, arginfo_frankenphp_cache_put)
ZEND_FE(frankenphp_cache_get, arginfo_frankenphp_cache_get)
ZEND_FE(frankenphp_cache_forget, arginfo_frankenphp_cache_forget)
ZEND_FE_END};
ZEND_FE(frankenphp_handle_request, arginfo_frankenphp_handle_request)
ZEND_FE(headers_send, arginfo_headers_send)
ZEND_FE(frankenphp_finish_request, arginfo_frankenphp_finish_request)
ZEND_FALIAS(fastcgi_finish_request, frankenphp_finish_request, arginfo_fastcgi_finish_request)
ZEND_FE(frankenphp_request_headers, arginfo_frankenphp_request_headers)
ZEND_FALIAS(apache_request_headers, frankenphp_request_headers, arginfo_apache_request_headers)
ZEND_FALIAS(getallheaders, frankenphp_request_headers, arginfo_getallheaders)
ZEND_FE(frankenphp_response_headers, arginfo_frankenphp_response_headers)
ZEND_FALIAS(apache_response_headers, frankenphp_response_headers, arginfo_apache_response_headers)
ZEND_FE(frankenphp_cache_put, arginfo_frankenphp_cache_put)
ZEND_FE(frankenphp_cache_get, arginfo_frankenphp_cache_get)
ZEND_FE(frankenphp_cache_forget, arginfo_frankenphp_cache_forget)
ZEND_FE_END
};
// clang-format on