Advertisement
Guest User

Patrick Allaert

a guest
Jan 28th, 2010
743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. Index: xdebug.c
  2. ===================================================================
  3. --- xdebug.c (revision 3206)
  4. +++ xdebug.c (working copy)
  5. @@ -247,6 +247,7 @@
  6. PHP_INI_BEGIN()
  7. /* Debugger settings */
  8. STD_PHP_INI_BOOLEAN("xdebug.auto_trace", "0", PHP_INI_ALL, OnUpdateBool, auto_trace, zend_xdebug_globals, xdebug_globals)
  9. + STD_PHP_INI_BOOLEAN("xdebug.trace_enable_trigger", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, trace_enable_trigger, zend_xdebug_globals, xdebug_globals)
  10. STD_PHP_INI_ENTRY("xdebug.trace_output_dir", XDEBUG_TEMP_DIR, PHP_INI_ALL, OnUpdateString, trace_output_dir, zend_xdebug_globals, xdebug_globals)
  11. STD_PHP_INI_ENTRY("xdebug.trace_output_name", "trace.%c", PHP_INI_ALL, OnUpdateString, trace_output_name, zend_xdebug_globals, xdebug_globals)
  12. STD_PHP_INI_ENTRY("xdebug.trace_format", "0", PHP_INI_ALL, OnUpdateLong, trace_format, zend_xdebug_globals, xdebug_globals)
  13. @@ -1013,7 +1014,28 @@
  14. XG(remote_enabled) = 0;
  15. XG(profiler_enabled) = 0;
  16. XG(breakpoints_allowed) = 1;
  17. - if (XG(auto_trace) && XG(trace_output_dir) && strlen(XG(trace_output_dir))) {
  18. +
  19. + if (
  20. + (
  21. + XG(auto_trace)
  22. + ||
  23. + (
  24. + /* Check for special GET/POST parameter to start the trace */
  25. + XG(trace_enable_trigger) &&
  26. + (
  27. + (
  28. + PG(http_globals)[TRACK_VARS_GET] &&
  29. + zend_hash_find(PG(http_globals)[TRACK_VARS_GET]->value.ht, "XDEBUG_TRACE", sizeof("XDEBUG_TRACE"), (void **) &dummy) == SUCCESS
  30. + ) || (
  31. + PG(http_globals)[TRACK_VARS_POST] &&
  32. + zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_TRACE", sizeof("XDEBUG_TRACE"), (void **) &dummy) == SUCCESS
  33. + ) || (
  34. + PG(http_globals)[TRACK_VARS_COOKIE] &&
  35. + zend_hash_find(PG(http_globals)[TRACK_VARS_COOKIE]->value.ht, "XDEBUG_TRACE", sizeof("XDEBUG_TRACE"), (void **) &dummy) == SUCCESS
  36. + )
  37. + )
  38. + )
  39. + ) && XG(trace_output_dir) && strlen(XG(trace_output_dir))) {
  40. /* In case we do an auto-trace we are not interested in the return
  41. * value, but we still have to free it. */
  42. xdfree(xdebug_start_trace(NULL, XG(trace_options) TSRMLS_CC));
  43. Index: xdebug.ini
  44. ===================================================================
  45. --- xdebug.ini (revision 3206)
  46. +++ xdebug.ini (working copy)
  47. @@ -8,6 +8,13 @@
  48. ;xdebug.auto_trace = 0
  49.  
  50. ; --------------------------------------------------------------------------------------------------
  51. +; xdebug.trace_enable_trigger
  52. +; Type: integer, Default value: 0
  53. +; When this setting is set to 1, you can trigger the generation of the tracing of function calls
  54. +; by using the XDEBUG_TRACE GET/POST parameter.
  55. +xdebug.trace_enable_trigger = 0
  56. +
  57. +; --------------------------------------------------------------------------------------------------
  58. ; xdebug.collect_includes
  59. ; Type: boolean, Default value: 1
  60. ; This setting, defaulting to On, controls whether Xdebug should write the filename used in include
  61. Index: php_xdebug.h
  62. ===================================================================
  63. --- php_xdebug.h (revision 3206)
  64. +++ php_xdebug.h (working copy)
  65. @@ -163,6 +163,7 @@
  66. FILE *trace_file;
  67. zend_bool do_trace;
  68. zend_bool auto_trace;
  69. + zend_bool trace_enable_trigger;
  70. char *trace_output_dir;
  71. char *trace_output_name;
  72. long trace_options;
  73.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement