[cmclasses] r914 committed - Updated exception displaying classes by better markup. Support for cmE...

0 views
Skip to first unread message

cmcl...@googlecode.com

unread,
Jan 31, 2012, 1:21:08 AM1/31/12
to cmcl...@googlegroups.com
Revision: 914
Author: christian.wuerker
Date: Mon Jan 30 22:20:31 2012
Log: Updated exception displaying classes by better markup. Support
for cmExceptionView v0.2.

http://code.google.com/p/cmclasses/source/detail?r=914

Modified:
/trunk/src/UI/HTML/Exception/Trace.php5
/trunk/src/UI/HTML/Exception/View.php5

=======================================
--- /trunk/src/UI/HTML/Exception/Trace.php5 Fri Dec 9 22:55:35 2011
+++ /trunk/src/UI/HTML/Exception/Trace.php5 Mon Jan 30 22:20:31 2012
@@ -165,12 +165,23 @@
return "";

$content = "";
- if( isset( $trace["file"] ) )
- $content .= self::trimRootPath( $trace["file"]
)."(".$trace["line"]."): ";
- if( array_key_exists( "class", $trace ) && array_key_exists( "type",
$trace ) )
- $content .= $trace["class"].$trace["type"];
- if( array_key_exists( "function", $trace ) )
- {
+ if( isset( $trace["file"] ) ){
+ $pathName = self::trimRootPath( $trace["file"] );
+ $fileName = '<span class="file">'.pathinfo( $pathName,
PATHINFO_FILENAME ).'</span>';
+ $extension = pathinfo( $pathName, PATHINFO_EXTENSION );
+ $extension = '<span class="ext">'.( $extension ? '.'.$extension : ''
).'</span>';
+ $path = '<span class="path">'.dirname( $pathName ).'/</span>';
+ $line = '<span class="line">['.$trace["line"].']</span>';
+ $separator = '<span class="sep1">: </span>';
+ $content .= $path.$fileName.$extension.$line.$separator;
+
+ }
+ if( array_key_exists( "class", $trace ) && array_key_exists( "type",
$trace ) ){
+ $class = '<span class="class">'.$trace["class"].'</span>';
+ $type = '<span class="type">'.$trace["type"].'</span>';
+ $content .= $class.$type;
+ }
+ if( array_key_exists( "function", $trace ) ){
$block = NULL;
if( array_key_exists( "args", $trace ) && count( $trace['args'] ) )
{
@@ -185,7 +196,9 @@
$argList = UI_HTML_Tag::create( 'dl', implode( $argList ) );
$block = UI_HTML_Tag::create( 'blockquote', $argList );
}
- $content .= $trace["function"]."(".$block.')';
+ $function = '<span class="func">'.$trace["function"].'</span>';
+ $arguments = '<span class="args">('.$block.')</span>';
+ $content .= $function.$arguments;
}
# else
# die( print_m( $trace ) );
=======================================
--- /trunk/src/UI/HTML/Exception/View.php5 Tue Jan 10 01:43:28 2012
+++ /trunk/src/UI/HTML/Exception/View.php5 Mon Jan 30 22:20:31 2012
@@ -103,8 +103,16 @@
$list[] = UI_HTML_Tag::create( 'dt', 'Type', array( 'class'
=> 'exception-type' ) );
$list[] = UI_HTML_Tag::create( 'dd', get_class( $e ), array( 'class'
=> 'exception-type' ) );

+
+ $pathName = self::trimRootPath( $e->getFile() );
+ $fileName = '<span class="file">'.pathinfo( $pathName, PATHINFO_FILENAME
).'</span>';
+ $extension = pathinfo( $pathName, PATHINFO_EXTENSION );
+ $extension = '<span class="ext">'.( $extension ? '.'.$extension : ''
).'</span>';
+ $path = '<span class="path">'.dirname( $pathName ).'/</span>';
+ $file = $path.$fileName.$extension;
+
$list[] = UI_HTML_Tag::create( 'dt', 'File', array( 'class'
=> 'exception-file' ) );
- $list[] = UI_HTML_Tag::create( 'dd', self::trimRootPath( $e->getFile()
), array( 'class' => 'exception-file' ) );
+ $list[] = UI_HTML_Tag::create( 'dd',$file, array( 'class'
=> 'exception-file' ) );

$list[] = UI_HTML_Tag::create( 'dt', 'Line', array( 'class'
=> 'exception-line' ) );
$list[] = UI_HTML_Tag::create( 'dd', $e->getLine(), array( 'class'
=> 'exception-line' ) );

Reply all
Reply to author
Forward
0 new messages