天一博胜企业管理软件V1.0 源代码
46
{ while (waitpid(-1, NULL, WNOHANG) > 0); signal(SIGCHLD, sigchld_handler); }
/* }}} */ #endif
/* {{{ php_start_sapi() */
static int php_start_sapi(TSRMLS_D) { int retval = SUCCESS; if(!SG(sapi_started)) { zend_try { PG(during_request_startup) = 1; /* initialize global variables */ PG(modules_activated) = 0; PG(header_is_being_sent) = 0; PG(connection_status) = PHP_CONNECTION_NORMAL; zend_activate(TSRMLS_C); zend_set_timeout(EG(timeout_seconds)); zend_activate_modules(TSRMLS_C); PG(modules_activated)=1; } zend_catch { retval = FAILURE; } zend_end_try(); SG(sapi_started) = 1; } return retval; }
/* }}} */
/* {{{ php_request_startup */
#ifndef APACHE_HOOKS
int php_request_startup(TSRMLS_D) { int retval = SUCCESS; #ifdef PHP_WIN32 PG(com_initialized) = 0; #endif
#if PHP_SIGCHILD signal(SIGCHLD, sigchld_handler); #endif zend_try { PG(during_request_startup) = 1; php_output_activate(TSRMLS_C); /* initialize global variables */ PG(modules_activated) = 0; PG(header_is_being_sent) = 0; PG(connection_status) = PHP_CONNECTION_NORMAL; PG(in_user_include) = 0; zend_activate(TSRMLS_C); sapi_activate(TSRMLS_C);
天一博胜企业管理软件V1.0 源代码
47
if (PG(max_input_time) == -1) { zend_set_timeout(EG(timeout_seconds)); } else { zend_set_timeout(PG(max_input_time)); } /* Disable realpath cache if safe_mode or open_basedir are set */ if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { CWDG(realpath_cache_size_limit) = 0; } if (PG(expose_php)) { sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); } if (PG(output_handler) && PG(output_handler)[0]) { php_start_ob_buffer_named(PG(output_handler), 0, 1 TSRMLS_CC); } else if (PG(output_buffering)) { if (PG(output_buffering)>1) { php_start_ob_buffer(NULL, PG(output_buffering), 1 TSRMLS_CC); } else { php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC); } } else if (PG(implicit_flush)) { php_start_implicit_flush(TSRMLS_C); } /* We turn this off in php_execute_script() */ /* PG(during_request_startup) = 0; */ php_hash_environment(TSRMLS_C); zend_activate_modules(TSRMLS_C); PG(modules_activated)=1; } zend_catch { retval = FAILURE; } zend_end_try(); SG(sapi_started) = 1; return retval; } # else
int php_request_startup(TSRMLS_D) { int retval = SUCCESS; #if PHP_SIGCHILD signal(SIGCHLD, sigchld_handler); #endif if (php_start_sapi() == FAILURE) { return FAILURE; } php_output_activate(TSRMLS_C); sapi_activate(TSRMLS_C); php_hash_environment(TSRMLS_C); zend_try { PG(during_request_startup) = 1; php_output_activate(TSRMLS_C); if (PG(expose_php)) {
天一博胜企业管理软件V1.0 源代码
48
sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); } } zend_catch { retval = FAILURE; } zend_end_try(); return retval; }
# endif /* }}} */
/* {{{ php_request_startup_for_hook */
int php_request_startup_for_hook(TSRMLS_D) { int retval = SUCCESS; #if PHP_SIGCHLD signal(SIGCHLD, sigchld_handler); #endif if (php_start_sapi(TSRMLS_C) == FAILURE) { return FAILURE; } php_output_activate(TSRMLS_C); sapi_activate_headers_only(TSRMLS_C); php_hash_environment(TSRMLS_C); return retval; }
/* }}} */
/* {{{ php_request_shutdown_for_exec */
void php_request_shutdown_for_exec(void *dummy) { TSRMLS_FETCH(); /* used to close fd's in the 3..255 range here, but it's problematic */ shutdown_memory_manager(1, 1 TSRMLS_CC); }
/* }}} */
/* {{{ php_request_shutdown_for_hook */
void php_request_shutdown_for_hook(void *dummy) { TSRMLS_FETCH(); if (PG(modules_activated)) zend_try { php_call_shutdown_functions(TSRMLS_C); } zend_end_try(); if (PG(modules_activated)) { zend_deactivate_modules(TSRMLS_C); php_free_shutdown_functions(TSRMLS_C); } zend_try { int i; for (i = 0; i < NUM_TRACK_VARS; i++) {
天一博胜企业管理软件V1.0 源代码
49
if (PG(http_globals)[i]) { zval_ptr_dtor(&PG(http_globals)[i]); } } } zend_end_try(); zend_deactivate(TSRMLS_C); zend_try { sapi_deactivate(TSRMLS_C); } zend_end_try(); zend_try { php_shutdown_stream_hashes(TSRMLS_C); } zend_end_try(); zend_try { shutdown_memory_manager(CG(unclean_shutdown), 0 TSRMLS_CC); } zend_end_try(); zend_try { zend_unset_timeout(TSRMLS_C); } zend_end_try(); }
/* }}} */
/* {{{ php_request_shutdown */
void php_request_shutdown(void *dummy) { zend_bool report_memleaks; TSRMLS_FETCH(); report_memleaks = PG(report_memleaks); /* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed * inside zend_executor callback functions. */ EG(opline_ptr) = NULL; EG(active_op_array) = NULL; /* 1. Call all possible shutdown functions registered with register_shutdown_function() */ if (PG(modules_activated)) zend_try { php_call_shutdown_functions(TSRMLS_C); } zend_end_try(); /* 2. Call all possible __destruct() functions */ zend_try { zend_call_destructors(TSRMLS_C); } zend_end_try(); /* 3. Flush all output buffers */ zend_try { php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); } zend_end_try(); /* 4. Send the set HTTP headers (note: This must be done AFTER php_end_ob_buffers() !!) */ zend_try { sapi_send_headers(TSRMLS_C); } zend_end_try(); /* 5. Call all extensions RSHUTDOWN functions */ if (PG(modules_activated)) { zend_deactivate_modules(TSRMLS_C); php_free_shutdown_functions(TSRMLS_C);
天一博胜企业管理软件V1.0 源代码
50
} /* 6. Destroy super-globals */ zend_try { int i; for (i=0; i /* }}} */ /* {{{ php_com_initialize */ PHPAPI void php_com_initialize(TSRMLS_D)