Merge pull request #48 from green-ponies/master

Small commit
This commit is contained in:
Shish Moom 2011-10-24 02:28:51 -07:00
commit d5d2bf66af
2 changed files with 6 additions and 4 deletions

View File

@ -123,7 +123,8 @@ class Blotter extends SimpleExtension {
private function display_blotter() { private function display_blotter() {
global $database, $config; global $database, $config;
$limit = $config->get_int("blotter_recent", 5); $limit = $config->get_int("blotter_recent", 5);
$entries = $database->get_all("SELECT * FROM blotter ORDER BY id DESC LIMIT :lim", array("lim"=>$limit)); $sql = 'SELECT * FROM blotter ORDER BY id DESC LIMIT '.intval($limit);
$entries = $database->get_all($sql);
$this->theme->display_blotter($entries); $this->theme->display_blotter($entries);
} }
} }

View File

@ -745,7 +745,7 @@ function send_event(Event $event) {
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function get_debug_info() { function get_debug_info() {
global $config, $_event_count; global $config, $_event_count, $database, $_execs;
if(function_exists('memory_get_usage')) { if(function_exists('memory_get_usage')) {
$i_mem = sprintf("%5.2f", ((memory_get_usage()+512)/1024)/1024); $i_mem = sprintf("%5.2f", ((memory_get_usage()+512)/1024)/1024);
@ -762,15 +762,16 @@ function get_debug_info() {
$i_utime = "???"; $i_utime = "???";
$i_stime = "???"; $i_stime = "???";
} }
$i_files = count(get_included_files()); $i_files = count(get_included_files());
global $_execs;
global $database;
$hits = $database->cache->get_hits(); $hits = $database->cache->get_hits();
$miss = $database->cache->get_misses(); $miss = $database->cache->get_misses();
$debug = "<br>Took $i_utime + $i_stime seconds and {$i_mem}MB of RAM"; $debug = "<br>Took $i_utime + $i_stime seconds and {$i_mem}MB of RAM";
$debug .= "; Used $i_files files and $_execs queries"; $debug .= "; Used $i_files files and $_execs queries";
$debug .= "; Sent $_event_count events"; $debug .= "; Sent $_event_count events";
$debug .= "; $hits cache hits and $miss misses"; $debug .= "; $hits cache hits and $miss misses";
$debug .= "; Shimmie version ". VERSION .", SCore Version ". SCORE_VERSION;
return $debug; return $debug;
} }