Skip to content

Commit

Permalink
Avoid notice thrown in debug().
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Sep 16, 2014
1 parent 6e8f607 commit 21fbb97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/basics.php
Expand Up @@ -52,7 +52,11 @@ function debug($var, $showHtml = null, $showFrom = true) {
$lineInfo = '';
if ($showFrom) {
$trace = Debugger::trace(array('start' => 1, 'depth' => 2, 'format' => 'array'));
$file = str_replace(array(CAKE_CORE_INCLUDE_PATH, ROOT), '', $trace[0]['file']);
$search = array(ROOT);
if (defined('CAKE_CORE_INCLUDE_PATH')) {
array_unshift($search, CAKE_CORE_INCLUDE_PATH);
}
$file = str_replace($search, '', $trace[0]['file']);
$line = $trace[0]['line'];
}
$html = <<<HTML
Expand Down

0 comments on commit 21fbb97

Please sign in to comment.