AEOS/lib/debug.lib.php
2026-08-26 17:23:29 +02:00

27 lines
786 B
PHP

<?php
// Listings des fonctions DEBUG d'AEOS.
// *****************************************************
ini_set('display_errors', 1);
ini_set('log_errors', 1);
//=== Show an array with pre tag
//=== IN: A for what to show [ARRAY FORMAT]
//=== OUT: None [ECHO]
function view($a)
{
print_r("<pre>");
print_r($a);
print_r("</pre>");
}
function debug() {
$trace = debug_backtrace();
$rootPath = dirname(dirname(__FILE__));
$file = str_replace($rootPath, '', $trace[0]['file']);
$line = $trace[0]['line'];
$var = $trace[0]['args'][0];
$lineInfo = sprintf('<div><strong>%s</strong> (line <strong>%s</strong>)</div>', $file, $line);
$debugInfo = sprintf('<pre>%s</pre>', print_r($var, true));
print_r($lineInfo.$debugInfo);
}
?>