[xdebug-dev] svn: /xdebug/trunk/ tests/bug00419.phpt xdebug.c

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Tue, 29 Dec 2009 17:41:37 +0000

derick Tue, 29 Dec 2009 17:41:37 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=3179

Log:
- Fixed bug #419: make use of P_tmpdir if defined instead of hardcoded '/tmp'.

Changed paths:
    A xdebug/trunk/tests/bug00419.phpt
    U xdebug/trunk/xdebug.c

Added: xdebug/trunk/tests/bug00419.phpt
===================================================================
--- xdebug/trunk/tests/bug00419.phpt (rev 0)
+++ xdebug/trunk/tests/bug00419.phpt 2009-12-29 17:41:37 UTC (rev 3179)
@@ -0,0 +1,10 @@
+--TEST--
+Test for bug #419: make use of P_tmpdir if defined instead of hardcoded '/tmp'.
+--FILE--
+<?php
+echo ini_get( 'xdebug.trace_output_dir' ), "\n";
+echo ini_get( 'xdebug.profiler_output_dir' ), "\n";
+?>
+--EXPECT--
+/tmp
+/tmp

Modified: xdebug/trunk/xdebug.c
===================================================================
--- xdebug/trunk/xdebug.c 2009-12-29 17:18:34 UTC (rev 3178)
+++ xdebug/trunk/xdebug.c 2009-12-29 17:41:37 UTC (rev 3179)
@@ -238,10 +238,16 @@
         return SUCCESS;
 }

+#ifdef P_tmpdir
+# define XDEBUG_TEMP_DIR P_tmpdir
+#else
+# define XDEBUG_TEMP_DIR "/tmp"
+#endif
+
 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)
         STD_PHP_INI_ENTRY("xdebug.trace_format", "0", PHP_INI_ALL, OnUpdateLong, trace_format, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.trace_options", "0", PHP_INI_ALL, OnUpdateLong, trace_options, zend_xdebug_globals, xdebug_globals)
@@ -275,7 +281,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)
Received on Tue Dec 29 2009 - 17:41:37 GMT

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