php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
SAPI.h File Reference
#include "php.h"
#include "zend.h"
#include "zend_API.h"
#include "zend_llist.h"
#include "zend_operators.h"
#include <sys/stat.h>

Go to the source code of this file.

Data Structures

struct  sapi_header_struct
 
struct  sapi_headers_struct
 
struct  sapi_request_info
 
struct  sapi_request_parse_body_context
 
struct  _sapi_globals_struct
 
struct  sapi_header_line
 
struct  _sapi_module_struct
 
struct  _sapi_post_entry
 

Macros

#define SAPI_OPTION_NO_CHDIR   1
 
#define SAPI_POST_BLOCK_SIZE   0x4000
 
#define SAPI_API
 
#define REQUEST_PARSE_BODY_OPTION_GET(name, fallback)
 
#define SG(v)
 
#define sapi_add_header(a, b, c)
 
#define SAPI_HEADER_ADD   (1<<0)
 
#define SAPI_HEADER_SENT_SUCCESSFULLY   1
 
#define SAPI_HEADER_DO_SEND   2
 
#define SAPI_HEADER_SEND_FAILED   3
 
#define SAPI_DEFAULT_MIMETYPE   "text/html"
 
#define SAPI_DEFAULT_CHARSET   PHP_DEFAULT_CHARSET
 
#define SAPI_PHP_VERSION_HEADER   "X-Powered-By: PHP/" PHP_VERSION
 
#define SAPI_POST_READER_FUNC(post_reader)
 
#define SAPI_POST_HANDLER_FUNC(post_handler)
 
#define SAPI_TREAT_DATA_FUNC(treat_data)
 
#define SAPI_INPUT_FILTER_FUNC(input_filter)
 
#define STANDARD_SAPI_MODULE_PROPERTIES
 

Typedefs

typedef struct _sapi_post_entry sapi_post_entry
 
typedef struct _sapi_module_struct sapi_module_struct
 
typedef struct _sapi_globals_struct sapi_globals_struct
 

Enumerations

enum  request_parse_body_option {
  REQUEST_PARSE_BODY_OPTION_max_file_uploads = 0 , REQUEST_PARSE_BODY_OPTION_max_input_vars , REQUEST_PARSE_BODY_OPTION_max_multipart_body_parts , REQUEST_PARSE_BODY_OPTION_post_max_size ,
  REQUEST_PARSE_BODY_OPTION_upload_max_filesize
}
 
enum  sapi_header_op_enum {
  SAPI_HEADER_REPLACE , SAPI_HEADER_ADD , SAPI_HEADER_DELETE , SAPI_HEADER_DELETE_ALL ,
  SAPI_HEADER_SET_STATUS
}
 

Functions

SAPI_API void sapi_startup (sapi_module_struct *sf)
 
SAPI_API void sapi_shutdown (void)
 
SAPI_API void sapi_activate (void)
 
SAPI_API void sapi_deactivate_module (void)
 
SAPI_API void sapi_deactivate_destroy (void)
 
SAPI_API void sapi_deactivate (void)
 
SAPI_API void sapi_initialize_empty_request (void)
 
SAPI_API void sapi_add_request_header (const char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg)
 
SAPI_API int sapi_header_op (sapi_header_op_enum op, void *arg)
 
SAPI_API int sapi_add_header_ex (const char *header_line, size_t header_line_len, bool duplicate, bool replace)
 
SAPI_API int sapi_send_headers (void)
 
SAPI_API void sapi_free_header (sapi_header_struct *sapi_header)
 
SAPI_API void sapi_handle_post (void *arg)
 
SAPI_API void sapi_read_post_data (void)
 
SAPI_API size_t sapi_read_post_block (char *buffer, size_t buflen)
 
SAPI_API int sapi_register_post_entries (const sapi_post_entry *post_entry)
 
SAPI_API int sapi_register_post_entry (const sapi_post_entry *post_entry)
 
SAPI_API void sapi_unregister_post_entry (const sapi_post_entry *post_entry)
 
SAPI_API int sapi_register_default_post_reader (void(*default_post_reader)(void))
 
SAPI_API int sapi_register_treat_data (void(*treat_data)(int arg, char *str, zval *destArray))
 
SAPI_API int sapi_register_input_filter (unsigned int(*input_filter)(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len), unsigned int(*input_filter_init)(void))
 
SAPI_API int sapi_flush (void)
 
SAPI_API zend_stat_tsapi_get_stat (void)
 
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 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)
 
SAPI_API void sapi_terminate_process (void)
 
SAPI_API SAPI_POST_READER_FUNC (sapi_read_standard_form_data)
 
SAPI_API SAPI_POST_READER_FUNC (php_default_post_reader)
 
SAPI_API SAPI_TREAT_DATA_FUNC (php_default_treat_data)
 
SAPI_API SAPI_INPUT_FILTER_FUNC (php_default_input_filter)
 

Variables

SAPI_API sapi_module_struct sapi_module
 
SAPI_API sapi_globals_struct sapi_globals
 

Macro Definition Documentation

◆ REQUEST_PARSE_BODY_OPTION_GET

#define REQUEST_PARSE_BODY_OPTION_GET ( name,
fallback )
Value:
(SG(request_parse_body_context).options_cache[REQUEST_PARSE_BODY_OPTION_ ## name].set \
? SG(request_parse_body_context).options_cache[REQUEST_PARSE_BODY_OPTION_ ## name].value \
: (fallback))
#define SG(v)
Definition SAPI.h:160
zend_string * name

Definition at line 127 of file SAPI.h.

◆ sapi_add_header

#define sapi_add_header ( a,
b,
c )
Value:
sapi_add_header_ex((a),(b),(c),1)
SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, bool duplicate, bool replace)
Definition SAPI.c:628
$obj a
Definition test.php:84

Definition at line 204 of file SAPI.h.

◆ SAPI_API

#define SAPI_API

Definition at line 39 of file SAPI.h.

◆ SAPI_DEFAULT_CHARSET

#define SAPI_DEFAULT_CHARSET   PHP_DEFAULT_CHARSET

Definition at line 308 of file SAPI.h.

◆ SAPI_DEFAULT_MIMETYPE

#define SAPI_DEFAULT_MIMETYPE   "text/html"

Definition at line 307 of file SAPI.h.

◆ SAPI_HEADER_ADD

#define SAPI_HEADER_ADD   (1<<0)

Definition at line 300 of file SAPI.h.

◆ SAPI_HEADER_DO_SEND

#define SAPI_HEADER_DO_SEND   2

Definition at line 304 of file SAPI.h.

◆ SAPI_HEADER_SEND_FAILED

#define SAPI_HEADER_SEND_FAILED   3

Definition at line 305 of file SAPI.h.

◆ SAPI_HEADER_SENT_SUCCESSFULLY

#define SAPI_HEADER_SENT_SUCCESSFULLY   1

Definition at line 303 of file SAPI.h.

◆ SAPI_INPUT_FILTER_FUNC

#define SAPI_INPUT_FILTER_FUNC ( input_filter)
Value:
unsigned int input_filter(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len)
zval * arg
Definition ffi.c:3975
zval * val
Definition ffi.c:4262

Definition at line 315 of file SAPI.h.

◆ SAPI_OPTION_NO_CHDIR

#define SAPI_OPTION_NO_CHDIR   1

Definition at line 27 of file SAPI.h.

◆ SAPI_PHP_VERSION_HEADER

#define SAPI_PHP_VERSION_HEADER   "X-Powered-By: PHP/" PHP_VERSION

Definition at line 309 of file SAPI.h.

◆ SAPI_POST_BLOCK_SIZE

#define SAPI_POST_BLOCK_SIZE   0x4000

Definition at line 28 of file SAPI.h.

◆ SAPI_POST_HANDLER_FUNC

#define SAPI_POST_HANDLER_FUNC ( post_handler)
Value:
void post_handler(char *content_type_dup, void *arg)

Definition at line 312 of file SAPI.h.

◆ SAPI_POST_READER_FUNC

#define SAPI_POST_READER_FUNC ( post_reader)
Value:
void post_reader(void)

Definition at line 311 of file SAPI.h.

◆ SAPI_TREAT_DATA_FUNC

#define SAPI_TREAT_DATA_FUNC ( treat_data)
Value:
void treat_data(int arg, char *str, zval* destArray)
struct _zval_struct zval

Definition at line 314 of file SAPI.h.

◆ SG

#define SG ( v)
Value:
sapi_globals_struct sapi_globals
Definition SAPI.c:44

Definition at line 160 of file SAPI.h.

◆ STANDARD_SAPI_MODULE_PROPERTIES

#define STANDARD_SAPI_MODULE_PROPERTIES
Value:
NULL, /* php_ini_path_override */ \
NULL, /* default_post_reader */ \
NULL, /* treat_data */ \
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; */ \
NULL, /* ini_entries; */ \
NULL, /* additional_functions */ \
NULL /* input_filter_init */
#define NULL
Definition gdcache.h:45

Definition at line 324 of file SAPI.h.

Typedef Documentation

◆ sapi_globals_struct

◆ sapi_module_struct

Definition at line 60 of file SAPI.h.

◆ sapi_post_entry

Definition at line 59 of file SAPI.h.

Enumeration Type Documentation

◆ request_parse_body_option

Enumerator
REQUEST_PARSE_BODY_OPTION_max_file_uploads 
REQUEST_PARSE_BODY_OPTION_max_input_vars 
REQUEST_PARSE_BODY_OPTION_max_multipart_body_parts 
REQUEST_PARSE_BODY_OPTION_post_max_size 
REQUEST_PARSE_BODY_OPTION_upload_max_filesize 

Definition at line 119 of file SAPI.h.

◆ sapi_header_op_enum

Enumerator
SAPI_HEADER_REPLACE 
SAPI_HEADER_ADD 
SAPI_HEADER_DELETE 
SAPI_HEADER_DELETE_ALL 
SAPI_HEADER_SET_STATUS 

Definition at line 191 of file SAPI.h.

Function Documentation

◆ sapi_activate()

SAPI_API void sapi_activate ( void )

Definition at line 430 of file SAPI.c.

◆ sapi_activate_headers_only()

SAPI_API void sapi_activate_headers_only ( void )

Definition at line 386 of file SAPI.c.

◆ sapi_add_header_ex()

SAPI_API int sapi_add_header_ex ( const char * header_line,
size_t header_line_len,
bool duplicate,
bool replace )

Definition at line 628 of file SAPI.c.

◆ sapi_add_request_header()

SAPI_API void sapi_add_request_header ( const char * var,
unsigned int var_len,
char * val,
unsigned int val_len,
void * arg )

Definition at line 1110 of file SAPI.c.

◆ sapi_apply_default_charset()

SAPI_API size_t sapi_apply_default_charset ( char ** mimetype,
size_t len )

Definition at line 365 of file SAPI.c.

◆ sapi_deactivate()

SAPI_API void sapi_deactivate ( void )

Definition at line 549 of file SAPI.c.

◆ sapi_deactivate_destroy()

SAPI_API void sapi_deactivate_destroy ( void )

Definition at line 533 of file SAPI.c.

◆ sapi_deactivate_module()

SAPI_API void sapi_deactivate_module ( void )

Definition at line 494 of file SAPI.c.

◆ sapi_flush()

SAPI_API int sapi_flush ( void )

Definition at line 1001 of file SAPI.c.

◆ sapi_force_http_10()

SAPI_API int sapi_force_http_10 ( void )

Definition at line 1060 of file SAPI.c.

◆ sapi_free_header()

SAPI_API void sapi_free_header ( sapi_header_struct * sapi_header)

Definition at line 105 of file SAPI.c.

◆ sapi_get_default_content_type()

SAPI_API char * sapi_get_default_content_type ( void )

Definition at line 337 of file SAPI.c.

◆ sapi_get_default_content_type_header()

SAPI_API void sapi_get_default_content_type_header ( sapi_header_struct * default_header)

Definition at line 345 of file SAPI.c.

◆ sapi_get_fd()

SAPI_API int sapi_get_fd ( int * fd)

Definition at line 1051 of file SAPI.c.

◆ sapi_get_request_time()

SAPI_API double sapi_get_request_time ( void )

Definition at line 1088 of file SAPI.c.

◆ sapi_get_stat()

SAPI_API zend_stat_t * sapi_get_stat ( void )

Definition at line 1011 of file SAPI.c.

◆ sapi_get_target_gid()

SAPI_API int sapi_get_target_gid ( gid_t * obj)

Definition at line 1079 of file SAPI.c.

◆ sapi_get_target_uid()

SAPI_API int sapi_get_target_uid ( uid_t * obj)

Definition at line 1070 of file SAPI.c.

◆ sapi_getenv()

SAPI_API char * sapi_getenv ( const char * name,
size_t name_len )

Definition at line 1023 of file SAPI.c.

◆ sapi_handle_post()

SAPI_API void sapi_handle_post ( void * arg)

Definition at line 161 of file SAPI.c.

◆ sapi_header_op()

SAPI_API int sapi_header_op ( sapi_header_op_enum op,
void * arg )

Definition at line 666 of file SAPI.c.

◆ sapi_initialize_empty_request()

SAPI_API void sapi_initialize_empty_request ( void )

Definition at line 556 of file SAPI.c.

◆ SAPI_INPUT_FILTER_FUNC()

SAPI_API SAPI_INPUT_FILTER_FUNC ( php_default_input_filter )

Definition at line 455 of file php_variables.c.

◆ SAPI_POST_READER_FUNC() [1/2]

SAPI_API SAPI_POST_READER_FUNC ( php_default_post_reader )

Definition at line 32 of file php_content_types.c.

◆ SAPI_POST_READER_FUNC() [2/2]

SAPI_API SAPI_POST_READER_FUNC ( sapi_read_standard_form_data )

Definition at line 254 of file SAPI.c.

◆ sapi_read_post_block()

SAPI_API size_t sapi_read_post_block ( char * buffer,
size_t buflen )

Definition at line 232 of file SAPI.c.

◆ sapi_read_post_data()

SAPI_API void sapi_read_post_data ( void )

Definition at line 170 of file SAPI.c.

◆ sapi_register_default_post_reader()

SAPI_API int sapi_register_default_post_reader ( void(* default_post_reader )(void))

Definition at line 972 of file SAPI.c.

◆ sapi_register_input_filter()

SAPI_API int sapi_register_input_filter ( unsigned int(* input_filter )(int arg, const char *var, char **val, size_t val_len, size_t *new_val_len),
unsigned int(* input_filter_init )(void) )

Definition at line 991 of file SAPI.c.

◆ sapi_register_post_entries()

SAPI_API int sapi_register_post_entries ( const sapi_post_entry * post_entry)

Definition at line 933 of file SAPI.c.

◆ sapi_register_post_entry()

SAPI_API int sapi_register_post_entry ( const sapi_post_entry * post_entry)

Definition at line 947 of file SAPI.c.

◆ sapi_register_treat_data()

SAPI_API int sapi_register_treat_data ( void(* treat_data )(int arg, char *str, zval *destArray))

Definition at line 982 of file SAPI.c.

◆ sapi_send_headers()

SAPI_API int sapi_send_headers ( void )

Definition at line 843 of file SAPI.c.

◆ sapi_shutdown()

SAPI_API void sapi_shutdown ( void )

Definition at line 89 of file SAPI.c.

◆ sapi_startup()

SAPI_API void sapi_startup ( sapi_module_struct * sf)

Definition at line 68 of file SAPI.c.

◆ sapi_terminate_process()

SAPI_API void sapi_terminate_process ( void )

Definition at line 1104 of file SAPI.c.

◆ SAPI_TREAT_DATA_FUNC()

SAPI_API SAPI_TREAT_DATA_FUNC ( php_default_treat_data )

Definition at line 462 of file php_variables.c.

◆ sapi_unregister_post_entry()

SAPI_API void sapi_unregister_post_entry ( const sapi_post_entry * post_entry)

Definition at line 962 of file SAPI.c.

Variable Documentation

◆ sapi_globals

SAPI_API sapi_globals_struct sapi_globals
extern

Definition at line 44 of file SAPI.c.

◆ sapi_module

SAPI_API sapi_module_struct sapi_module
extern

Definition at line 65 of file SAPI.c.