Keys →
Functions ↓
function prtv ( $str, $prt=true ) {#-k print debug#- dump a variable & all related info to log file#- if $prt == false, we just want to build the string and return it#-d 4/7/12 - returns output str global $logfcb; $t = $logfcb['log']['t'] . ' '; $L = ''; if (is_bool($ar[$ii]['cont'])) { $L = "; bool) = [" . (boolval($str) ? 'bool-true' : 'bool-false') . "]"; } elseif (is_scalar($str)) { $L = "; len=" . strlen($str) . ") = [" . $str . "]"; } elseif (!strlen($str)) { $L = "; len = 0)"; } else { $L = ") = {\n" . print_r($str,true) . "\n}"; } $raw = debug_backtrace(); $raw[]['function'] = 'MAIN'; for ($i=0;$i<count($raw);$i++) $raw[$i]['fname'] = substr ( $raw[$i]['file'], strrpos ($raw[$i]['file'],'/')+1 );# for ($i=count($raw)-2;$i>=0;$i--)# $hdr .= $raw[$i+1]['function'] . "@'" . $raw[$i]['fname'] . '[' . $raw[$i]['line'] . "]' "; $hdr = pathinfo (callingPath()); $callingFile = file ( $raw[0]['file'] ); $theLine = $callingFile[$raw[0]['line']-1]; $x = strpos ( $theLine,'(' )+1; $y = strrpos ( $theLine,')' ); $var = trim(substr ( $theLine,$x,$y-$x )); $var = str_replace( '<', '‹', $var ); $logmsg = date('Y-m-d H:i:s') . $t . $hdr['basename'] . $var . '(type: ' . is($str) . $L . "\n"; if ($prt) { $cnt = fwrite ( $logfcb['log']['f'], $logmsg ); if (!$cnt) echo str_replace ( "\n", '<br>', 'LOGFILE ERROR FALLBACK<pre>'.$logmsg.'</pre>' ); # log i/o failed; dump to screen } return $logmsg; }?>