cvs: php4 /main main.c

From: Date: Mon, 19 Aug 2002 18:40:29 +0000
Subject: cvs: php4 /main main.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13466@lists.php.net to get a copy of this message
helly Mon Aug 19 14:40:29 2002 EDT Modified files: /php4/main main.c Log: -allow changing html_errors any time changing display_errors is already -use sizeof for strftime call -removed unused #define -mention CODING_STANDARDS as documentation Index: php4/main/main.c diff -u php4/main/main.c:1.479 php4/main/main.c:1.480 --- php4/main/main.c:1.479 Tue Aug 13 05:37:51 2002 +++ php4/main/main.c Mon Aug 19 14:40:28 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.479 2002/08/13 09:37:51 helly Exp $ */ +/* $Id: main.c,v 1.480 2002/08/19 18:40:28 helly Exp $ */ /* {{{ includes */ @@ -236,7 +236,7 @@ STD_PHP_INI_BOOLEAN("expose_php", "1", PHP_INI_SYSTEM, OnUpdateBool, expose_php, php_core_globals, core_globals) STD_PHP_INI_ENTRY("docref_root", "http://www.php.net/", PHP_INI_ALL, OnUpdateString, docref_root, php_core_globals, core_globals) STD_PHP_INI_ENTRY("docref_ext", "", PHP_INI_ALL, OnUpdateString, docref_ext, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("html_errors", "1", PHP_INI_SYSTEM, OnUpdateBool, html_errors, php_core_globals, core_globals) + STD_PHP_INI_BOOLEAN("html_errors", "1", PHP_INI_ALL, OnUpdateBool, html_errors, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("xmlrpc_errors", "0", PHP_INI_SYSTEM, OnUpdateBool, xmlrpc_errors, php_core_globals, core_globals) STD_PHP_INI_ENTRY("xmlrpc_error_number", "0", PHP_INI_ALL, OnUpdateInt, xmlrpc_error_number, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("ignore_user_abort", "0", PHP_INI_ALL, OnUpdateBool, ignore_user_abort, php_core_globals, core_globals) @@ -334,7 +334,7 @@ log_file = VCWD_FOPEN(PG(error_log), "a"); if (log_file != NULL) { time(&error_time); - strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", php_localtime_r(&error_time, &tmbuf)); + strftime(error_time_str, sizeof(error_time_str), "%d-%b-%Y %H:%M:%S", php_localtime_r(&error_time, &tmbuf)); fprintf(log_file, "[%s] ", error_time_str); fprintf(log_file, "%s", log_message); fprintf(log_file, "\n"); @@ -351,9 +351,6 @@ } /* }}} */ -/* is 4K big enough? */ -#define PRINTF_BUFFER_SIZE 1024*4 - /* {{{ php_write wrapper for modules to use PHPWRITE */ PHPAPI int php_write(void *buf, uint size TSRMLS_DC) @@ -388,6 +385,11 @@ /* }}} */ /* {{{ php_verror */ +/* php_verror is called from php_error_docref<n> 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, *ref = NULL, *target = NULL; @@ -461,6 +463,7 @@ /* }}} */ /* {{{ php_error_docref */ +/* See: CODING_STANDARDS for details. */ PHPAPI void php_error_docref(const char *docref TSRMLS_DC, int type, const char *format, ...) { va_list args; @@ -472,6 +475,7 @@ /* }}} */ /* {{{ 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; @@ -483,6 +487,7 @@ /* }}} */ /* {{{ 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 type, const char *format, ...) { char *params;

« previous php.cvs (#13466) next »