软件著作权-源代码范本 联系客服

发布时间 : 星期日 文章软件著作权-源代码范本更新完毕开始阅读66c381c74b73f242326c5fa8

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

37

} }

/* }}} */

/* {{{ php_html_puts */

PHPAPI void php_html_puts(const char *str, uint size TSRMLS_DC) { zend_html_puts(str, size TSRMLS_CC); }

/* }}} */

/* {{{ php_suppress_errors */

PHPAPI void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC) { PG(error_handling) = error_handling; PG(exception_class) = exception_class; 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; } PG(last_error_lineno) = 0; }

PHP_FUNCTION(set_time_limit) { zval **new_timeout; if (PG(safe_mode)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, \ RETURN_FALSE; } if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &new_timeout) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(new_timeout); if (zend_alter_ini_entry(\sizeof(\Z_STRVAL_PP(new_timeout), Z_STRLEN_PP(new_timeout), PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == SUCCESS) { RETURN_TRUE; } else { RETURN_FALSE; } }

static PHP_INI_DISP(display_errors_mode) { int mode, tmp_value_length, cgi_or_cli; char *tmp_value; TSRMLS_FETCH(); if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL ); tmp_value_length = ini_entry->orig_value_length;

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

38

} else if (ini_entry->value) { tmp_value = ini_entry->value; tmp_value_length = ini_entry->value_length; } else { tmp_value = NULL; tmp_value_length = 0; } mode = php_get_display_errors_mode(tmp_value, tmp_value_length); cgi_or_cli = (!strcmp(sapi_module.name, \ switch (mode) { case PHP_DISPLAY_ERRORS_STDERR: if (cgi_or_cli ) { PUTS(\ } else { PUTS(\ } break; case PHP_DISPLAY_ERRORS_STDOUT: if (cgi_or_cli ) { PUTS(\ } else { PUTS(\ } break; default: PUTS(\ break; } }

static PHP_INI_MH(OnUpdateErrorLog) { /* Only do the safemode/open_basedir check at runtime */ if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && strcmp(new_value, \ if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { return FAILURE; } if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) { return FAILURE; } } OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); return SUCCESS; }

static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path) { TSRMLS_FETCH(); return php_stream_open_wrapper_as_file((char *)filename, \ENFORCE_SAFE_MODE|USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, opened_path); }

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

/* }}} */

static void stream_closer_for_zend(void *handle TSRMLS_DC) /* {{{ */ { php_stream_close((php_stream*)handle); }

/* }}} */

static long stream_fteller_for_zend(void *handle TSRMLS_DC) /* {{{ */ { return (long)php_stream_tell((php_stream*)handle); }

/* }}} */

static PHP_INI_MH(OnUpdateTimeout) { EG(timeout_seconds) = atoi(new_value); if (stage==PHP_INI_STAGE_STARTUP) { /* Don't set a timeout on startup, only per-request */ return SUCCESS; } zend_unset_timeout(TSRMLS_C); zend_set_timeout(EG(timeout_seconds)); return SUCCESS; }

/* }}} */

/* {{{ php_get_display_errors_mode() helper function */

static int php_get_display_errors_mode(char *value, int value_length) { int mode; if (!value) { return PHP_DISPLAY_ERRORS_STDOUT; } if (value_length == 2 && !strcasecmp(\ mode = PHP_DISPLAY_ERRORS_STDOUT; } else if (value_length == 3 && !strcasecmp(\ mode = PHP_DISPLAY_ERRORS_STDOUT; } else if (value_length == 4 && !strcasecmp(\ mode = PHP_DISPLAY_ERRORS_STDOUT; } else if (value_length == 6 && !strcasecmp(value, \ mode = PHP_DISPLAY_ERRORS_STDERR; } else if (value_length == 6 && !strcasecmp(value, \ mode = PHP_DISPLAY_ERRORS_STDOUT; } else { mode = atoi(value); if (mode && mode != PHP_DISPLAY_ERRORS_STDOUT PHP_DISPLAY_ERRORS_STDERR) { mode = PHP_DISPLAY_ERRORS_STDOUT; } } return mode; }

/* }}} */

/* {{{ PHP_INI_MH

&& mode 39

!=

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

40

*/

static PHP_INI_MH(OnUpdateDisplayErrors) { PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value, new_value_length); return SUCCESS; }

/* }}} */

/* {{{ PHP_INI_DISP */

static PHP_INI_DISP(display_errors_mode) { int mode, tmp_value_length, cgi_or_cli; char *tmp_value; TSRMLS_FETCH(); if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL ); tmp_value_length = ini_entry->orig_value_length; } else if (ini_entry->value) { tmp_value = ini_entry->value; tmp_value_length = ini_entry->value_length; } else { tmp_value = NULL; tmp_value_length = 0; } mode = php_get_display_errors_mode(tmp_value, tmp_value_length); /* Display 'On' for other SAPIs instead of STDOUT or STDERR */ cgi_or_cli = (!strcmp(sapi_module.name, \ switch (mode) { case PHP_DISPLAY_ERRORS_STDERR: if (cgi_or_cli ) { PUTS(\ } else { PUTS(\ } break; case PHP_DISPLAY_ERRORS_STDOUT: if (cgi_or_cli ) { PUTS(\ } else { PUTS(\ } break; default: PUTS(\ break; } }

static PHP_INI_MH(OnUpdateErrorLog) { /* Only do the safemode/open_basedir check at runtime */ if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && strcmp(new_value, \