pull a bunch of r34 tweaks intro trunk

git-svn-id: file:///home/shish/svn/shimmie2/trunk@959 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish
2008-07-29 19:43:34 +00:00
parent 8ac2428820
commit c741ea216f
3 changed files with 25 additions and 3 deletions

View File

@ -162,7 +162,12 @@ function _count_execs($db, $sql, $inputarray) {
global $_execs;
if(DEBUG) {
$fp = fopen("sql.log", "a");
fwrite($fp, preg_replace('/\s+/msi', ' ', $sql)."\n");
if(is_array($inputarray)) {
fwrite($fp, preg_replace('/\s+/msi', ' ', $sql)." -- ".join(", ", $inputarray)."\n");
}
else {
fwrite($fp, preg_replace('/\s+/msi', ' ', $sql)."\n");
}
fclose($fp);
}
if (!is_array($inputarray)) $_execs++;
@ -262,6 +267,12 @@ function move_upload_to_archive($event) {
return true;
}
function format_text($string) {
$tfe = new TextFormattingEvent($string);
send_event($tfe);
return $tfe->formatted;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Debugging functions *
@ -287,9 +298,13 @@ function get_debug_info() {
}
$i_files = count(get_included_files());
global $_execs;
global $database;
$hits = $database->cache_hits;
$miss = $database->cache_misses;
$debug = "<br>Took $i_utime + $i_stime seconds and {$i_mem}MB of RAM";
$debug .= "; Used $i_files files and $_execs queries";
$debug .= "; Sent $_event_count events";
$debug .= "; $hits cache hits and $miss misses";
return $debug;
}