Skip to content

Instantly share code, notes, and snippets.

@1f7
Created July 3, 2016 06:29
Show Gist options
  • Save 1f7/bfc836f35e8fe1d8bcae5fbf4ee250d8 to your computer and use it in GitHub Desktop.
Save 1f7/bfc836f35e8fe1d8bcae5fbf4ee250d8 to your computer and use it in GitHub Desktop.
Tracy helper
Example:
class SomeClass extends SomeExtend
{
use \Bla-Bla\Helpers\TracyTrait;
public function __construct()
{
parent::__construct();
...
...
}
}
$this->DBG($someVar);
namespace Bla-Bla\Helpers;
trait TracyTrait
{
public function DBG($var='')
{
\Tracy\Debugger::dump($var);
$t=debug_backtrace(1, 1);
//\Tracy\Debugger::barDump($t);
die('-- im in '.$t[0]['file'].', line: '.$t[0]['line'].' --');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment