[xdebug-dev] xdebug xdebug/xdebug.c xdebug/tests/bug00314.phpt - MFH: Fixed bug #314: PHP CLI Error Logging thwarted when XDebug Loaded.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Sat, 27 Oct 2007 20:25:41 +0200

Date: Sat Oct 27 20:25:41 CEST 2007
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- MFH: Fixed bug #314: PHP CLI Error Logging thwarted when XDebug Loaded.

Modified files:
           xdebug/xdebug.c (version: 1.400.2.6)
Added files:
           xdebug/tests/bug00314.phpt (new version: 1.1.2.2)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.400.2.5
retrieving revision 1.400.2.6
diff -u -r1.400.2.5 -r1.400.2.6
--- xdebug/xdebug.c:1.400.2.5 Thu Oct 25 18:44:15 2007 GMT
+++ xdebug/xdebug.c Sat Oct 27 16:25:41 2007 GMT
@@ -1694,15 +1694,10 @@
 
 static void log_stack(const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno TSRMLS_DC)
 {
- int is_cli = (strcmp("cli", sapi_module.name) == 0);
         xdebug_llist_element *le;
         function_stack_entry *i;
         char *tmp_log_message;
 
- if (is_cli) {
- return;
- }
-
         tmp_log_message = xdebug_sprintf( "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);
         php_log_err(tmp_log_message TSRMLS_CC);
         xdfree(tmp_log_message);

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

--TEST--
Test for bug #314: PHP CLI Error Logging thwarted when XDebug Loaded.
--SKIPIF--
<?php if (!extension_loaded("xdebug")) print "skip"; ?>
--INI--
xdebug.default_enable=1
xdebug.dump_globals=0
xdebug.show_mem_delta=0
xdebug.profiler_enable=0
xdebug.trace_format=0
log_errors=1
error_log=/tmp/bug315.log
--FILE--
<?php
@unlink("/tmp/bug315.log");
trigger_error('Error', E_USER_WARNING);
echo "FROM LOG\n";
echo file_get_contents("/tmp/bug315.log");
?>
--EXPECTF--
Warning: Error in %sbug00314.php on line 3

Call Stack:
%w%f %w%d 1. {main}() %sbug00314.php:0
%w%f %w%d 2. trigger_error('Error', 512) %sbug00314.php:3

FROM LOG
[%d-%s-%d %d:%d:%d] PHP Warning: Error in %sbug00314.php on line 3
[%d-%s-%d %d:%d:%d] PHP Stack trace:
[%d-%s-%d %d:%d:%d] PHP 1. {main}() %sbug00314.php:0
[%d-%s-%d %d:%d:%d] PHP 2. trigger_error('Error', 512) %sbug00314.php:3
Received on Sat Oct 27 2007 - 20:25:52 BST

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