Skip to content

Instantly share code, notes, and snippets.

@JanVoracek
Created August 28, 2011 09:19
Show Gist options
  • Save JanVoracek/1176462 to your computer and use it in GitHub Desktop.
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
<?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