From 0a17cc50ae5bfee14b3bbad05da90eb4697f5a48 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 3 Jan 2012 05:15:44 +0100 Subject: [PATCH] updated Nette\Debugger --- dibi/libs/DibiException.php | 3 -- examples/Nette/Debugger.php | 87 +++++++++++++++++++++++-------------- 2 files changed, 54 insertions(+), 36 deletions(-) diff --git a/dibi/libs/DibiException.php b/dibi/libs/DibiException.php index 309c8d26..4482b80d 100644 --- a/dibi/libs/DibiException.php +++ b/dibi/libs/DibiException.php @@ -163,6 +163,3 @@ class DibiNotImplementedException extends LogicException */ class DibiNotSupportedException extends LogicException {} - - - diff --git a/examples/Nette/Debugger.php b/examples/Nette/Debugger.php index 9f40af19..aaecb907 100644 --- a/examples/Nette/Debugger.php +++ b/examples/Nette/Debugger.php @@ -2,7 +2,7 @@ /** * This file is part of the Nette Framework (http://nette.org) * - * Copyright (c) 2004, 2011 David Grudl (http://davidgrudl.com) + * Copyright (c) 2004, 2012 David Grudl (http://davidgrudl.com) * * For the full copyright and license information, please view * the file license.txt that was distributed with this source code. @@ -19,8 +19,8 @@ DebugBar{private$panels=array();public function addPanel(IBarPanel$panel,$id=NULL){if($id===NULL){$c=0;do{$id=get_class($panel).($c++?"-$c":'');}while(isset($this->panels[$id]));}$this->panels[$id]=$panel;}public function -render(){$panels=array();foreach($this->panels -as$id=>$panel){try{$panels[]=array('id'=>preg_replace('#[^a-z0-9]+#i','-',$id),'tab'=>$tab=(string)$panel->getTab(),'panel'=>$tab?(string)$panel->getPanel():NULL);}catch(Exception$e){$panels[]=array('id'=>"error-$id",'tab'=>"Error: $id",'panel'=>nl2br(htmlSpecialChars((string)$e)));}}?> +render(){$obLevel=ob_get_level();$panels=array();foreach($this->panels +as$id=>$panel){try{$panels[]=array('id'=>preg_replace('#[^a-z0-9]+#i','-',$id),'tab'=>$tab=(string)$panel->getTab(),'panel'=>$tab?(string)$panel->getPanel():NULL);}catch(Exception$e){$panels[]=array('id'=>"error-$id",'tab'=>"Error: $id",'panel'=>nl2br(htmlSpecialChars((string)$e)));while(ob_get_level()>$obLevel){ob_end_clean();}}}?> @@ -113,8 +113,7 @@ addPanel($panel,$id=NULL){if($id===NULL){$this->panels[]=$panel;}else{$this->pan function render(Exception$exception){$panels=$this->panels;static$errorTypes=array(E_ERROR=>'Fatal Error',E_USER_ERROR=>'User Error',E_RECOVERABLE_ERROR=>'Recoverable Error',E_CORE_ERROR=>'Core Error',E_COMPILE_ERROR=>'Compile Error',E_PARSE=>'Parse Error',E_WARNING=>'Warning',E_CORE_WARNING=>'Core Warning',E_COMPILE_WARNING=>'Compile Warning',E_USER_WARNING=>'User Warning',E_NOTICE=>'Notice',E_USER_NOTICE=>'User Notice',E_STRICT=>'Strict',E_DEPRECATED=>'Deprecated',E_USER_DEPRECATED=>'User Deprecated');$title=($exception instanceof -FatalErrorException&&isset($errorTypes[$exception->getSeverity()]))?$errorTypes[$exception->getSeverity()]:get_class($exception);$expandPath=NETTE_DIR.DIRECTORY_SEPARATOR;$counter=0;?> - +FatalErrorException&&isset($errorTypes[$exception->getSeverity()]))?$errorTypes[$exception->getSeverity()]:get_class($exception);$expandPath=NETTE_DIR.DIRECTORY_SEPARATOR;$counter=0;?> @@ -125,7 +124,7 @@ FatalErrorException&&isset($errorTypes[$exception->getSeverity()]))?$errorTypes[ htmlspecialchars($title)?> - + @@ -168,6 +167,7 @@ htmlspecialchars($ex->getMessage())?>

+

@@ -269,14 +269,16 @@ as$k=>$v){echo'$',htmlspecialchars($k),'',DebugHelpers::clickab + +

-
+
@@ -289,9 +291,9 @@ htmlSpecialChars($panel['tab'])?>
-

Constants

-
- +

Constants

+
+
$v){echo'';echo'\n";}?> @@ -300,10 +302,10 @@ foreach($list['user']as$k=>$v){echo'';echo' -

Included files (Included files ()

-
-
',htmlspecialchars($k),'',DebugHelpers::clickableDump($v),"
',htmlspecialchars($k),'
+
+
\n";}?> @@ -311,11 +313,15 @@ foreach(get_included_files()as$v){echo' -

$_SERVER

- -

empty

- -
+

Configuration options

+
+ |.+$#s','',ob_get_clean())?> +
+ + +

$_SERVER

+
',htmlspecialchars($v),"
',htmlspecialchars($v),"
$v)echo'\n";?>
',htmlspecialchars($k),'',DebugHelpers::clickableDump($v),"
-
@@ -378,6 +383,20 @@ htmlspecialchars($s),'
';?>
+ + +
+

+ +
+ +
+ + + +