教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 互联网资料 >

软件著作权-源代码范本(5)

来源:网络收集 时间:2026-01-20
导读: 天一博胜企业管理软件V1.0 源代码 21 */ PHPAPI int php_printf(const char *format, ...) { va_list args; int ret; char *buffer; int size; TSRMLS_FETCH(); va_start(args, format); size = vspprintf( ret = P

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

21

*/

PHPAPI int php_printf(const char *format, ...) { va_list args; int ret; char *buffer; int size; TSRMLS_FETCH(); va_start(args, format); size = vspprintf(&buffer, 0, format, args); ret = PHPWRITE(buffer, size); efree(buffer); va_end(args); return ret; }

/* }}} */

/* {{{ php_verror helpers */

/* {{{ php_during_module_startup */

static int php_during_module_startup(void) { return module_startup; }

/* }}} */

/* {{{ php_during_module_shutdown */

static int php_during_module_shutdown(void) { return module_shutdown; }

/* }}} */ /* }}} */

/* {{{ php_verror */

/* php_verror is called from php_error_docref functions.

* Its purpose is to unify error messages and automatically generate clickable * html error messages if correcponding ini setting (html_errors) is activated. * See: CODING_STANDARDS for details. */

PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) { char *buffer = NULL, *docref_buf = NULL, *target = NULL; char *docref_target = \ char *p; int buffer_len = 0; char *space; char *class_name = get_active_class_name(&space TSRMLS_CC); char *function; int origin_len; char *origin; char *message; int is_function = 0; /* get error text into buffer and escape for html if necessary */ buffer_len = vspprintf(&buffer, 0, format, args);

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

22

if (PG(html_errors)) { int len; char *replace = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC); efree(buffer); buffer = replace; buffer_len = len; } /* which function caused the problem if any at all */ if (php_during_module_startup()) { function = \ } else if (php_during_module_shutdown()) { function = \ } else if (EG(current_execute_data) && EG(current_execute_data)->opline && EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL ) { switch (EG(current_execute_data)->opline->op2.u.constant.value.lval) { case ZEND_EVAL: function = \ is_function = 1; break; case ZEND_INCLUDE: function = \ is_function = 1; break; case ZEND_INCLUDE_ONCE: function = \ is_function = 1; break; case ZEND_REQUIRE: function = \ is_function = 1; break; case ZEND_REQUIRE_ONCE: function = \ is_function = 1; break; default: function = \ } } else { function = get_active_function_name(TSRMLS_C); if (!function || !strlen(function)) { function = \ } else { is_function = 1; } } if (is_function) { origin_len = spprintf(&origin, 0, \ } else {

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

23

origin_len = spprintf(&origin, 0, \ } if (PG(html_errors)) { int len; char *replace = php_escape_html_entities(origin, origin_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC); efree(origin); origin = replace; } if (docref && docref[0] == '#') { docref_target = strchr(docref, '#'); docref = NULL; } if (!docref && is_function) { if (space[0] == '\\0') { spprintf(&docref_buf, 0, \ } else { spprintf(&docref_buf, 0, \ } while((p = strchr(docref_buf, '_')) != NULL) { *p = '-'; } docref = docref_buf; } if (docref && is_function && (PG(html_errors) || strlen(PG(docref_root)))) { if (strncmp(docref, \ /* We don't have 'http://' so we use docref_root */ char *ref; /* temp copy for duplicated docref */ docref_root = PG(docref_root); ref = estrdup(docref); if (docref_buf) { efree(docref_buf); } docref_buf = ref; /* strip of the target if any */ p = strrchr(ref, '#'); if (p) { target = estrdup(p); if (target) { docref_target = target; *p = '\\0'; } } /* add the extension if it is set in ini */ if (PG(docref_ext) && strlen(PG(docref_ext))) { spprintf(&docref_buf, 0, \ efree(ref); } docref = docref_buf; } /* display html formatted or only show the additional links */ if (PG(html_errors)) {

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

24

spprintf(&message, 0, \[%s]: %s\origin, docref_root, docref, docref_target, docref, buffer); } else { spprintf(&message, 0, \ } if (target) { efree(target); } } else { spprintf(&message, 0, \ } efree(origin); if (docref_buf) { efree(docref_buf); } if (PG(track_errors) && module_initialized && EG(active_symbol_table) && (!EG(user_error_handler) || !(EG(user_error_handler_error_reporting) & type))) { zval *tmp; ALLOC_INIT_ZVAL(tmp); ZVAL_STRINGL(tmp, buffer, buffer_len, 1); zend_hash_update(EG(active_symbol_table), \sizeof(zval *), NULL); } efree(buffer); php_error(type, \ efree(message); }

/* }}} */

/* {{{ php_error_docref0 */

/* See: CODING_STANDARDS for details. */

PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...) { va_list args; va_start(args, format); php_verror(docref, \ va_end(args); }

/* }}} */

/* {{{ php_error_docref1 */

/* See: CODING_STANDARDS for details. */

PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...) { va_list args; va_start(args, format); php_verror(docref, param1, type, format, args TSRMLS_CC); va_end(args); }

/* }}} */

/* {{{ php_error_docref2 */

/* See: CODING_STANDARDS for details. */

PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int

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

25

type, const char *format, ...) { char *params; va_list args; spprintf(¶ms, 0, \ va_start(args, format); php_verror(docref, params ? params : \ va_end(args); if (params) { efree(params); } }

/* }}} */

/* {{{ php_html_puts */

PHPA …… 此处隐藏:3883字,全部文档内容请下载后查看。喜欢就下载吧 ……

软件著作权-源代码范本(5).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/442201.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)