// 每种sapi都是一个 sapi_module_struct
typedef struct _sapi_module_struct sapi_module_struct;
struct _sapi_module_struct {
// sapi名字
char *name;
// sapi完整名字
char *pretty_name;
// module startup
int (*startup)(struct _sapi_module_struct *sapi_module);
// moduler shutdown
int (*shutdown)(struct _sapi_module_struct *sapi_module);
//
int (*activate)(void);
int (*deactivate)(void);
// unbuffered write
size_t (*ub_write)(const char *str, size_t str_length);
// flush
void (*flush)(void *server_context);
zend_stat_t *(*get_stat)(void);
char *(*getenv)(char *name, size_t name_len);
void (*sapi_error)(int type, const char *error_msg, ...);
int (*header_handler)(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers);
int (*send_headers)(sapi_headers_struct *sapi_headers);
void (*send_header)(sapi_header_struct *sapi_header, void *server_context);
// 读取post数据
size_t (*read_post)(char *buffer, size_t count_bytes);
// 读取cookies
char *(*read_cookies)(void);
void (*register_server_variables)(zval *track_vars_array);
void (*log_message)(char *message);
double (*get_request_time)(void);
void (*terminate_process)(void);
char *php_ini_path_override;
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
void (*default_post_reader)(void);
void (*treat_data)(int arg, char *str, zval *destArray);
char *executable_location;
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, char *var, char **val, size_t val_len, size_t *new_val_len);
void (*ini_defaults)(HashTable *configuration_hash);
int phpinfo_as_text;
char *ini_entries;
const zend_function_entry *additional_functions;
unsigned int (*input_filter_init)(void);
};