mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Tiny Improvement of debug() output when running on console
Signed-off-by: mark_story <mark@mark-story.com>
This commit is contained in:
parent
138482741f
commit
cef9927604
1 changed files with 17 additions and 4 deletions
|
@ -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('<', '<', str_replace('>', '>', $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')) {
|
||||
|
|
Loading…
Reference in a new issue