[xdebug-dev] xdebug xdebug/xdebug.c - Reimplemented file naming for trace files to use the new output formatting

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Wed, 16 May 2007 18:11:24 +0200

Date: Wed May 16 18:11:24 CEST 2007
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- Reimplemented file naming for trace files to use the new output formatting
  mechanism.

Modified files:
           xdebug/xdebug.c (version: 1.385)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.384
retrieving revision 1.385
diff -u -r1.384 -r1.385
--- xdebug/xdebug.c:1.384 Mon May 14 12:20:40 2007 GMT
+++ xdebug/xdebug.c Wed May 16 14:11:24 2007 GMT
@@ -250,7 +250,7 @@
         /* Debugger settings */
         STD_PHP_INI_BOOLEAN("xdebug.auto_trace", "0", PHP_INI_ALL, OnUpdateBool, auto_trace, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.trace_output_dir", "/tmp", PHP_INI_ALL, OnUpdateString, trace_output_dir, zend_xdebug_globals, xdebug_globals)
- STD_PHP_INI_ENTRY("xdebug.trace_output_name", "crc32", PHP_INI_ALL, OnUpdateString, trace_output_name, zend_xdebug_globals, xdebug_globals)
+ STD_PHP_INI_ENTRY("xdebug.trace_output_name", "trace.%c", PHP_INI_ALL, OnUpdateString, trace_output_name, zend_xdebug_globals, xdebug_globals)
 #if ZEND_EXTENSION_API_NO < 90000000
         STD_PHP_INI_ENTRY("xdebug.trace_format", "0", PHP_INI_ALL, OnUpdateInt, trace_format, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.trace_options", "0", PHP_INI_ALL, OnUpdateInt, trace_options, zend_xdebug_globals, xdebug_globals)
@@ -2667,15 +2667,13 @@
         if (fname && strlen(fname)) {
                 filename = xdstrdup(fname);
         } else {
- if (strcmp(XG(trace_output_name), "crc32") == 0) {
- VCWD_GETCWD(cwd, 127);
- filename = xdebug_sprintf("%s/trace.%lu", XG(trace_output_dir), xdebug_crc32(cwd, strlen(cwd)));
- } else if (strcmp(XG(trace_output_name), "timestamp") == 0) {
- time_t the_time = time(NULL);
- filename = xdebug_sprintf("%s/trace.%ld", XG(trace_output_dir), the_time);
- } else {
- filename = xdebug_sprintf("%s/trace.%ld", XG(trace_output_dir), getpid());
+ if (!strlen(XG(trace_output_name)) ||
+ xdebug_format_output_filename(&fname, XG(trace_output_name), NULL) <= 0
+ ) {
+ /* Invalid or empty xdebug.trace_output_name */
+ return NULL;
                 }
+ filename = xdebug_sprintf("%s/%s", XG(trace_output_dir), fname);
         }
         if (options & XDEBUG_TRACE_OPTION_APPEND) {
                 XG(trace_file) = xdebug_fopen(filename, "a", "xt", (char**) &tmp_fname);
Received on Wed May 16 2007 - 18:11:29 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST