[php]代码库
struct _sapi_module_struct {
char *name; // 名字(标识用)
char *pretty_name; // 更好理解的名字(自己翻译的)
int (*startup)(struct _sapi_module_struct *sapi_module); // 启动函数
int (*shutdown)(struct _sapi_module_struct *sapi_module); // 关闭方法
int (*activate)(TSRMLS_D); // 激活
int (*deactivate)(TSRMLS_D); // 停用
int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC);
// 不缓存的写操作(unbuffered write)
void (*flush)(void *server_context); // flush
struct stat *(*get_stat)(TSRMLS_D); // get uid
char *(*getenv)(char *name, size_t name_len TSRMLS_DC); // getenv
void (*sapi_error)(int type, const char *error_msg, ...); /* error handler */
int (*header_handler)(sapi_header_struct *sapi_header, sapi_header_op_enum op,
sapi_headers_struct *sapi_headers TSRMLS_DC); /* header handler */
/* send headers handler */
int (*send_headers)(sapi_headers_struct *sapi_headers TSRMLS_DC);
void (*send_header)(sapi_header_struct *sapi_header,
void *server_context TSRMLS_DC); /* send header handler */
int (*read_post)(char *buffer, uint count_bytes TSRMLS_DC); /* read POST data */
char *(*read_cookies)(TSRMLS_D); /* read Cookies */
/* register server variables */
void (*register_server_variables)(zval *track_vars_array TSRMLS_DC);
void (*log_message)(char *message); /* Log message */
time_t (*get_request_time)(TSRMLS_D); /* Request Time */
void (*terminate_process)(TSRMLS_D); /* Child Terminate */
char *php_ini_path_override; // 覆盖的ini路径
...
...
};