Tiny Improvement of debug() output when running on console

Signed-off-by: mark_story <mark@mark-story.com>
This commit is contained in:
MGriesbach 2010-06-03 18:24:02 +02:00 committed by mark_story
parent 138482741f
commit cef9927604

View file

@ -94,16 +94,29 @@
if (Configure::read('debug') > 0) { if (Configure::read('debug') > 0) {
if ($showFrom) { if ($showFrom) {
$calledFrom = debug_backtrace(); $calledFrom = debug_backtrace();
echo '<strong>' . substr(str_replace(ROOT, '', $calledFrom[0]['file']), 1) . '</strong>'; if(defined('CAKEPHP_SHELL')){
echo ' (line <strong>' . $calledFrom[0]['line'] . '</strong>)'; echo "##########DEBUG##########\n";
echo substr(str_replace(ROOT, '', $calledFrom[0]['file']), 1) ;
echo ' (line ' . $calledFrom[0]['line'] . ')'."\n";
}else{
echo '<strong>' . substr(str_replace(ROOT, '', $calledFrom[0]['file']), 1) . '</strong>';
echo ' (line <strong>' . $calledFrom[0]['line'] . '</strong>)';
}
}
if(!defined('CAKEPHP_SHELL')){
echo "\n<pre class=\"cake-debug\">\n";
} }
echo "\n<pre class=\"cake-debug\">\n";
$var = print_r($var, true); $var = print_r($var, true);
if ($showHtml) { if ($showHtml) {
$var = str_replace('<', '&lt;', str_replace('>', '&gt;', $var)); $var = str_replace('<', '&lt;', str_replace('>', '&gt;', $var));
} }
echo $var . "\n</pre>\n"; echo $var . "\n";
if(!defined('CAKEPHP_SHELL')){
echo "<pre class=\"cake-debug\">\n";
}else{
echo "#########################\n";
};
} }
} }
if (!function_exists('sortByKey')) { if (!function_exists('sortByKey')) {