Created
August 28, 2011 09:19
-
-
Save JanVoracek/1176462 to your computer and use it in GitHub Desktop.
Nette Debugger::barDump() vylepšená zkratka – do titulku přidává třídu/soubor a řádek, odkud je volána
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function barDump($var, $title='') | |
{ | |
$backtrace = debug_backtrace(null/*, 2*/); // Ready for PHP 5.4 | |
$source = (isset($backtrace[1]['class'])) ? | |
$backtrace[1]['class'] : | |
basename($backtrace[0]['file']); | |
$line = $backtrace[0]['line']; | |
if($title !== '') | |
$title .= ' – '; | |
return Nette\Diagnostics\Debugger::barDump($var, $title . $source . ' (' . $line .')'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment