Commit 1010592e784 for php
commit 1010592e7841627fe7bad39cd817108c227d0891
Author: Calvin Buckley <calvinb@php.net>
Date: Fri Nov 27 13:51:30 2026 -0400
sapi: Remove sapi_activate_headers_only (#24051)
Introduced in 99c7ddc3a8f9ecf1a3968f6e59dc9d95106bb0c7; previously
called in some SAPIs, but the callsites have all been removed for years.
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index a2f9bc7f01c..3ad42019b58 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -65,6 +65,7 @@ PHP 8.7 INTERNALS UPGRADE NOTES
. The sapi_get_fd() function was removed.
. The sapi_get_target_uid() function was removed.
. The sapi_get_target_gid() function was removed.
+ . The sapi_activate_headers_only() function was removed.
. Removed zend_hrtime_posix_clock_id. zend_hrtime() always uses
CLOCK_MONOTONIC on POSIX platforms.
. The INIT_CLASS_ENTRY_INIT_METHODS() macro, which was previously used as
diff --git a/main/SAPI.c b/main/SAPI.c
index 4c84a74423b..f85c0a7c95a 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -360,45 +360,6 @@ SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len)
return 0;
}
-SAPI_API void sapi_activate_headers_only(void)
-{
- if (SG(request_info).headers_read == 1)
- return;
- SG(request_info).headers_read = 1;
- zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct),
- (void (*)(void *)) sapi_free_header, 0);
- SG(sapi_headers).send_default_content_type = 1;
-
- /* SG(sapi_headers).http_response_code = 200; */
- SG(sapi_headers).http_status_line = NULL;
- SG(sapi_headers).mimetype = NULL;
- SG(read_post_bytes) = 0;
- SG(request_info).request_body = NULL;
- SG(request_info).current_user = NULL;
- SG(request_info).no_headers = 0;
- SG(request_info).post_entry = NULL;
- SG(global_request_time) = 0;
-
- /*
- * It's possible to override this general case in the activate() callback,
- * if necessary.
- */
- if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
- if (SG(server_context)) {
- SG(request_info).cookie_data = sapi_module.read_cookies();
- if (sapi_module.activate) {
- sapi_module.activate();
- }
- }
- if (sapi_module.input_filter_init ) {
- sapi_module.input_filter_init();
- }
-}
-
/*
* Called from php_request_startup() for every request.
*/
diff --git a/main/SAPI.h b/main/SAPI.h
index 95a0b86341e..373f13564e7 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -226,7 +226,6 @@ SAPI_API char *sapi_getenv(const char *name, size_t name_len);
SAPI_API char *sapi_get_default_content_type(void);
SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header);
SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len);
-SAPI_API void sapi_activate_headers_only(void);
SAPI_API double sapi_get_request_time(void);
END_EXTERN_C()