好文档 - 专业文书写作范文服务资料分享网站

计算机软件著作权登记-源代码范本

天下 分享 时间: 加入收藏 我要投稿 点赞

天一博胜企业管理软件V1.0 源代码

46

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); 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;

天一博胜企业管理软件V1.0 源代码

47

} 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)) { sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); } } zend_catch { retval = FAILURE; } zend_end_try(); return retval; }

天一博胜企业管理软件V1.0 源代码

48

# 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++) { 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);

天一博胜企业管理软件V1.0 源代码

49

} 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); } /* 6. Destroy super-globals */ zend_try { int i; for (i=0; i

天一博胜企业管理软件V1.0 源代码

50

} } zend_end_try(); /* 6.5 free last error information */ if (PG(last_error_message)) { free(PG(last_error_message)); PG(last_error_message) = NULL; } if (PG(last_error_file)) { free(PG(last_error_file)); PG(last_error_file) = NULL; } /* 7. Shutdown scanner/executor/compiler and restore ini entries */ zend_deactivate(TSRMLS_C); /* 8. Call all extensions post-RSHUTDOWN functions */ zend_try { zend_post_deactivate_modules(TSRMLS_C); } zend_end_try(); /* 9. SAPI related shutdown (free stuff) */ zend_try { sapi_deactivate(TSRMLS_C); } zend_end_try(); /* 10. Destroy stream hashes */ zend_try { php_shutdown_stream_hashes(TSRMLS_C); } zend_end_try(); /* 11. Free Willy (here be crashes) */ zend_try { shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC); } zend_end_try(); /* 12. Reset max_execution_time */ zend_try { zend_unset_timeout(TSRMLS_C); } zend_end_try(); #ifdef PHP_WIN32 if (PG(com_initialized)) { CoUninitialize(); PG(com_initialized) = 0; } #endif }

/* }}} */

/* {{{ php_com_initialize */

PHPAPI void php_com_initialize(TSRMLS_D) {

#ifdef PHP_WIN32 if (!PG(com_initialized)) { CoInitialize(NULL); PG(com_initialized) = 1; } #endif }

计算机软件著作权登记-源代码范本

天一博胜企业管理软件V1.0源代码46staticintphp_start_sapi(TSRMLS_D){intretval=SUCCESS;if(!SG(sapi_started)){zend_try{PG(during_request_startup)=1;/*initializeglobal
推荐度:
点击下载文档文档为doc格式
9zen00osup2nsft0jg7s
领取福利

微信扫码领取福利

微信扫码分享