26static const char HARDCODED_INI[] =
28 "register_argc_argv=1\n"
30 "output_buffering=0\n"
31 "max_execution_time=0\n"
32 "max_input_time=-1\n\0";
34#if defined(PHP_WIN32) && defined(ZTS)
38static char* php_embed_read_cookies(
void)
43static int php_embed_deactivate(
void)
55static inline size_t php_embed_single_write(
const char *str,
size_t str_length)
57#ifdef PHP_WRITE_STDOUT
61 if (
ret <= 0)
return 0;
75static size_t php_embed_ub_write(
const char *str,
size_t str_length)
77 const char *
ptr = str;
78 size_t remaining = str_length;
81 while (remaining > 0) {
82 ret = php_embed_single_write(
ptr, remaining);
93static void php_embed_flush(
void *server_context)
100static void php_embed_send_header(
sapi_header_struct *sapi_header,
void *server_context)
109static void php_embed_log_message(
const char *message,
int syslog_type_int)
111 fprintf(stderr,
"%s\n", message);
114static void php_embed_register_variables(
zval *track_vars_array)
127 "PHP Embedded Library",
133 php_embed_deactivate,
144 php_embed_send_header,
147 php_embed_read_cookies,
149 php_embed_register_variables,
150 php_embed_log_message,
165#if defined(SIGPIPE) && defined(SIG_IGN)
198 _setmode(_fileno(stdout),
O_BINARY);
199 _setmode(_fileno(stderr),
O_BINARY);
236 SG(request_info).argc=argc;
237 SG(request_info).argv=argv;
246 SG(request_info).no_headers = 1;
SAPI_API sapi_module_struct sapi_module
SAPI_API void sapi_startup(sapi_module_struct *sf)
SAPI_API void sapi_shutdown(void)
#define SAPI_OPTION_NO_CHDIR
#define STANDARD_SAPI_MODULE_PROPERTIES
struct _sapi_module_struct sapi_module_struct
fprintf($stream, string $format, mixed ... $values)
fwrite($stream, string $data, ?int $length=null)
headers_sent(&$filename=null, &$line=null)
dl(string $extension_filename)
void php_request_shutdown(void *dummy)
zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_module)
PHPAPI void php_handle_aborted_connection(void)
void php_module_shutdown(void)
zend_result php_request_startup(void)
int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals)
EMBED_SAPI_API void php_embed_shutdown(void)
EMBED_SAPI_API sapi_module_struct php_embed_module
EMBED_SAPI_API int php_embed_init(int argc, char **argv)
PHP_JSON_API size_t int options
PHPAPI void(* php_import_environment_variables)(zval *array_ptr)
PHPAPI void php_register_variable(const char *var, const char *strval, zval *track_vars_array)
#define ZEND_TSRMLS_CACHE_UPDATE()
#define ZEND_TSRMLS_CACHE_DEFINE()
struct _zend_function_entry zend_function_entry
#define ZEND_FE(name, arg_info)
#define zend_signal_startup()