Index: trunk/tools/debug_sample.php
===================================================================
diff -u
--- trunk/tools/debug_sample.php (revision 0)
+++ trunk/tools/debug_sample.php (revision 816)
@@ -0,0 +1,123 @@
+Affected_Rows().'] '.$after;
+ }
+
+ if($newline) $msg .= "
\n";
+ if( defined('SQL_TO_SCREEN') && SQL_TO_SCREEN == 1 ) echo $msg;
+ if( defined('SQL_TO_FILE') && SQL_TO_FILE == 1 )
+ {
+ if($file_reset == false && defined('SQL_OVERWRITE') && SQL_OVERWRITE)
+ {
+ if( file_exists(SQL_OUTPUT) ) unlink(SQL_OUTPUT);
+ $file_reset = true;
+ }
+ $msg = str_replace(Array("
','<','>','"'),Array('','','<','>','"'),$msg);
+ $fp = fopen(SQL_OUTPUT, 'a');
+ fwrite($fp,$msg);
+ fclose($fp);
+ }
+ }
+
+ /**
+ * @return string
+ * @desc Returnts trace results to place where called from
+ */
+ function trace()
+ {
+ $trace_results = debug_backtrace();
+ array_shift($trace_results);
+ echo 'Called from ['.$trace_results[0]['function'].']