[xdebug-dev] xdebug www.derickrethans.nl/html/rss.xml www.derickrethans.nl/html/files/php-secrets-phptek7.pdf xdebug/php_xdebug.h xdebug/xdebug.c xdebug/tests/test3.phpt - Put back the disabling of stack traces - apperently people were relying on

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Sun, 27 May 2007 23:25:52 +0200

Date: Sun May 27 23:25:52 CEST 2007
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Put back the disabling of stack traces - apperently people were relying on
  this.

Modified files:
           xdebug/php_xdebug.h (version: 1.131)
           xdebug/xdebug.c (version: 1.388)
           xdebug/tests/test3.phpt (version: 1.6)

[FILE: /xdebug/php_xdebug.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -r1.130 -r1.131
--- xdebug/php_xdebug.h:1.130 Thu May 17 17:47:57 2007 GMT
+++ xdebug/php_xdebug.h Sun May 27 19:25:51 2007 GMT
@@ -87,6 +87,11 @@
 PHP_FUNCTION(xdebug_debug_zval);
 PHP_FUNCTION(xdebug_debug_zval_stdout);
 
+/* activation functions */
+PHP_FUNCTION(xdebug_enable);
+PHP_FUNCTION(xdebug_disable);
+PHP_FUNCTION(xdebug_is_enabled);
+
 /* breaking functions */
 PHP_FUNCTION(xdebug_break);
 
@@ -115,6 +120,7 @@
         long level;
         xdebug_llist *stack;
         long max_nesting_level;
+ zend_bool default_enable;
         zend_bool collect_includes;
         zend_bool collect_params;
         zend_bool collect_return;

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.387
retrieving revision 1.388
diff -u -r1.387 -r1.388
--- xdebug/xdebug.c:1.387 Sat May 26 17:54:05 2007 GMT
+++ xdebug/xdebug.c Sun May 27 19:25:51 2007 GMT
@@ -119,6 +119,9 @@
         PHP_FE(xdebug_debug_zval, NULL)
         PHP_FE(xdebug_debug_zval_stdout, NULL)
 
+ PHP_FE(xdebug_enable, NULL)
+ PHP_FE(xdebug_disable, NULL)
+ PHP_FE(xdebug_is_enabled, NULL)
         PHP_FE(xdebug_break, NULL)
 
         PHP_FE(xdebug_start_trace, NULL)
@@ -266,6 +269,7 @@
 #endif
         STD_PHP_INI_BOOLEAN("xdebug.collect_return", "0", PHP_INI_ALL, OnUpdateBool, collect_return, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_BOOLEAN("xdebug.collect_vars", "0", PHP_INI_ALL, OnUpdateBool, collect_vars, zend_xdebug_globals, xdebug_globals)
+ STD_PHP_INI_BOOLEAN("xdebug.default_enable", "1", PHP_INI_ALL, OnUpdateBool, default_enable, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_BOOLEAN("xdebug.extended_info", "1", PHP_INI_SYSTEM, OnUpdateBool, extended_info, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.manual_url", "http://www.php.net", PHP_INI_ALL, OnUpdateString, manual_url, zend_xdebug_globals, xdebug_globals)
 #if ZEND_EXTENSION_API_NO < 90000000
@@ -744,11 +748,13 @@
         /* Only enabled extended info when it is not disabled */
         CG(extended_info) = XG(extended_info);
 
- zend_error_cb = new_error_cb;
+ if (XG(default_enable)) {
+ zend_error_cb = new_error_cb;
+
 #ifdef ZEND_ENGINE_2
- zend_throw_exception_hook = xdebug_throw_exception_hook;
+ zend_throw_exception_hook = xdebug_throw_exception_hook;
 #endif
-
+ }
         XG(remote_enabled) = 0;
         XG(profiler_enabled) = 0;
         XG(breakpoints_allowed) = 1;
@@ -2626,6 +2632,33 @@
 }
 /* }}} */
 
+PHP_FUNCTION(xdebug_enable)
+{
+ zend_error_cb = new_error_cb;
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
+ zend_throw_exception_hook = xdebug_throw_exception_hook;
+#endif
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 0)
+ zend_opcode_handlers[ZEND_EXIT] = xdebug_exit_handler;
+#endif
+}
+
+PHP_FUNCTION(xdebug_disable)
+{
+ zend_error_cb = old_error_cb;
+#ifdef ZEND_ENGINE_2
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 0)
+ zend_opcode_handlers[ZEND_EXIT] = old_exit_handler;
+# endif
+ zend_throw_exception_hook = NULL;
+#endif
+}
+
+PHP_FUNCTION(xdebug_is_enabled)
+{
+ RETURN_BOOL(zend_error_cb == new_error_cb);
+}
+
 PHP_FUNCTION(xdebug_break)
 {
         char *file;

[FILE: /xdebug/tests/test3.phpt]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
Received on Sun May 27 2007 - 23:26:01 BST

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