Author: ts
Date: Tue Feb 26 12:32:26 2008
New Revision: 7448

Log:
- Implemented enhancement #10701: Getting a readable backtrace. The
  ezcDebug->log() method now allows you to selectively add a stack trace to
  debug log messages. The new ezcDebugOptions class allows to globally switch
  on stack traces for all log messages.

Added:
    trunk/Debug/tests/formatters/input/
    trunk/Debug/tests/formatters/input/class.php   (with props)
    trunk/Debug/tests/formatters/input/stacktrace_php.php   (with props)
    trunk/Debug/tests/formatters/input/stacktrace_xdebug.php   (with props)
    trunk/Debug/tests/formatters/output/output_with_php_stacktrace.html
    trunk/Debug/tests/formatters/output/output_with_xdebug_stacktrace.html
Modified:
    trunk/Debug/ChangeLog
    trunk/Debug/src/formatters/html_formatter.php
    trunk/Debug/src/structs/debug_structure.php
    trunk/Debug/tests/formatters/html_formatter_data_structures.php
    trunk/Debug/tests/formatters/html_formatter_test.php

Modified: trunk/Debug/ChangeLog
==============================================================================
--- trunk/Debug/ChangeLog [iso-8859-1] (original)
+++ trunk/Debug/ChangeLog [iso-8859-1] Tue Feb 26 12:32:26 2008
@@ -1,6 +1,10 @@
-1.1.1 - [RELEASEDATE]
+1.2 - [RELEASEDATE]
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+- Implemented enhancement #10701: Getting a readable backtrace. The
+  ezcDebug->log() method now allows you to selectively add a stack trace to
+  debug log messages. The new ezcDebugOptions class allows to globally switch
+  on stack traces for all log messages.
 - Fixed issue #12427: Changed output rendering of the debug formatter to not
   include a stylesheet by default, but instead the formatter now includes easy
   overridable CSS classes.

Modified: trunk/Debug/src/formatters/html_formatter.php
==============================================================================
--- trunk/Debug/src/formatters/html_formatter.php [iso-8859-1] (original)
+++ trunk/Debug/src/formatters/html_formatter.php [iso-8859-1] Tue Feb 26 
12:32:26 2008
@@ -87,10 +87,59 @@
     <td colspan='2'>{$w->message}</td>
 </tr>
 ENDT;
+            if ( isset( $w->stackTrace ) )
+            {
+                $str .= "<tr class='debugstacktrace'>";
+                $str .= "<td colspan='2'>";
+                $str .= $this->formatStackTrace( $w->stackTrace );
+                $str .= "</td>";
+                $str .= "</tr>";
+            }
         }
         $str .= "</table>\n";
 
         return $str;
+    }
+
+    public function formatStackTrace( ezcDebugStacktraceIterator $stackTrace )
+    {
+        $res = <<<EOT
+<table class='stacktrace'>
+<tr>
+    <td class='stacktraceno'>
+        #
+    </td>
+    <td class='stacktracefunction'>
+        Function
+    </td>
+    <td class='stacktracelocation'>
+        Location
+    </td>
+</tr>
+EOT;
+        foreach ( $stackTrace as $index => $element )
+        {
+            $function = ( isset( $element['class'] ) ? "{$element['class']}::" 
: '' )
+                . $element['function'] . '('
+                . implode( ', ', $element['params'] )
+                . ')';
+            $location = "{$element['file']}:{$element['line']}";
+            $res .= <<<EOT
+<tr>
+    <td class='stacktraceno'>
+        $index
+    </td>
+    <td class='stacktracefunction'>
+        $function
+    </td>
+    <td class='stacktracelocation'>
+        $location
+    </td>
+</tr>
+EOT;
+        }
+        $res .= "</table>\n";
+        return  $res;
     }
 
     /**

Modified: trunk/Debug/src/structs/debug_structure.php
==============================================================================
--- trunk/Debug/src/structs/debug_structure.php [iso-8859-1] (original)
+++ trunk/Debug/src/structs/debug_structure.php [iso-8859-1] Tue Feb 26 
12:32:26 2008
@@ -64,6 +64,18 @@
     }
 
     /**
+     * Returns if the given property isset.
+     * 
+     * @param string $name 
+     * @return bool
+     * @ignore
+     */
+    public function __isset( $name )
+    {
+        return array_key_exists( $name, $this->properties );
+    }
+
+    /**
      * Generates string output of the debug messages.
      *
      * The output generated is each value listed in the form "'key' => 
'value'".

Modified: trunk/Debug/tests/formatters/html_formatter_data_structures.php
==============================================================================
--- trunk/Debug/tests/formatters/html_formatter_data_structures.php 
[iso-8859-1] (original)
+++ trunk/Debug/tests/formatters/html_formatter_data_structures.php 
[iso-8859-1] Tue Feb 26 12:32:26 2008
@@ -7,6 +7,8 @@
  * @package Debug
  * @subpackage Tests
  */
+
+require 'input/class.php';
 
 /**
  * Class used in the test suite.
@@ -142,6 +144,40 @@
         return $time;
     }
 
+    public function getLogStructureWithPhpStacktrace()
+    {
+        $rawTrace = require 'input/stacktrace_php.php';
+        $stacktrace = new ezcDebugPhpStacktraceIterator(
+            $rawTrace,
+            0,
+            new ezcDebugOptions()
+        );
+        $log = $this->getLogStructure();
+
+        foreach ( $log as $logItem )
+        {
+            $logItem->stackTrace = $stacktrace;
+        }
+        return $log;
+    }
+
+    public function getLogStructureWithXdebugStacktrace()
+    {
+        $rawTrace = require 'input/stacktrace_xdebug.php';
+        $stacktrace = new ezcDebugXdebugStacktraceIterator(
+            $rawTrace,
+            0,
+            new ezcDebugOptions()
+        );
+        $log = $this->getLogStructure();
+
+        foreach ( $log as $logItem )
+        {
+            $logItem->stackTrace = $stacktrace;
+        }
+        return $log;
+    }
+
     protected function mySQLFunction(&$time)
     {
         $time->startTimer("my query", "html_reporter_test" , "query");

Modified: trunk/Debug/tests/formatters/html_formatter_test.php
==============================================================================
--- trunk/Debug/tests/formatters/html_formatter_test.php [iso-8859-1] (original)
+++ trunk/Debug/tests/formatters/html_formatter_test.php [iso-8859-1] Tue Feb 
26 12:32:26 2008
@@ -27,6 +27,40 @@
         self::assertEquals( $expected, $out );
     }
 
+    public function testHtmlWithPhpStacktrace()
+    {
+        $html = new ezcDebugHtmlFormatter();
+
+        $struct = new HtmlReporterDataStructures();
+
+        $out = $html->generateOutput(
+            $struct->getLogStructureWithPhpStacktrace(),
+            $struct->getTimeStructure()
+        );
+        // file_put_contents( dirname( __FILE__ ) . 
'/output/output_with_php_stacktrace.html', $out );
+        $expected = file_get_contents(
+            dirname( __FILE__ ) . '/output/output_with_php_stacktrace.html'
+        );
+        $this->assertEquals( $expected, $out );
+    }
+
+    public function testHtmlWithXdebugStacktrace()
+    {
+        $html = new ezcDebugHtmlFormatter();
+
+        $struct = new HtmlReporterDataStructures();
+
+        $out = $html->generateOutput(
+            $struct->getLogStructureWithXdebugStacktrace(),
+            $struct->getTimeStructure()
+        );
+        file_put_contents( dirname( __FILE__ ) . 
'/output/output_with_xdebug_stacktrace.html', $out );
+        $expected = file_get_contents(
+            dirname( __FILE__ ) . '/output/output_with_xdebug_stacktrace.html'
+        );
+        $this->assertEquals( $expected, $out );
+    }
+
     public static function suite()
     {
         return new PHPUnit_Framework_TestSuite( __CLASS__ );

Added: trunk/Debug/tests/formatters/input/class.php
==============================================================================
--- trunk/Debug/tests/formatters/input/class.php (added)
+++ trunk/Debug/tests/formatters/input/class.php [iso-8859-1] Tue Feb 26 
12:32:26 2008
@@ -1,0 +1,74 @@
+<?php
+
+class DebugTestFormatterClass
+{
+    public function fooBar()
+    {
+        $test = 23;
+        $this->fooBaz(
+            $test,
+            array(
+                23.0,
+                fopen( __FILE__, 'r' ),
+                1,
+                2,
+                array(
+                    'a',
+                    'b',
+                    true,
+                    new DebugTestFormatterContainerClass()
+                ),
+                array(
+                    23.42,
+                    false,
+                    null,
+                    'test',
+                    array(
+                        'deep',
+                        'deeper',
+                        'deepest'
+                    )
+                )
+            )
+        );
+    }
+
+    private function fooBaz( $a, $b, $c = true )
+    {
+        self::testStatic();
+    }
+
+    protected static function testStatic()
+    {
+        file_put_contents( 'php_stacktrace.php', var_export( 
debug_backtrace(), true ) );
+        // file_put_contents( 'xdebug_stacktrace.php', var_export( 
xdebug_get_function_stack(), true ) );
+    }
+
+    public static function __set_state( array $state )
+    {
+        return new DebugTestFormatterClass();
+    }
+}
+
+class DebugTestFormatterContainerClass extends stdClass
+{
+    public static function __set_state( array $state )
+    {
+        $obj = new DebugTestFormatterContainerClass();
+        foreach ( $state as $key => $val )
+        {
+            $obj->$key = $val;
+        }
+        return $obj;
+    }
+}
+
+function testDebugFormatter( $bar )
+{
+    $foo = new DebugTestFormatterClass();
+    $foo->fooBar();
+}
+
+// testDebugFormatter( 'test' );
+
+?>

Propchange: trunk/Debug/tests/formatters/input/class.php
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/Debug/tests/formatters/input/stacktrace_php.php
==============================================================================
--- trunk/Debug/tests/formatters/input/stacktrace_php.php (added)
+++ trunk/Debug/tests/formatters/input/stacktrace_php.php [iso-8859-1] Tue Feb 
26 12:32:26 2008
@@ -1,0 +1,85 @@
+<?php
+
+return array (
+  0 => 
+  array (
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 38,
+    'function' => 'testStatic',
+    'class' => 'DebugTestFormatterClass',
+    'type' => '::',
+    'args' => 
+    array (
+    ),
+  ),
+  1 => 
+  array (
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 33,
+    'function' => 'fooBaz',
+    'class' => 'DebugTestFormatterClass',
+    'object' => 
+    DebugTestFormatterClass::__set_state(array(
+    )),
+    'type' => '->',
+    'args' => 
+    array (
+      0 => 23,
+      1 => 
+      array (
+        0 => 23,
+        1 => NULL,
+        2 => 1,
+        3 => 2,
+        4 => 
+        array (
+          0 => 'a',
+          1 => 'b',
+          2 => true,
+          3 => 
+          DebugTestFormatterContainerClass::__set_state(array(
+          )),
+        ),
+        5 => 
+        array (
+          0 => 23.42,
+          1 => false,
+          2 => NULL,
+          3 => 'test',
+          4 => 
+          array (
+            0 => 'deep',
+            1 => 'deeper',
+            2 => 'deepest',
+          ),
+        ),
+      ),
+    ),
+  ),
+  2 => 
+  array (
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 69,
+    'function' => 'fooBar',
+    'class' => 'DebugTestFormatterClass',
+    'object' => 
+    DebugTestFormatterClass::__set_state(array(
+    )),
+    'type' => '->',
+    'args' => 
+    array (
+    ),
+  ),
+  3 => 
+  array (
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 72,
+    'function' => 'testDebugFormatter',
+    'args' => 
+    array (
+      0 => 'test',
+    ),
+  ),
+);
+
+?>

Propchange: trunk/Debug/tests/formatters/input/stacktrace_php.php
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/Debug/tests/formatters/input/stacktrace_xdebug.php
==============================================================================
--- trunk/Debug/tests/formatters/input/stacktrace_xdebug.php (added)
+++ trunk/Debug/tests/formatters/input/stacktrace_xdebug.php [iso-8859-1] Tue 
Feb 26 12:32:26 2008
@@ -1,0 +1,58 @@
+<?php
+
+return array (
+  0 => 
+  array (
+    'function' => '{main}',
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 0,
+    'params' => 
+    array (
+    ),
+  ),
+  1 => 
+  array (
+    'function' => 'testDebugFormatter',
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 72,
+    'params' => 
+    array (
+      'bar' => '\'test\'',
+    ),
+  ),
+  2 => 
+  array (
+    'function' => 'fooBar',
+    'class' => 'DebugTestFormatterClass',
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 69,
+    'params' => 
+    array (
+    ),
+  ),
+  3 => 
+  array (
+    'function' => 'fooBaz',
+    'class' => 'DebugTestFormatterClass',
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 33,
+    'params' => 
+    array (
+      'a' => '23',
+      'b' => 'array (0 => 23, 1 => resource(5) of type (stream), 2 => 1, 3 => 
2, 4 => array (0 => \'a\', 1 => \'b\', 2 => TRUE, 3 => class stdClass { ... }), 
5 => array (0 => 23.42, 1 => FALSE, 2 => NULL, 3 => \'test\', 4 => array 
(...)))',
+      'c' => 'NULL',
+    ),
+  ),
+  4 => 
+  array (
+    'function' => 'testStatic',
+    'class' => 'DebugTestFormatterClass',
+    'file' => '/home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php',
+    'line' => 38,
+    'params' => 
+    array (
+    ),
+  ),
+);
+
+?>

Propchange: trunk/Debug/tests/formatters/input/stacktrace_xdebug.php
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/Debug/tests/formatters/output/output_with_php_stacktrace.html
==============================================================================
--- trunk/Debug/tests/formatters/output/output_with_php_stacktrace.html (added)
+++ trunk/Debug/tests/formatters/output/output_with_php_stacktrace.html 
[iso-8859-1] Tue Feb 26 12:32:26 2008
@@ -1,0 +1,178 @@
+<div class="ezc-debug-output"><table class='log'>
+<tr class='debugheader'>
+    <td class='source'>
+        <span class='verbosity1'>1: content::sql</span>
+    </td>
+    <td class='date'>2008-02-01 12:49:51 +0000</td>
+</tr>
+<tr class='debugbody'>
+    <td colspan='2'>SELECT contentobject_id, login, email, password_hash, 
password_hash_type
+ FROM ezuser
+ WHERE contentobject_id='10'</td>
+</tr><tr class='debugstacktrace'><td colspan='2'><table class='stacktrace'>
+<tr>
+    <td class='stacktraceno'>
+        #
+    </td>
+    <td class='stacktracefunction'>
+        Function
+    </td>
+    <td class='stacktracelocation'>
+        Location
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        0
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::testStatic()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:38
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        1
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::fooBaz(23, array (0 => 23, 1 => NULL, 2 => 1, 
3 => 2, 4 => array (0 => 'a', 1 => 'b', 2 => TRUE, 3 => class 
DebugTestFormatterContainerClass {  }), 5 => array (0 => 23.42, 1 => FALSE, 2 
=> NULL, 3 => 'test', 4 => array (0 => 'deep', 1 => 'deeper', 2 => 'deepest'))))
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:33
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        2
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::fooBar()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:69
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        3
+    </td>
+    <td class='stacktracefunction'>
+        testDebugFormatter('test')
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:72
+    </td>
+</tr></table>
+</td></tr><tr class='debugheader'>
+    <td class='source'>
+        <span class='verbosity2'>2: content::sql</span>
+    </td>
+    <td class='date'>2008-02-01 12:49:51 +0000</td>
+</tr>
+<tr class='debugbody'>
+    <td colspan='2'>SELECT DISTINCT ezdiscountrule.id
+ FROM ezdiscountrule,
+ ezuser_discountrule
+ WHERE ezuser_discountrule.contentobject_id = '10' AND
+ezuser_discountrule.discountrule_id = ezdiscountrule.id</td>
+</tr><tr class='debugstacktrace'><td colspan='2'><table class='stacktrace'>
+<tr>
+    <td class='stacktraceno'>
+        #
+    </td>
+    <td class='stacktracefunction'>
+        Function
+    </td>
+    <td class='stacktracelocation'>
+        Location
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        0
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::testStatic()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:38
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        1
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::fooBaz(23, array (0 => 23, 1 => NULL, 2 => 1, 
3 => 2, 4 => array (0 => 'a', 1 => 'b', 2 => TRUE, 3 => class 
DebugTestFormatterContainerClass {  }), 5 => array (0 => 23.42, 1 => FALSE, 2 
=> NULL, 3 => 'test', 4 => array (0 => 'deep', 1 => 'deeper', 2 => 'deepest'))))
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:33
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        2
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::fooBar()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:69
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        3
+    </td>
+    <td class='stacktracefunction'>
+        testDebugFormatter('test')
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:72
+    </td>
+</tr></table>
+</td></tr></table>
+<table class='accumulator'>
+    <tr>
+        <th>Timings</th>
+        <th>Elapsed</th>
+        <th>Percent</th>
+        <th>Count</th>
+        <th>Average</th>
+    </tr>
+    <tr class='group-header'>
+        <th colspan='5'>html_reporter_test</th>
+    </tr>
+    <tr class='group'>
+        <td class='tp-name'>my query</td>
+        <td class='tp-elapsed'>0.00005</td>
+        <td class='tp-percent'>11.09 %</td>
+        <td class='tp-count'>3</td>
+        <td class='tp-average'>0.00002</td>
+    </tr>
+    <tr class='group'>
+        <td class='tp-name'>replace mysql</td>
+        <td class='tp-elapsed'>0.00003</td>
+        <td class='tp-percent'>6.94 %</td>
+        <td class='tp-count'>2</td>
+        <td class='tp-average'>0.00002</td>
+    </tr>
+    <tr class='group'>
+        <td class='tp-name'>Script</td>
+        <td class='tp-elapsed'>0.00038</td>
+        <td class='tp-percent'>81.97 %</td>
+        <td class='tp-count'>1</td>
+        <td class='tp-average'>0.00038</td>
+    </tr>
+    <tr class='totals'>
+        <th class='tp-total'>Total:</th>
+        <td class='tp-elapsed'>0.00046</td>
+        <td class='tp-percent'>100.00 %</td>
+        <td class='tp-count'>6</td>
+        <td class='tp-average'>0.00008</td>
+    </tr>
+    <tr class='group-header'>
+        <th colspan='5'>content</th>
+    </tr>
+    <tr class='group'>
+        <td class='tp-name'>Timing module</td>
+        <td class='tp-elapsed'>0.00032</td>
+        <td class='tp-percent'>100.00 %</td>
+        <td class='tp-count'>1</td>
+        <td class='tp-average'>0.00032</td>
+    </tr>
+</table></div>

Added: trunk/Debug/tests/formatters/output/output_with_xdebug_stacktrace.html
==============================================================================
--- trunk/Debug/tests/formatters/output/output_with_xdebug_stacktrace.html 
(added)
+++ trunk/Debug/tests/formatters/output/output_with_xdebug_stacktrace.html 
[iso-8859-1] Tue Feb 26 12:32:26 2008
@@ -1,0 +1,198 @@
+<div class="ezc-debug-output"><table class='log'>
+<tr class='debugheader'>
+    <td class='source'>
+        <span class='verbosity1'>1: content::sql</span>
+    </td>
+    <td class='date'>2008-02-01 12:49:51 +0000</td>
+</tr>
+<tr class='debugbody'>
+    <td colspan='2'>SELECT contentobject_id, login, email, password_hash, 
password_hash_type
+ FROM ezuser
+ WHERE contentobject_id='10'</td>
+</tr><tr class='debugstacktrace'><td colspan='2'><table class='stacktrace'>
+<tr>
+    <td class='stacktraceno'>
+        #
+    </td>
+    <td class='stacktracefunction'>
+        Function
+    </td>
+    <td class='stacktracelocation'>
+        Location
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        0
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::testStatic()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:38
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        1
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::fooBaz(23, array (0 => 23, 1 => resource(5) 
of type (stream), 2 => 1, 3 => 2, 4 => array (0 => 'a', 1 => 'b', 2 => TRUE, 3 
=> class stdClass { ... }), 5 => array (0 => 23.42, 1 => FALSE, 2 => NULL, 3 => 
'test', 4 => array (...))), NULL)
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:33
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        2
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::fooBar()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:69
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        3
+    </td>
+    <td class='stacktracefunction'>
+        testDebugFormatter('test')
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:72
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        4
+    </td>
+    <td class='stacktracefunction'>
+        {main}()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:0
+    </td>
+</tr></table>
+</td></tr><tr class='debugheader'>
+    <td class='source'>
+        <span class='verbosity2'>2: content::sql</span>
+    </td>
+    <td class='date'>2008-02-01 12:49:51 +0000</td>
+</tr>
+<tr class='debugbody'>
+    <td colspan='2'>SELECT DISTINCT ezdiscountrule.id
+ FROM ezdiscountrule,
+ ezuser_discountrule
+ WHERE ezuser_discountrule.contentobject_id = '10' AND
+ezuser_discountrule.discountrule_id = ezdiscountrule.id</td>
+</tr><tr class='debugstacktrace'><td colspan='2'><table class='stacktrace'>
+<tr>
+    <td class='stacktraceno'>
+        #
+    </td>
+    <td class='stacktracefunction'>
+        Function
+    </td>
+    <td class='stacktracelocation'>
+        Location
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        0
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::testStatic()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:38
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        1
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::fooBaz(23, array (0 => 23, 1 => resource(5) 
of type (stream), 2 => 1, 3 => 2, 4 => array (0 => 'a', 1 => 'b', 2 => TRUE, 3 
=> class stdClass { ... }), 5 => array (0 => 23.42, 1 => FALSE, 2 => NULL, 3 => 
'test', 4 => array (...))), NULL)
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:33
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        2
+    </td>
+    <td class='stacktracefunction'>
+        DebugTestFormatterClass::fooBar()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:69
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        3
+    </td>
+    <td class='stacktracefunction'>
+        testDebugFormatter('test')
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:72
+    </td>
+</tr><tr>
+    <td class='stacktraceno'>
+        4
+    </td>
+    <td class='stacktracefunction'>
+        {main}()
+    </td>
+    <td class='stacktracelocation'>
+        /home/dotxp/dev/PHP/actual/ezcomponents/trunk/backtrace.php:0
+    </td>
+</tr></table>
+</td></tr></table>
+<table class='accumulator'>
+    <tr>
+        <th>Timings</th>
+        <th>Elapsed</th>
+        <th>Percent</th>
+        <th>Count</th>
+        <th>Average</th>
+    </tr>
+    <tr class='group-header'>
+        <th colspan='5'>html_reporter_test</th>
+    </tr>
+    <tr class='group'>
+        <td class='tp-name'>my query</td>
+        <td class='tp-elapsed'>0.00005</td>
+        <td class='tp-percent'>11.09 %</td>
+        <td class='tp-count'>3</td>
+        <td class='tp-average'>0.00002</td>
+    </tr>
+    <tr class='group'>
+        <td class='tp-name'>replace mysql</td>
+        <td class='tp-elapsed'>0.00003</td>
+        <td class='tp-percent'>6.94 %</td>
+        <td class='tp-count'>2</td>
+        <td class='tp-average'>0.00002</td>
+    </tr>
+    <tr class='group'>
+        <td class='tp-name'>Script</td>
+        <td class='tp-elapsed'>0.00038</td>
+        <td class='tp-percent'>81.97 %</td>
+        <td class='tp-count'>1</td>
+        <td class='tp-average'>0.00038</td>
+    </tr>
+    <tr class='totals'>
+        <th class='tp-total'>Total:</th>
+        <td class='tp-elapsed'>0.00046</td>
+        <td class='tp-percent'>100.00 %</td>
+        <td class='tp-count'>6</td>
+        <td class='tp-average'>0.00008</td>
+    </tr>
+    <tr class='group-header'>
+        <th colspan='5'>content</th>
+    </tr>
+    <tr class='group'>
+        <td class='tp-name'>Timing module</td>
+        <td class='tp-elapsed'>0.00032</td>
+        <td class='tp-percent'>100.00 %</td>
+        <td class='tp-count'>1</td>
+        <td class='tp-average'>0.00032</td>
+    </tr>
+</table></div>


-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to