diff --git a/.gitignore b/.gitignore index ac8f2f2..1158bad 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ dumps incoming_symbols logs htdocs/lib/logs +htdocs/lib/irc_passwd .hg* diff --git a/htdocs/batch_process.php b/htdocs/batch_process.php index 5f0a877..d306836 100644 --- a/htdocs/batch_process.php +++ b/htdocs/batch_process.php @@ -28,6 +28,8 @@ print "Working dir set to " . ReportParser::getWorkPath() . "\n"; mkdir(ReportParser::getWorkPath()); chdir(ReportParser::getWorkPath()); +$nr = 0; + foreach($reports as $id) { print "Processing report {$id} \n"; @@ -50,9 +52,14 @@ foreach($reports as $id) $crash->init($id, $r, $stacktrace); if ($crash->save()) { + $nr++; ReportParser::setProcessed($id, 1); } } rrmdir(ReportParser::getWorkPath()); +if ($nr) +{ + IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new crash reports. http://crash.singularityviewer.org/crashes.php "); +} \ No newline at end of file diff --git a/htdocs/lib/DBH.php b/htdocs/lib/DBH.php index 246d6b2..138839f 100644 --- a/htdocs/lib/DBH.php +++ b/htdocs/lib/DBH.php @@ -12,7 +12,7 @@ class DBH function log($line) { - //return; + return; static $f = false; static $failed = false; @@ -54,8 +54,8 @@ class DBH } - $this->query("SET SQL_MODE='TRADITIONAL'"); - $this->query("SET NAMES 'utf8'"); + //$this->query("SET SQL_MODE='TRADITIONAL'"); + $this->query("SET NAMES 'utf8'"); return true; } diff --git a/htdocs/lib/IRCNotify.php b/htdocs/lib/IRCNotify.php new file mode 100644 index 0000000..bd1ed85 --- /dev/null +++ b/htdocs/lib/IRCNotify.php @@ -0,0 +1,27 @@ + $chan, + "auth" => file_get_contents(SITE_ROOT . '/lib/irc_passwd'), + "msg" => $msg + ); + + self::http_post("http://messi.streamgrid.net/~lkalif/lolabot.php", $fields); + } +} \ No newline at end of file diff --git a/htdocs/lib/db_init.sql b/htdocs/lib/db_init.sql index 4d2451a..dc1f482 100644 --- a/htdocs/lib/db_init.sql +++ b/htdocs/lib/db_init.sql @@ -52,5 +52,5 @@ create table reports( crash_reason varchar(128), crash_address varchar(16), crash_thread integer, - raw_stacktrace text + raw_stacktrace longtext ); \ No newline at end of file