MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000419XdebugFeature/Change requestpublic2008-11-08 18:102009-12-29 17:41
Reporterguenter 
Assigned To 
PrioritynormalSeveritytrivialReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000419: make use of P_tmpdir if defined instead of hardcoded '/tmp'
DescriptionI think its a good idea to make use of P_tmpdir if its defined in the OS headers - this would help on NetWare since there the default is 'sys:/tmp'.
I've checked on my Linux box that it is defined there too as '/tmp'.
Additional Information--- xdebug.c.orig Wed Jul 18 19:33:52 2007
+++ xdebug.c Fri Aug 31 12:14:14 2007
@@ -71,6 +71,12 @@
 #include "xdebug_superglobals.h"
 #include "usefulstuff.h"
 
+#ifdef P_tmpdir
+#define XDEBUG_TEMP_DIR P_tmpdir
+#else
+#define XDEBUG_TEMP_DIR "/tmp"
+#endif
+
 /* execution redirection functions */
 zend_op_array* (*old_compile_file)(zend_file_handle* file_handle, int type TSRMLS_DC);
 zend_op_array* xdebug_compile_file(zend_file_handle*, int TSRMLS_DC);
@@ -252,7 +258,7 @@
 PHP_INI_BEGIN()
     /* 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_dir", XDEBUG_TEMP_DIR, PHP_INI_ALL, OnUpdateString, trace_output_dir, 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)
@@ -296,7 +302,7 @@
 
     /* Profiler settings */
     STD_PHP_INI_BOOLEAN("xdebug.profiler_enable", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, profiler_enable, zend_xdebug_globals, xdebug_globals)
- STD_PHP_INI_ENTRY("xdebug.profiler_output_dir", "/tmp", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, profiler_output_dir, zend_xdebug_globals, xdebug_globals)
+ STD_PHP_INI_ENTRY("xdebug.profiler_output_dir", XDEBUG_TEMP_DIR, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, profiler_output_dir, zend_xdebug_globals, xdebug_globals)
     STD_PHP_INI_ENTRY("xdebug.profiler_output_name", "cachegrind.out.%p", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, profiler_output_name, zend_xdebug_globals, xdebug_globals)
     STD_PHP_INI_BOOLEAN("xdebug.profiler_enable_trigger", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, profiler_enable_trigger, zend_xdebug_globals, xdebug_globals)
     STD_PHP_INI_BOOLEAN("xdebug.profiler_append", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, profiler_append, zend_xdebug_globals, xdebug_globals)
TagsNo tags attached.
Operating Systemall
PHP Version5.2.6
Attached Files

- Relationships

-  Notes
(0001229)
derick (administrator)
2009-12-29 15:58

It's only netware that has P_tmpdir; what might help is to use PHP's php_get_temporary_directory() but that is really tricky to use as default for INI settings it seems.
(0001232)
guenter (reporter)
2009-12-29 17:29

nope - its Linux standard too - see:
http://www.delorie.com/gnu/docs/glibc/libc_295.html [^]
also see f.e. this PHP core file:
http://svn.php.net/viewvc/php/php-src/branches/PHP_5_2/main/php_open_temporary_file.c?revision=282742&view=markup [^]
where P_tmpdir is used too; and even Win32 seems to have it defined:
http://doc.ddart.net/msdn/header/include/stdio.h.html [^]

Anyway, you loose nothing with my patch since P_tmpdir is only used if defined.
(0001233)
derick (administrator)
2009-12-29 17:41

Ah ha, didn't know that. Fixed in revision 3179 and thanks!

- Issue History
Date Modified Username Field Change
2008-11-08 18:10 guenter New Issue
2009-12-29 15:58 derick Note Added: 0001229
2009-12-29 17:29 guenter Note Added: 0001232
2009-12-29 17:41 derick Note Added: 0001233
2009-12-29 17:41 derick Status new => closed
2009-12-29 17:41 derick Resolution open => fixed


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker