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 ($showFrom) {
$calledFrom = debug_backtrace();
echo '<strong>' . substr(str_replace(ROOT, '', $calledFrom[0]['file']), 1) . '</strong>';
echo ' (line <strong>' . $calledFrom[0]['line'] . '</strong>)';
if(defined('CAKEPHP_SHELL')){
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);
if ($showHtml) {
$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')) {