[php-src] master: sapi: Remove unused SAPI methods which are in default SAPI properties (#23525)
| From: | Calvin Buckley via GitHub | Date: | Mon, 28 Sep 2026 19:24:45 +0000 |
| Subject: | [php-src] master: sapi: Remove unused SAPI methods which are in default SAPI properties (#23525) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141637@lists.php.net to get a copy of this message | ||
Author: Calvin Buckley (NattyNarwhal)
Committer: GitHub (web-flow)
Pusher: NattyNarwhal
Date: 2026-09-28T16:24:42-03:00
Commit: https://github.com/php/php-src/commit/cef90076ea3b3eba423cc5bb3cbe02000a36c42a
Raw diff: https://github.com/php/php-src/commit/cef90076ea3b3eba423cc5bb3cbe02000a36c42a.diff
sapi: Remove unused SAPI methods which are in default SAPI properties (#23525)
* sapi: Remove sapi_force_http_10
This was introduced in 2b95b3c83ba2ab5c695b9bfef1054ec73b7b4ccc.
This is not used anywhere and the value is dubious.
* sapi: Remove sapi_get_fd
This was introduced in 09f463ddae79c53a065d28da61a33fda96669f84.
This is not used anywhere.
* sapi: Remove sapi_get_target_[ug]id
These were introduced in 294e776d950f7393faad5a96988c5122edf23e66.
These are not used anywhere.
Changed paths:
M UPGRADING.INTERNALS
M main/SAPI.c
M main/SAPI.h
Diff:
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 47ba6dd51a59..bce419d784e4 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -18,6 +18,9 @@ PHP 8.7 INTERNALS UPGRADE NOTES
instead.
- Removed ZEND_STATIC_ASSERT(). Use C11 static_assert() directly instead.
- The sapi_terminate_process() function was removed.
+- The sapi_force_http_10() function was removed.
+- The sapi_get_fd() function was removed.
+- The sapi_get_target_uid() and sapi_get_target_gid() functions were removed.
========================
2. Build system changes
@@ -42,4 +45,8 @@ PHP 8.7 INTERNALS UPGRADE NOTES
5. SAPI changes
========================
-- The terminate_process method has been removed.
+- The size of the SAPI structure has changed.
+ . The terminate_process method has been removed.
+ . The force_http_10 method has been removed.
+ . The get_fd method has been removed.
+ . The get_target_uid and get_target_gid methods have been removed.
diff --git a/main/SAPI.c b/main/SAPI.c
index a5c2ba89b8c2..51997c041760 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -1036,43 +1036,6 @@ SAPI_API char *sapi_getenv(const char *name, size_t name_len)
return value;
}
-SAPI_API int sapi_get_fd(int *fd)
-{
- if (sapi_module.get_fd) {
- return sapi_module.get_fd(fd);
- } else {
- return FAILURE;
- }
-}
-
-SAPI_API int sapi_force_http_10(void)
-{
- if (sapi_module.force_http_10) {
- return sapi_module.force_http_10();
- } else {
- return FAILURE;
- }
-}
-
-
-SAPI_API int sapi_get_target_uid(uid_t *obj)
-{
- if (sapi_module.get_target_uid) {
- return sapi_module.get_target_uid(obj);
- } else {
- return FAILURE;
- }
-}
-
-SAPI_API int sapi_get_target_gid(gid_t *obj)
-{
- if (sapi_module.get_target_gid) {
- return sapi_module.get_target_gid(obj);
- } else {
- return FAILURE;
- }
-}
-
SAPI_API double sapi_get_request_time(void)
{
if(SG(global_request_time)) return SG(global_request_time);
diff --git a/main/SAPI.h b/main/SAPI.h
index 674442d22671..3d7f662b30f4 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -224,11 +224,6 @@ SAPI_API void sapi_get_default_content_type_header(sapi_header_struct
*default_h
SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len);
SAPI_API void sapi_activate_headers_only(void);
-SAPI_API int sapi_get_fd(int *fd);
-SAPI_API int sapi_force_http_10(void);
-
-SAPI_API int sapi_get_target_uid(uid_t *);
-SAPI_API int sapi_get_target_gid(gid_t *);
SAPI_API double sapi_get_request_time(void);
END_EXTERN_C()
@@ -269,13 +264,6 @@ struct _sapi_module_struct {
int php_ini_ignore;
int php_ini_ignore_cwd; /* don't look for php.ini in the current directory */
- int (*get_fd)(int *fd);
-
- int (*force_http_10)(void);
-
- int (*get_target_uid)(uid_t *);
- int (*get_target_gid)(gid_t *);
-
unsigned int (*input_filter)(int arg, const char *var, char **val, size_t val_len, size_t
*new_val_len);
void (*ini_defaults)(HashTable *configuration_hash);
@@ -327,10 +315,6 @@ END_EXTERN_C()
NULL, /* executable_location */ \
0, /* php_ini_ignore */ \
0, /* php_ini_ignore_cwd */ \
- NULL, /* get_fd */ \
- NULL, /* force_http_10 */ \
- NULL, /* get_target_uid */ \
- NULL, /* get_target_gid */ \
NULL, /* input_filter */ \
NULL, /* ini_defaults */ \
0, /* phpinfo_as_text; */ \